bulletin-deploy 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { deploy } from "../dist/deploy.js";
3
+ import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE } from "../dist/deploy.js";
4
4
  import { bootstrapPool } from "../dist/pool.js";
5
5
  import * as fs from "fs";
6
6
 
@@ -32,13 +32,10 @@ Options:
32
32
  process.exit(0);
33
33
  }
34
34
 
35
- if (flags.rpc) process.env.BULLETIN_RPC = flags.rpc;
36
- if (flags.poolSize) process.env.BULLETIN_POOL_SIZE = String(flags.poolSize);
37
-
38
35
  try {
39
36
  if (flags.bootstrap) {
40
- const rpc = process.env.BULLETIN_RPC || "wss://paseo-bulletin-rpc.polkadot.io";
41
- const poolSize = parseInt(process.env.BULLETIN_POOL_SIZE || "10", 10);
37
+ const rpc = flags.rpc ?? process.env.BULLETIN_RPC ?? DEFAULT_BULLETIN_RPC;
38
+ const poolSize = flags.poolSize ?? parseInt(process.env.BULLETIN_POOL_SIZE ?? String(DEFAULT_POOL_SIZE), 10);
42
39
  await bootstrapPool(rpc, poolSize, flags.mnemonic);
43
40
  } else {
44
41
  const [buildDir, domain] = positional;
@@ -49,6 +46,8 @@ try {
49
46
  const result = await deploy(buildDir, domain, {
50
47
  playground: flags.playground,
51
48
  mnemonic: flags.mnemonic,
49
+ rpc: flags.rpc,
50
+ poolSize: flags.poolSize,
52
51
  });
53
52
 
54
53
  const output = process.env.GITHUB_OUTPUT;
@@ -41,8 +41,10 @@ import { createCdm } from "@dotdm/cdm";
41
41
  import { getPolkadotSigner } from "polkadot-api/signer";
42
42
  import { sr25519CreateDerive } from "@polkadot-labs/hdkd";
43
43
  import { mnemonicToEntropy, entropyToMiniSecret, ss58Address } from "@polkadot-labs/hdkd-helpers";
44
- var BULLETIN_RPC = process.env.BULLETIN_RPC || "wss://paseo-bulletin-rpc.polkadot.io";
45
- var POOL_SIZE = parseInt(process.env.BULLETIN_POOL_SIZE || "10", 10);
44
+ var DEFAULT_BULLETIN_RPC = "wss://paseo-bulletin-rpc.polkadot.io";
45
+ var DEFAULT_POOL_SIZE = 10;
46
+ var BULLETIN_RPC = DEFAULT_BULLETIN_RPC;
47
+ var POOL_SIZE = DEFAULT_POOL_SIZE;
46
48
  var CHUNK_SIZE = 1 * 1024 * 1024;
47
49
  var MAX_FILE_SIZE = 8 * 1024 * 1024;
48
50
  var CID_CONFIG = { version: 1, codec: 85, hashCode: 18, hashLength: 32 };
@@ -390,6 +392,8 @@ async function storeDirectory(directoryPath, provider = {}) {
390
392
  return { storageCid, ipfsCid };
391
393
  }
392
394
  async function deploy(content, domainName = null, options = {}) {
395
+ BULLETIN_RPC = options.rpc ?? process.env.BULLETIN_RPC ?? DEFAULT_BULLETIN_RPC;
396
+ POOL_SIZE = options.poolSize ?? parseInt(process.env.BULLETIN_POOL_SIZE ?? String(DEFAULT_POOL_SIZE), 10);
393
397
  initTelemetry();
394
398
  const randomSuffix = Math.floor(Math.random() * 100).toString().padStart(2, "0");
395
399
  const name = domainName ? domainName.replace(".dot", "") : `test-domain-${Date.now().toString(36)}${randomSuffix}`;
@@ -534,6 +538,8 @@ async function deploy(content, domainName = null, options = {}) {
534
538
  }
535
539
 
536
540
  export {
541
+ DEFAULT_BULLETIN_RPC,
542
+ DEFAULT_POOL_SIZE,
537
543
  deriveRootSigner,
538
544
  createCID,
539
545
  encodeContenthash,
package/dist/deploy.d.ts CHANGED
@@ -14,6 +14,8 @@ interface ExistingProvider {
14
14
  signer?: PolkadotSigner;
15
15
  ss58?: string;
16
16
  }
17
+ declare const DEFAULT_BULLETIN_RPC = "wss://paseo-bulletin-rpc.polkadot.io";
18
+ declare const DEFAULT_POOL_SIZE = 10;
17
19
  declare function deriveRootSigner(mnemonic: string): {
18
20
  signer: PolkadotSigner;
19
21
  ss58: string;
@@ -35,7 +37,9 @@ declare function storeDirectory(directoryPath: string, provider?: ExistingProvid
35
37
  interface DeployOptions {
36
38
  playground?: boolean;
37
39
  mnemonic?: string;
40
+ rpc?: string;
41
+ poolSize?: number;
38
42
  }
39
43
  declare function deploy(content: DeployContent, domainName?: string | null, options?: DeployOptions): Promise<DeployResult>;
40
44
 
41
- export { type DeployContent, type DeployOptions, type DeployResult, chunk, createCID, deploy, deriveRootSigner, encodeContenthash, hasIPFS, merkleize, storeChunkedContent, storeDirectory, storeFile };
45
+ export { DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, chunk, createCID, deploy, deriveRootSigner, encodeContenthash, hasIPFS, merkleize, storeChunkedContent, storeDirectory, storeFile };
package/dist/deploy.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import {
2
+ DEFAULT_BULLETIN_RPC,
3
+ DEFAULT_POOL_SIZE,
2
4
  chunk,
3
5
  createCID,
4
6
  deploy,
@@ -9,12 +11,14 @@ import {
9
11
  storeChunkedContent,
10
12
  storeDirectory,
11
13
  storeFile
12
- } from "./chunk-YHBWBSUS.js";
14
+ } from "./chunk-O6BOGJM6.js";
13
15
  import "./chunk-EMQEE6KJ.js";
14
16
  import "./chunk-AIHW2WLO.js";
15
17
  import "./chunk-S5VOTF3L.js";
16
18
  import "./chunk-QGM4M3NI.js";
17
19
  export {
20
+ DEFAULT_BULLETIN_RPC,
21
+ DEFAULT_POOL_SIZE,
18
22
  chunk,
19
23
  createCID,
20
24
  deploy,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-YHBWBSUS.js";
3
+ } from "./chunk-O6BOGJM6.js";
4
4
  import {
5
5
  DotNS
6
6
  } from "./chunk-EMQEE6KJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulletin-deploy",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",