@parity/product-deploy 0.10.0-rc.2 → 0.10.0-rc.4

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.
Files changed (47) hide show
  1. package/DEPLOYMENT.md +61 -83
  2. package/bin/bulletin-bootstrap +24 -9
  3. package/dist/auth/index.js +2 -1
  4. package/dist/auth/vendor/index.js +2 -1
  5. package/dist/auth-config.js +4 -3
  6. package/dist/bug-report.js +4 -4
  7. package/dist/{chunk-SXWFDMFT.js → chunk-3CUIQTSD.js} +5 -2
  8. package/dist/{chunk-4PVJ2JBZ.js → chunk-4IUTMHVB.js} +73 -41
  9. package/dist/{chunk-5OKB3TEB.js → chunk-5FLTDWWP.js} +4 -1
  10. package/dist/{chunk-UJJQME5K.js → chunk-5V2RCZXO.js} +1 -1
  11. package/dist/{chunk-4D6STP5G.js → chunk-76CVW4DE.js} +1 -1
  12. package/dist/{chunk-XX6LNB74.js → chunk-BZRRNX7T.js} +5 -4
  13. package/dist/{chunk-WM5R4O33.js → chunk-CCTQO2Q4.js} +1 -1
  14. package/dist/{chunk-C74YSAWC.js → chunk-CJHVSSSR.js} +50 -21
  15. package/dist/{chunk-I7UEBFP5.js → chunk-GRWWVYSV.js} +2 -2
  16. package/dist/chunk-TSPERKUS.js +6 -0
  17. package/dist/{chunk-LYWIW6WU.js → chunk-W2VFJGBC.js} +1 -1
  18. package/dist/{chunk-RI3ZLNPN.js → chunk-WIMRJK32.js} +1 -1
  19. package/dist/{chunk-V5VD5CIC.js → chunk-XOR2CEKA.js} +2 -2
  20. package/dist/{chunk-EHQPRWGC.js → chunk-ZHRQDZIK.js} +1 -1
  21. package/dist/chunk-probe.js +3 -3
  22. package/dist/commands/login.js +27 -18
  23. package/dist/commands/logout.js +6 -5
  24. package/dist/commands/transfer.js +8 -5
  25. package/dist/commands/whoami.js +7 -4
  26. package/dist/deploy-actors.js +6 -5
  27. package/dist/deploy.d.ts +19 -2
  28. package/dist/deploy.js +17 -10
  29. package/dist/dotns.js +4 -4
  30. package/dist/index.js +13 -12
  31. package/dist/manifest/byte-budget.d.ts +4 -5
  32. package/dist/manifest/byte-budget.js +1 -1
  33. package/dist/manifest/publish.js +13 -12
  34. package/dist/memory-report.js +2 -2
  35. package/dist/merkle.js +11 -10
  36. package/dist/personhood/bootstrap.js +4 -4
  37. package/dist/personhood/people-client.js +4 -4
  38. package/dist/pool.d.ts +7 -2
  39. package/dist/pool.js +3 -1
  40. package/dist/run-state.js +1 -1
  41. package/dist/sss-allowance-cache.js +5 -4
  42. package/dist/storage-signer.js +11 -10
  43. package/dist/telemetry.js +2 -2
  44. package/dist/version-check.js +3 -3
  45. package/docs/bootstrap.md +47 -13
  46. package/docs/e2e-bootstrap.md +5 -0
  47. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  preflightSssAllowance
3
- } from "./chunk-UJJQME5K.js";
3
+ } from "./chunk-5V2RCZXO.js";
4
4
  import {
5
5
  statementSigningAccount
6
6
  } from "./chunk-GRPLHUYC.js";
@@ -34,16 +34,19 @@ import {
34
34
  STALE_SESSION_MESSAGE,
35
35
  getPeopleChainEndpoints,
36
36
  hasPersistedSession
37
- } from "./chunk-SXWFDMFT.js";
37
+ } from "./chunk-3CUIQTSD.js";
38
38
  import {
39
39
  setDeployContext
40
- } from "./chunk-V5VD5CIC.js";
40
+ } from "./chunk-XOR2CEKA.js";
41
41
  import {
42
42
  probeChunks
43
- } from "./chunk-LYWIW6WU.js";
43
+ } from "./chunk-W2VFJGBC.js";
44
44
  import {
45
45
  packSection
46
46
  } from "./chunk-C2TS5MER.js";
47
+ import {
48
+ CLI_NAME
49
+ } from "./chunk-TSPERKUS.js";
47
50
  import {
48
51
  DotNS,
49
52
  PUBLISHER_ABI,
@@ -53,7 +56,7 @@ import {
53
56
  parseDomainName,
54
57
  popStatusName,
55
58
  verifyNonceAdvanced
56
- } from "./chunk-I7UEBFP5.js";
59
+ } from "./chunk-GRWWVYSV.js";
57
60
  import {
58
61
  derivePoolAccounts,
59
62
  detectTestnet,
@@ -61,7 +64,7 @@ import {
61
64
  fetchPoolAuthorizations,
62
65
  isAuthorizationSufficient,
63
66
  selectAccount
64
- } from "./chunk-4PVJ2JBZ.js";
67
+ } from "./chunk-4IUTMHVB.js";
65
68
  import {
66
69
  VERSION,
67
70
  captureWarning,
@@ -75,7 +78,7 @@ import {
75
78
  truncateAddress,
76
79
  withDeploySpan,
77
80
  withSpan
78
- } from "./chunk-4D6STP5G.js";
81
+ } from "./chunk-76CVW4DE.js";
79
82
  import {
80
83
  DEFAULT_ENV_ID,
81
84
  getPopSelfServeConfig,
@@ -417,7 +420,9 @@ function isBenignTeardownError(error) {
417
420
  const s = error instanceof Error ? `${error.name ?? ""} ${error.message ?? ""}` : String(error);
418
421
  return /DestroyedError|Client destroyed/.test(s);
419
422
  }
420
- var CID_CONFIG = { version: 1, codec: 85, hashCode: 18, hashLength: 32 };
423
+ var SHA256_MULTIHASH_CODE = 18;
424
+ var BLAKE2B_256_MULTIHASH_CODE = 45600;
425
+ var CID_CONFIG = { version: 1, codec: 85, hashCode: SHA256_MULTIHASH_CODE, hashLength: 32 };
421
426
  function deriveRootSigner(mnemonic, path3 = "") {
422
427
  const entropy = mnemonicToEntropy(mnemonic);
423
428
  const miniSecret = entropyToMiniSecret(entropy);
@@ -593,6 +598,9 @@ function chooseSignerInput(opts) {
593
598
  function isPhoneSignerActive(options) {
594
599
  return !!(options.signer && options.signerAddress && !options.transferTo);
595
600
  }
601
+ function shouldHandoverName(opts) {
602
+ return !!opts.transferTo && opts.registeredFresh;
603
+ }
596
604
  function formatStorageSignerLine(slotAddress, failReason) {
597
605
  if (slotAddress) return ` Storage signer: allowance slot ${slotAddress}`;
598
606
  return ` Storage signer: pool fallback (${failReason ?? "no session"})`;
@@ -616,7 +624,7 @@ function selectStorageReconnect(options) {
616
624
  console.warn(
617
625
  `\u26A0 Bulletin allowance slot not usable: ${reason}
618
626
  Falling back to the shared pool account for storage (fine on testnet).
619
- To use your own allowance, run: bulletin-deploy logout && bulletin-deploy login`
627
+ To use your own allowance, run: ${CLI_NAME} logout && ${CLI_NAME} login`
620
628
  );
621
629
  return getProvider();
622
630
  }
@@ -690,9 +698,8 @@ function watchTransaction(tx, signer, txOpts, onSuccess, { label = "transaction"
690
698
  });
691
699
  }
692
700
  async function storeChunk(unsafeApi, signer, chunkBytes, nonce, ss58, opts = {}) {
693
- const hashCode = 18;
694
- const cid = createCID(chunkBytes, CID_CONFIG.codec, hashCode);
695
- const tx = unsafeApi.tx.TransactionStorage.store_with_cid_config({ cid: { codec: BigInt(CID_CONFIG.codec), hashing: toHashingEnum(hashCode) }, data: chunkBytes });
701
+ const cid = createCID(chunkBytes, CID_CONFIG.codec, CID_CONFIG.hashCode);
702
+ const tx = unsafeApi.tx.TransactionStorage.store_with_cid_config({ cid: { codec: BigInt(CID_CONFIG.codec), hashing: toHashingEnum(CID_CONFIG.hashCode) }, data: chunkBytes });
696
703
  const txOpts = { mortality: { mortal: true, period: CHUNK_MORTALITY_PERIOD }, nonce };
697
704
  const { value, viaFallback, receipt } = await watchTransaction(tx, signer, txOpts, () => {
698
705
  console.log(` CID: ${cid.toString()}`);
@@ -700,11 +707,15 @@ async function storeChunk(unsafeApi, signer, chunkBytes, nonce, ss58, opts = {})
700
707
  }, { label: `chunk(nonce:${nonce})`, rpc: BULLETIN_ENDPOINTS, senderSS58: ss58, expectedNonce: nonce, timeoutMs: CHUNK_TIMEOUT_MS, fetchNonce: opts.fetchNonce });
701
708
  return { ...value, viaFallback, receipt };
702
709
  }
703
- async function storeFile(contentBytes, { client: existingClient, unsafeApi: existingApi, signer: existingSigner } = {}) {
710
+ async function storeFile(contentBytes, {
711
+ client: existingClient,
712
+ unsafeApi: existingApi,
713
+ signer: existingSigner,
714
+ hashCode = CID_CONFIG.hashCode
715
+ } = {}) {
704
716
  console.log(`
705
717
  Size: ${(contentBytes.length / 1024).toFixed(2)} KB`);
706
718
  if (contentBytes.length > MAX_FILE_SIZE) throw new Error(`File exceeds 8MB limit. Use chunked deployment.`);
707
- const hashCode = 18;
708
719
  const cid = createCID(contentBytes, CID_CONFIG.codec, hashCode);
709
720
  console.log(` CID: ${cid.toString()}`);
710
721
  let client, unsafeApi, signer;
@@ -719,6 +730,13 @@ async function storeFile(contentBytes, { client: existingClient, unsafeApi: exis
719
730
  signer = provider.signer;
720
731
  }
721
732
  try {
733
+ const [probe] = await probeChunks([cid.toString()], { client });
734
+ if (probe.present === true) {
735
+ console.log(` Already on chain (block ${probe.block}, index ${probe.index}) \u2014 skipping upload.
736
+ `);
737
+ if (!existingClient) client.destroy();
738
+ return cid.toString();
739
+ }
722
740
  const tx = unsafeApi.tx.TransactionStorage.store_with_cid_config({ cid: { codec: BigInt(CID_CONFIG.codec), hashing: toHashingEnum(hashCode) }, data: contentBytes });
723
741
  const txOpts = { mortality: { mortal: true, period: 256 } };
724
742
  console.log(` Submitting...`);
@@ -1996,7 +2014,7 @@ async function deploy(content, domainName = null, options = {}) {
1996
2014
  if (options.suri) throw e;
1997
2015
  if (e?.name === "SignerNotAvailableError") {
1998
2016
  if (hasSession) console.error(STALE_SESSION_MESSAGE);
1999
- else console.log(" Login session unavailable or expired \u2014 falling back to pool. Run `bulletin-deploy login` to use your identity.");
2017
+ else console.log(` Login session unavailable or expired \u2014 falling back to pool. Run \`${CLI_NAME} login\` to use your identity.`);
2000
2018
  } else {
2001
2019
  throw e;
2002
2020
  }
@@ -2012,7 +2030,7 @@ async function deploy(content, domainName = null, options = {}) {
2012
2030
  const allowed = await preflightSssAllowance(statementAccount, () => getPeopleChainEndpoints(envId));
2013
2031
  if (allowed === false) {
2014
2032
  throw new NonRetryableError(
2015
- "Session signing allowance has expired (~2-3 days after login). Run `bulletin-deploy logout`, then `bulletin-deploy login`, to renew (login alone won't refresh a stale session)."
2033
+ `Session signing allowance has expired (~2-3 days after login). Run \`${CLI_NAME} logout\`, then \`${CLI_NAME} login\`, to renew (login alone won't refresh a stale session).`
2016
2034
  );
2017
2035
  }
2018
2036
  } catch (e) {
@@ -2394,6 +2412,7 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2394
2412
  ...phoneSignerActive ? { onPhoneSigningRequired: (label) => console.log(`
2395
2413
  Check your phone \u2192 ${label}`) } : {}
2396
2414
  });
2415
+ let registeredFresh = false;
2397
2416
  if (parsed?.isSubdomain) {
2398
2417
  const { owned, owner } = await dotns.checkSubdomainOwnership(parsed.sublabel, parsed.parentLabel);
2399
2418
  if (owned) {
@@ -2405,6 +2424,7 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2405
2424
  if (!parentOwnership.owned) throw new Error(`You must own ${parsed.parentLabel}.dot to register subdomains under it`);
2406
2425
  console.log(` Status: Registering subdomain...`);
2407
2426
  await dotns.registerSubdomain(parsed.sublabel, parsed.parentLabel);
2427
+ registeredFresh = true;
2408
2428
  }
2409
2429
  } else {
2410
2430
  const { owned } = await dotns.checkOwnership(name);
@@ -2413,6 +2433,7 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2413
2433
  } else {
2414
2434
  console.log(` Status: Registering...`);
2415
2435
  await dotns.register(name);
2436
+ registeredFresh = true;
2416
2437
  }
2417
2438
  }
2418
2439
  const contenthashHex = `0x${encodeContenthash(cid)}`;
@@ -2422,7 +2443,12 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2422
2443
  await publish(dotns, parsed, options.failOnPublishError);
2423
2444
  }
2424
2445
  }
2425
- if (options.transferTo) {
2446
+ if (options.transferTo && !registeredFresh) {
2447
+ console.log(` ${name}.dot already existed \u2014 updated content only; ownership unchanged (not transferred to ${options.transferTo}).`);
2448
+ console.log(` If you meant to claim it, run: ${CLI_NAME} transfer ${name} --env ${envId}${options.suri ? ` --mnemonic "<your worker key>"` : ""}`);
2449
+ setDeployAttribute("deploy.transfer.status", "skipped-existing");
2450
+ }
2451
+ if (shouldHandoverName({ transferTo: options.transferTo, registeredFresh })) {
2426
2452
  const transferTo = options.transferTo;
2427
2453
  await withSpan("deploy.transfer", `3. transfer ${name}.dot`, { "deploy.transfer.to": transferTo }, async () => {
2428
2454
  setDeployAttribute("deploy.transfer.worker", truncateAddress(options.signerAddress ?? ""));
@@ -2434,7 +2460,7 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2434
2460
  console.log(` Handed ${name}.dot to ${transferTo} (${transferRes.status}${transferRes.txHash ? `, tx ${transferRes.txHash}` : ""}).`);
2435
2461
  } catch (e) {
2436
2462
  setDeployAttribute("deploy.transfer.status", "failed");
2437
- const recover = `bulletin-deploy transfer ${name} --env ${envId}` + (options.suri ? ` --mnemonic "<your worker key>"` : "");
2463
+ const recover = `${CLI_NAME} transfer ${name} --env ${envId}` + (options.suri ? ` --mnemonic "<your worker key>"` : "");
2438
2464
  try {
2439
2465
  dotns.disconnect();
2440
2466
  } catch {
@@ -2497,9 +2523,9 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2497
2523
  console.log("\n" + "=".repeat(60));
2498
2524
  console.log("DEPLOYMENT COMPLETE!");
2499
2525
  console.log("=".repeat(60));
2500
- console.log("\nPolkadot Triangle");
2501
- console.log(` - Polkadot Desktop: ${name}.dot`);
2502
- console.log(` - Polkadot Browser: ${browserUrlFor(name, envId)}`);
2526
+ console.log("\nCheck it out here:");
2527
+ console.log(` ${browserUrlFor(name, envId)}`);
2528
+ console.log(` ${name}.dot (in a Polkadot-aware browser)`);
2503
2529
  console.log("\n" + "=".repeat(60) + "\n");
2504
2530
  return { domainName: name, fullDomain: `${name}.dot`, cid, ipfsCid };
2505
2531
  } finally {
@@ -2938,6 +2964,8 @@ export {
2938
2964
  retryBudgetExhausted,
2939
2965
  isConnectionError,
2940
2966
  isBenignTeardownError,
2967
+ SHA256_MULTIHASH_CODE,
2968
+ BLAKE2B_256_MULTIHASH_CODE,
2941
2969
  deriveRootSigner,
2942
2970
  createCID,
2943
2971
  encodeContenthash,
@@ -2951,6 +2979,7 @@ export {
2951
2979
  __selectStorageProviderModeForTest,
2952
2980
  chooseSignerInput,
2953
2981
  isPhoneSignerActive,
2982
+ shouldHandoverName,
2954
2983
  formatStorageSignerLine,
2955
2984
  storeFile,
2956
2985
  __assignDenseNoncesForTest,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SI2ZUOYD.js";
4
4
  import {
5
5
  isTestnetSpecName
6
- } from "./chunk-4PVJ2JBZ.js";
6
+ } from "./chunk-4IUTMHVB.js";
7
7
  import {
8
8
  captureWarning,
9
9
  markCodePath,
@@ -11,7 +11,7 @@ import {
11
11
  setDeploySentryTag,
12
12
  truncateAddress,
13
13
  withSpan
14
- } from "./chunk-4D6STP5G.js";
14
+ } from "./chunk-76CVW4DE.js";
15
15
  import {
16
16
  validateContractAddresses
17
17
  } from "./chunk-QRKI6MMK.js";
@@ -0,0 +1,6 @@
1
+ // src/cli-name.ts
2
+ var CLI_NAME = "bulletin-deploy";
3
+
4
+ export {
5
+ CLI_NAME
6
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  captureWarning
3
- } from "./chunk-4D6STP5G.js";
3
+ } from "./chunk-76CVW4DE.js";
4
4
 
5
5
  // src/chunk-probe.ts
6
6
  import { Twox128, Blake2128Concat, decAnyMetadata, unifyMetadata } from "@polkadot-api/substrate-bindings";
@@ -1,6 +1,6 @@
1
1
  // src/manifest/byte-budget.ts
2
2
  var DEFAULT_TEXT_RECORD_BUDGET_BYTES = 1024;
3
- var PLACEHOLDER_CID = "bafkreigh2akiscaildc7zh3vznzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
3
+ var PLACEHOLDER_CID = "bafk2bzacecjiwibwnfb6fl6rd26a5lrokoutx4lxut6pgw6mmtkqg4comxrae";
4
4
  function getTextRecordBudgetBytes() {
5
5
  const raw = process.env.BULLETIN_TEXT_BUDGET;
6
6
  if (raw === void 0 || raw === "") return DEFAULT_TEXT_RECORD_BUDGET_BYTES;
@@ -2,11 +2,11 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-EHQPRWGC.js";
5
+ } from "./chunk-ZHRQDZIK.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId
9
- } from "./chunk-4D6STP5G.js";
9
+ } from "./chunk-76CVW4DE.js";
10
10
 
11
11
  // src/bug-report.ts
12
12
  import { execSync, execFileSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-4D6STP5G.js";
3
+ } from "./chunk-76CVW4DE.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -5,9 +5,9 @@ import {
5
5
  _decodeStorageValue,
6
6
  _resetProbeSession,
7
7
  probeChunks
8
- } from "./chunk-LYWIW6WU.js";
9
- import "./chunk-4D6STP5G.js";
10
- import "./chunk-WM5R4O33.js";
8
+ } from "./chunk-W2VFJGBC.js";
9
+ import "./chunk-76CVW4DE.js";
10
+ import "./chunk-CCTQO2Q4.js";
11
11
  export {
12
12
  ChainProbeCrossValidationError,
13
13
  ChainProbeMetadataError,
@@ -8,16 +8,16 @@ import {
8
8
  createSlotAccountSigner,
9
9
  requestResourceAllocation,
10
10
  summarizeOutcomes
11
- } from "../chunk-5OKB3TEB.js";
11
+ } from "../chunk-5FLTDWWP.js";
12
12
  import {
13
13
  renderLoginStatus
14
14
  } from "../chunk-RIRDBSBG.js";
15
15
  import {
16
16
  waitForBulletinAuthorization
17
- } from "../chunk-C74YSAWC.js";
17
+ } from "../chunk-CJHVSSSR.js";
18
18
  import {
19
19
  preflightSssAllowance
20
- } from "../chunk-UJJQME5K.js";
20
+ } from "../chunk-5V2RCZXO.js";
21
21
  import {
22
22
  statementSigningAccount
23
23
  } from "../chunk-GRPLHUYC.js";
@@ -31,16 +31,19 @@ import {
31
31
  getAuthClient,
32
32
  getPeopleChainEndpoints,
33
33
  resolveBulletinEndpoints
34
- } from "../chunk-SXWFDMFT.js";
35
- import "../chunk-V5VD5CIC.js";
36
- import "../chunk-EHQPRWGC.js";
37
- import "../chunk-LYWIW6WU.js";
34
+ } from "../chunk-3CUIQTSD.js";
35
+ import "../chunk-XOR2CEKA.js";
36
+ import "../chunk-ZHRQDZIK.js";
37
+ import "../chunk-W2VFJGBC.js";
38
38
  import "../chunk-C2TS5MER.js";
39
- import "../chunk-I7UEBFP5.js";
39
+ import {
40
+ CLI_NAME
41
+ } from "../chunk-TSPERKUS.js";
42
+ import "../chunk-GRWWVYSV.js";
40
43
  import "../chunk-SI2ZUOYD.js";
41
- import "../chunk-4PVJ2JBZ.js";
42
- import "../chunk-4D6STP5G.js";
43
- import "../chunk-WM5R4O33.js";
44
+ import "../chunk-4IUTMHVB.js";
45
+ import "../chunk-76CVW4DE.js";
46
+ import "../chunk-CCTQO2Q4.js";
44
47
  import {
45
48
  loadEnvironments
46
49
  } from "../chunk-QRKI6MMK.js";
@@ -56,7 +59,11 @@ function allocationErrorMessage(reason) {
56
59
  case "Rejected":
57
60
  return "Bulletin storage access was declined on your phone. Approve the request to enable storage signing.";
58
61
  case "NotAvailable":
59
- return "Bulletin storage is not available for this product on your phone.\n This may mean the wallet paired under a different product ID.\n Run: bulletin-deploy logout\n Then: bulletin-deploy login\n to re-pair and establish the allocation.";
62
+ return `Bulletin storage is not available for this product on your phone.
63
+ This may mean the wallet paired under a different product ID.
64
+ Run: ${CLI_NAME} logout
65
+ Then: ${CLI_NAME} login
66
+ to re-pair and establish the allocation.`;
60
67
  case "UnexpectedResponse":
61
68
  return "Unexpected response from the mobile wallet during storage allocation. Try again.";
62
69
  default:
@@ -67,7 +74,7 @@ function allocationFailedMessage(reason) {
67
74
  return `Allowance pre-warm failed: ${reason}
68
75
  Likely cause: personhood or alias not yet established for this account.
69
76
  Storage will fall back to the pool for now.
70
- Run: bulletin-deploy logout, then bulletin-deploy login,
77
+ Run: ${CLI_NAME} logout, then ${CLI_NAME} login,
71
78
  to retry once your wallet's personhood/alias is in place.`;
72
79
  }
73
80
  function formatAllocationSummary(summary) {
@@ -137,8 +144,8 @@ async function runLogin(envId, _opts = {}) {
137
144
  console.error(
138
145
  `
139
146
  Statement Store allowance has expired for ${result.address}.
140
- Run: bulletin-deploy logout
141
- Then: bulletin-deploy login
147
+ Run: ${CLI_NAME} logout
148
+ Then: ${CLI_NAME} login
142
149
  to re-pair and renew (allowance lasts ~2-3 days).`
143
150
  );
144
151
  tearingDown = true;
@@ -154,7 +161,7 @@ to re-pair and renew (allowance lasts ~2-3 days).`
154
161
  console.warn(
155
162
  `
156
163
  Bulletin storage slot allowance not available \u2014 storage will fall back to pool.
157
- Run: bulletin-deploy logout && bulletin-deploy login
164
+ Run: ${CLI_NAME} logout && ${CLI_NAME} login
158
165
  to re-establish your allowance.`
159
166
  );
160
167
  }
@@ -197,7 +204,8 @@ to re-establish your allowance.`
197
204
  if (summaryText) console.log(summaryText);
198
205
  if (summary.rejected.length > 0 || summary.unavailable.length > 0) {
199
206
  console.warn(
200
- " Some allowances were not granted \u2014 Bulletin storage falls back to a pool account;\n PGAS/contract gaps surface at deploy time. Run: bulletin-deploy logout && bulletin-deploy login to retry."
207
+ ` Some allowances were not granted \u2014 Bulletin storage falls back to a pool account;
208
+ PGAS/contract gaps surface at deploy time. Run: ${CLI_NAME} logout && ${CLI_NAME} login to retry.`
201
209
  );
202
210
  }
203
211
  let slotSigner = await createSlotAccountSigner(handle.adapter, BULLETIN_RESOURCE);
@@ -245,7 +253,8 @@ to re-establish your allowance.`
245
253
  } else {
246
254
  console.log("\n" + summarizeLogin(handle.address, null));
247
255
  console.warn(
248
- " Bulletin storage slot not available \u2014 storage will fall back to a pool account.\n Run: bulletin-deploy logout && bulletin-deploy login to retry."
256
+ ` Bulletin storage slot not available \u2014 storage will fall back to a pool account.
257
+ Run: ${CLI_NAME} logout && ${CLI_NAME} login to retry.`
249
258
  );
250
259
  }
251
260
  } catch (err) {
@@ -1,17 +1,18 @@
1
1
  import "../chunk-JQKKMUCT.js";
2
- import "../chunk-5OKB3TEB.js";
2
+ import "../chunk-5FLTDWWP.js";
3
3
  import {
4
4
  renderLogoutStatus
5
5
  } from "../chunk-RIRDBSBG.js";
6
6
  import {
7
7
  clearSssAllowanceCache
8
- } from "../chunk-UJJQME5K.js";
8
+ } from "../chunk-5V2RCZXO.js";
9
9
  import "../chunk-GRPLHUYC.js";
10
10
  import {
11
11
  getAuthClient
12
- } from "../chunk-SXWFDMFT.js";
13
- import "../chunk-4D6STP5G.js";
14
- import "../chunk-WM5R4O33.js";
12
+ } from "../chunk-3CUIQTSD.js";
13
+ import "../chunk-TSPERKUS.js";
14
+ import "../chunk-76CVW4DE.js";
15
+ import "../chunk-CCTQO2Q4.js";
15
16
  import "../chunk-QRKI6MMK.js";
16
17
  import "../chunk-ZOC4GITL.js";
17
18
 
@@ -1,11 +1,14 @@
1
+ import {
2
+ CLI_NAME
3
+ } from "../chunk-TSPERKUS.js";
1
4
  import {
2
5
  DEFAULT_MNEMONIC,
3
6
  DotNS
4
- } from "../chunk-I7UEBFP5.js";
7
+ } from "../chunk-GRWWVYSV.js";
5
8
  import "../chunk-SI2ZUOYD.js";
6
- import "../chunk-4PVJ2JBZ.js";
7
- import "../chunk-4D6STP5G.js";
8
- import "../chunk-WM5R4O33.js";
9
+ import "../chunk-4IUTMHVB.js";
10
+ import "../chunk-76CVW4DE.js";
11
+ import "../chunk-CCTQO2Q4.js";
9
12
  import {
10
13
  getPopSelfServeConfig,
11
14
  loadEnvironments,
@@ -23,7 +26,7 @@ async function resolveTransferRecipient(to, ctx) {
23
26
  async function runTransfer(envId, opts) {
24
27
  const label = (opts.label ?? "").replace(/\.dot$/, "");
25
28
  if (!label) {
26
- throw new Error("Usage: bulletin-deploy transfer <label> [--to <0xH160>] [--mnemonic <key>]");
29
+ throw new Error(`Usage: ${CLI_NAME} transfer <label> [--to <0xH160>] [--mnemonic <key>]`);
27
30
  }
28
31
  let sessionH160;
29
32
  if (!opts.to) {
@@ -2,16 +2,19 @@ import {
2
2
  STALE_SESSION_MESSAGE,
3
3
  getAuthClient,
4
4
  hasPersistedSession
5
- } from "../chunk-SXWFDMFT.js";
6
- import "../chunk-4D6STP5G.js";
7
- import "../chunk-WM5R4O33.js";
5
+ } from "../chunk-3CUIQTSD.js";
6
+ import {
7
+ CLI_NAME
8
+ } from "../chunk-TSPERKUS.js";
9
+ import "../chunk-76CVW4DE.js";
10
+ import "../chunk-CCTQO2Q4.js";
8
11
  import "../chunk-QRKI6MMK.js";
9
12
  import "../chunk-ZOC4GITL.js";
10
13
 
11
14
  // src/commands/whoami.ts
12
15
  function formatWhoami(addresses) {
13
16
  if (!addresses) {
14
- return "Not logged in. Run `bulletin-deploy login` to sign in.";
17
+ return `Not logged in. Run \`${CLI_NAME} login\` to sign in.`;
15
18
  }
16
19
  return [
17
20
  `Logged in:`,
@@ -1,15 +1,16 @@
1
1
  import "./chunk-JQKKMUCT.js";
2
2
  import {
3
3
  resolveSigner
4
- } from "./chunk-5OKB3TEB.js";
4
+ } from "./chunk-5FLTDWWP.js";
5
5
  import "./chunk-RIRDBSBG.js";
6
+ import "./chunk-TSPERKUS.js";
6
7
  import {
7
8
  DEFAULT_MNEMONIC
8
- } from "./chunk-I7UEBFP5.js";
9
+ } from "./chunk-GRWWVYSV.js";
9
10
  import "./chunk-SI2ZUOYD.js";
10
- import "./chunk-4PVJ2JBZ.js";
11
- import "./chunk-4D6STP5G.js";
12
- import "./chunk-WM5R4O33.js";
11
+ import "./chunk-4IUTMHVB.js";
12
+ import "./chunk-76CVW4DE.js";
13
+ import "./chunk-CCTQO2Q4.js";
13
14
  import "./chunk-QRKI6MMK.js";
14
15
  import "./chunk-ZOC4GITL.js";
15
16
 
package/dist/deploy.d.ts CHANGED
@@ -80,6 +80,8 @@ declare function isConnectionError(error: any): boolean;
80
80
  * even when its message differs.
81
81
  */
82
82
  declare function isBenignTeardownError(error: any): boolean;
83
+ declare const SHA256_MULTIHASH_CODE = 18;
84
+ declare const BLAKE2B_256_MULTIHASH_CODE = 45600;
83
85
  declare function deriveRootSigner(mnemonic: string, path?: string): {
84
86
  signer: PolkadotSigner;
85
87
  ss58: string;
@@ -118,13 +120,28 @@ declare function chooseSignerInput(opts: {
118
120
  hasSession?: boolean;
119
121
  }): "mnemonic" | "injected" | "resolve" | "pool";
120
122
  declare function isPhoneSignerActive(options: Pick<DeployOptions, "signer" | "signerAddress" | "transferTo">): boolean;
123
+ /**
124
+ * Decide whether to hand the name over to the signed-in user after a deploy.
125
+ * The handover only fires when the worker FRESHLY REGISTERED the name in this
126
+ * run (#928): updating the content of a name that already exists must never
127
+ * change its ownership. Without this, re-deploying any pre-existing name in
128
+ * transfer mode silently transferred it to whatever session was on disk —
129
+ * which captured shared E2E fixture labels for a local developer's account.
130
+ * Exported for unit testing.
131
+ */
132
+ declare function shouldHandoverName(opts: {
133
+ transferTo?: string;
134
+ registeredFresh: boolean;
135
+ }): boolean;
121
136
  /**
122
137
  * Produce the one-line storage-signer status printed at resolution time. Exported for unit testing.
123
138
  * Success: " Storage signer: allowance slot <ss58>"
124
139
  * Fallback: " Storage signer: pool fallback (<reason>)"
125
140
  */
126
141
  declare function formatStorageSignerLine(slotAddress: string | null, failReason?: string): string;
127
- declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner }?: ExistingProvider): Promise<string>;
142
+ declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, hashCode, }?: ExistingProvider & {
143
+ hashCode?: number;
144
+ }): Promise<string>;
128
145
  /**
129
146
  * Pre-compute dense nonces for chunks that need submission.
130
147
  * Chunks where stored[i] !== null are already on chain (skipped via skipCids or
@@ -413,4 +430,4 @@ declare function computePhoneSigningSteps(dotnsPreflight: {
413
430
  needsPopUpgrade: boolean;
414
431
  } | null, publishNeeded: boolean): string[];
415
432
 
416
- export { BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
433
+ export { BLAKE2B_256_MULTIHASH_CODE, BULLETIN_ENDPOINTS, type BitswapErrorVariant, type BitswapProbeResult, CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, SHA256_MULTIHASH_CODE, type SizeDecision, type StoreDirectoryOptions, WS_HEARTBEAT_TIMEOUT_MS, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, browserUrlFor, buildFilesMap, checkDeploySize, chooseSignerInput, chunk, computePhoneSigningSteps, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, formatStorageSignerLine, friendlyChainError, hasIPFS, interpretBitswapResult, isBenignTeardownError, isConnectionError, isPhoneSignerActive, makeBulletinStatusHandler, merkleize, probeP2pRetrieval, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, shouldHandoverName, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
package/dist/deploy.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ BLAKE2B_256_MULTIHASH_CODE,
2
3
  BULLETIN_ENDPOINTS,
3
4
  CHUNK_MORTALITY_PERIOD,
4
5
  DEFAULT_BULLETIN_RPC,
@@ -9,6 +10,7 @@ import {
9
10
  ENCRYPT_PBKDF2_ITERATIONS,
10
11
  ENCRYPT_SALT_LEN,
11
12
  ENCRYPT_TAG_LEN,
13
+ SHA256_MULTIHASH_CODE,
12
14
  WS_HEARTBEAT_TIMEOUT_MS,
13
15
  __assignDenseNoncesForTest,
14
16
  __selectStorageProviderModeForTest,
@@ -42,35 +44,38 @@ import {
42
44
  resolveReproducibleTimestamp,
43
45
  retryBudgetExhausted,
44
46
  setWsHaltCallback,
47
+ shouldHandoverName,
45
48
  storeChunkedContent,
46
49
  storeDirectory,
47
50
  storeDirectoryV2,
48
51
  storeFile,
49
52
  unpublish
50
- } from "./chunk-C74YSAWC.js";
51
- import "./chunk-UJJQME5K.js";
53
+ } from "./chunk-CJHVSSSR.js";
54
+ import "./chunk-5V2RCZXO.js";
52
55
  import "./chunk-GRPLHUYC.js";
53
56
  import "./chunk-HOTQDYHD.js";
54
57
  import "./chunk-IW3X2MJF.js";
55
58
  import "./chunk-KOSF5FDO.js";
56
59
  import "./chunk-J3NIXHZZ.js";
57
60
  import "./chunk-S7EM5VMW.js";
58
- import "./chunk-SXWFDMFT.js";
59
- import "./chunk-V5VD5CIC.js";
60
- import "./chunk-EHQPRWGC.js";
61
- import "./chunk-LYWIW6WU.js";
61
+ import "./chunk-3CUIQTSD.js";
62
+ import "./chunk-XOR2CEKA.js";
63
+ import "./chunk-ZHRQDZIK.js";
64
+ import "./chunk-W2VFJGBC.js";
62
65
  import "./chunk-C2TS5MER.js";
63
- import "./chunk-I7UEBFP5.js";
66
+ import "./chunk-TSPERKUS.js";
67
+ import "./chunk-GRWWVYSV.js";
64
68
  import "./chunk-SI2ZUOYD.js";
65
- import "./chunk-4PVJ2JBZ.js";
66
- import "./chunk-4D6STP5G.js";
67
- import "./chunk-WM5R4O33.js";
69
+ import "./chunk-4IUTMHVB.js";
70
+ import "./chunk-76CVW4DE.js";
71
+ import "./chunk-CCTQO2Q4.js";
68
72
  import "./chunk-QRKI6MMK.js";
69
73
  import {
70
74
  EXIT_CODE_NO_RETRY,
71
75
  NonRetryableError
72
76
  } from "./chunk-ZOC4GITL.js";
73
77
  export {
78
+ BLAKE2B_256_MULTIHASH_CODE,
74
79
  BULLETIN_ENDPOINTS,
75
80
  CHUNK_MORTALITY_PERIOD,
76
81
  DEFAULT_BULLETIN_RPC,
@@ -83,6 +88,7 @@ export {
83
88
  ENCRYPT_TAG_LEN,
84
89
  EXIT_CODE_NO_RETRY,
85
90
  NonRetryableError,
91
+ SHA256_MULTIHASH_CODE,
86
92
  WS_HEARTBEAT_TIMEOUT_MS,
87
93
  __assignDenseNoncesForTest,
88
94
  __selectStorageProviderModeForTest,
@@ -116,6 +122,7 @@ export {
116
122
  resolveReproducibleTimestamp,
117
123
  retryBudgetExhausted,
118
124
  setWsHaltCallback,
125
+ shouldHandoverName,
119
126
  storeChunkedContent,
120
127
  storeDirectory,
121
128
  storeDirectoryV2,
package/dist/dotns.js CHANGED
@@ -54,11 +54,11 @@ import {
54
54
  validateDomainLabel,
55
55
  verifyNonceAdvanced,
56
56
  weiToNative
57
- } from "./chunk-I7UEBFP5.js";
57
+ } from "./chunk-GRWWVYSV.js";
58
58
  import "./chunk-SI2ZUOYD.js";
59
- import "./chunk-4PVJ2JBZ.js";
60
- import "./chunk-4D6STP5G.js";
61
- import "./chunk-WM5R4O33.js";
59
+ import "./chunk-4IUTMHVB.js";
60
+ import "./chunk-76CVW4DE.js";
61
+ import "./chunk-CCTQO2Q4.js";
62
62
  import "./chunk-QRKI6MMK.js";
63
63
  import "./chunk-ZOC4GITL.js";
64
64
  export {