bulletin-deploy 0.7.5 → 0.7.6
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.
- package/README.md +88 -342
- package/bin/bulletin-bootstrap +48 -0
- package/bin/bulletin-deploy +55 -59
- package/dist/bug-report.js +4 -4
- package/dist/{chunk-KQ75CSJJ.js → chunk-A2J6R5PD.js} +8 -8
- package/dist/{chunk-XOKNNK6E.js → chunk-EECNTEAE.js} +1 -1
- package/dist/{chunk-SAMH7JFG.js → chunk-G6CVI6U2.js} +2 -2
- package/dist/{chunk-GQFH2NRB.js → chunk-HHY32NGJ.js} +6 -4
- package/dist/{chunk-JHNW2EKY.js → chunk-WIBZPZSY.js} +44 -52
- package/dist/{chunk-WOJRQCQV.js → chunk-Y6CTPQS2.js} +1 -1
- package/dist/{chunk-UXKC7JAM.js → chunk-YX62STIA.js} +2 -3
- package/dist/deploy.js +7 -7
- package/dist/dotns.js +4 -4
- package/dist/index.js +7 -7
- package/dist/memory-report.js +2 -2
- package/dist/pool.d.ts +2 -2
- package/dist/pool.js +1 -1
- package/dist/run-state.js +1 -1
- package/dist/telemetry.js +2 -2
- package/dist/version-check.js +3 -3
- package/docs/bootstrap.md +49 -0
- package/docs/e2e-bootstrap.md +64 -0
- package/docs/telemetry.md +59 -0
- package/docs/testing.md +44 -0
- package/package.json +6 -4
package/bin/bulletin-deploy
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY } from "../dist/deploy.js";
|
|
4
|
-
import { bootstrapPool } from "../dist/pool.js";
|
|
5
4
|
import { VERSION, setDeployAttribute, captureWarning, closeTelemetry, setRunStateActive, markRelaunchOomHintShown } from "../dist/telemetry.js";
|
|
6
5
|
import { handleFailedDeploy, preReleaseWarning } from "../dist/version-check.js";
|
|
7
6
|
import { setDeployContext, installLogCapture, buildCliFlagsSummary } from "../dist/bug-report.js";
|
|
@@ -17,7 +16,7 @@ const args = process.argv.slice(2);
|
|
|
17
16
|
const flags = {};
|
|
18
17
|
const positional = [];
|
|
19
18
|
for (let i = 0; i < args.length; i++) {
|
|
20
|
-
if (args[i] === "--bootstrap") { flags.
|
|
19
|
+
if (args[i] === "--bootstrap") { flags.removedBootstrap = true; }
|
|
21
20
|
else if (args[i] === "--pool-size") { flags.poolSize = parseInt(args[++i], 10); }
|
|
22
21
|
else if (args[i] === "--mnemonic") { flags.mnemonic = args[++i]; }
|
|
23
22
|
else if (args[i] === "--derivation-path") { flags.derivationPath = args[++i]; }
|
|
@@ -36,12 +35,16 @@ if (flags.version) {
|
|
|
36
35
|
process.exit(0);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
if (flags.
|
|
38
|
+
if (flags.removedBootstrap) {
|
|
39
|
+
console.error("Error: --bootstrap was removed from bulletin-deploy. Use bulletin-bootstrap instead.");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (flags.help || positional.length === 0) {
|
|
40
44
|
console.log(`bulletin-deploy v${VERSION}
|
|
41
45
|
|
|
42
46
|
Usage:
|
|
43
47
|
bulletin-deploy <build-dir> <domain.dot> Deploy an app
|
|
44
|
-
bulletin-deploy --bootstrap Initialize pool accounts
|
|
45
48
|
|
|
46
49
|
Options:
|
|
47
50
|
--mnemonic "..." DotNS owner mnemonic (or set MNEMONIC env var)
|
|
@@ -62,10 +65,9 @@ const rcWarning = preReleaseWarning(VERSION);
|
|
|
62
65
|
if (rcWarning) console.error(rcWarning);
|
|
63
66
|
|
|
64
67
|
// ── Crash capture (issue #154) ───────────────────────────────────
|
|
65
|
-
// Only wire crash capture for actual deploy
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
if (!flags.help && !flags.version && !flags.bootstrap) {
|
|
68
|
+
// Only wire crash capture for actual deploy runs — skip for --help / --version
|
|
69
|
+
// (which exit above).
|
|
70
|
+
if (!flags.help && !flags.version) {
|
|
69
71
|
// Sanitised argv — positional args + presence-only flag summary. Never
|
|
70
72
|
// puts a mnemonic/password/RPC/derivation-path on disk, even if the user
|
|
71
73
|
// passes one on the command line.
|
|
@@ -148,58 +150,52 @@ if (!flags.help && !flags.version && !flags.bootstrap) {
|
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
try {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
signerMode: flags.mnemonic ? "direct" : "pool",
|
|
177
|
-
deployTag,
|
|
178
|
-
cliFlags: buildCliFlagsSummary(flags),
|
|
179
|
-
ci,
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
const result = await deploy(buildDir, domain, {
|
|
183
|
-
mnemonic: flags.mnemonic,
|
|
184
|
-
derivationPath: flags.derivationPath,
|
|
185
|
-
rpc: flags.rpc,
|
|
186
|
-
poolSize: flags.poolSize,
|
|
187
|
-
password: flags.password,
|
|
188
|
-
jsMerkle: flags.jsMerkle,
|
|
189
|
-
tag: flags.tag,
|
|
190
|
-
ghPagesMirror: flags.ghPagesMirror,
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
const output = process.env.GITHUB_OUTPUT;
|
|
194
|
-
if (output) {
|
|
195
|
-
fs.appendFileSync(output, `cid=${result.cid}\n`);
|
|
196
|
-
fs.appendFileSync(output, `domain=${result.domainName}\n`);
|
|
197
|
-
}
|
|
153
|
+
const [buildDir, domain] = positional;
|
|
154
|
+
if (!buildDir) { console.error("Error: build directory required"); process.exit(1); }
|
|
155
|
+
if (!domain) { console.error("Error: domain required (e.g. my-app.dot)"); process.exit(1); }
|
|
156
|
+
if (!fs.existsSync(buildDir)) { console.error(`Error: ${buildDir} does not exist`); process.exit(1); }
|
|
157
|
+
|
|
158
|
+
const effectiveRpc = flags.rpc ?? process.env.BULLETIN_RPC ?? DEFAULT_BULLETIN_RPC;
|
|
159
|
+
const deployTag = flags.tag ?? process.env.DEPLOY_TAG;
|
|
160
|
+
const ci = process.env.GITHUB_ACTIONS === "true" ? {
|
|
161
|
+
runUrl: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY && process.env.GITHUB_RUN_ID
|
|
162
|
+
? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}${process.env.GITHUB_RUN_ATTEMPT ? `/attempts/${process.env.GITHUB_RUN_ATTEMPT}` : ""}`
|
|
163
|
+
: undefined,
|
|
164
|
+
workflow: process.env.GITHUB_WORKFLOW,
|
|
165
|
+
job: process.env.GITHUB_JOB,
|
|
166
|
+
sha: process.env.GITHUB_SHA,
|
|
167
|
+
} : undefined;
|
|
168
|
+
setDeployContext({
|
|
169
|
+
domain,
|
|
170
|
+
rpc: effectiveRpc,
|
|
171
|
+
repo: process.env.GITHUB_REPOSITORY,
|
|
172
|
+
branch: process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME,
|
|
173
|
+
signerMode: flags.mnemonic ? "direct" : "pool",
|
|
174
|
+
deployTag,
|
|
175
|
+
cliFlags: buildCliFlagsSummary(flags),
|
|
176
|
+
ci,
|
|
177
|
+
});
|
|
198
178
|
|
|
199
|
-
|
|
200
|
-
|
|
179
|
+
const result = await deploy(buildDir, domain, {
|
|
180
|
+
mnemonic: flags.mnemonic,
|
|
181
|
+
derivationPath: flags.derivationPath,
|
|
182
|
+
rpc: flags.rpc,
|
|
183
|
+
poolSize: flags.poolSize,
|
|
184
|
+
password: flags.password,
|
|
185
|
+
jsMerkle: flags.jsMerkle,
|
|
186
|
+
tag: flags.tag,
|
|
187
|
+
ghPagesMirror: flags.ghPagesMirror,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const output = process.env.GITHUB_OUTPUT;
|
|
191
|
+
if (output) {
|
|
192
|
+
fs.appendFileSync(output, `cid=${result.cid}\n`);
|
|
193
|
+
fs.appendFileSync(output, `domain=${result.domainName}\n`);
|
|
201
194
|
}
|
|
202
|
-
|
|
195
|
+
|
|
196
|
+
console.log(`CID: ${result.cid}`);
|
|
197
|
+
console.log(`Domain: ${result.domainName}`);
|
|
198
|
+
if (!flags.help && !flags.version) {
|
|
203
199
|
try { writeRunState({ status: "succeeded", endedAt: Date.now() }); } catch {}
|
|
204
200
|
}
|
|
205
201
|
process.exit(0);
|
|
@@ -207,7 +203,7 @@ try {
|
|
|
207
203
|
const noRetry = error instanceof NonRetryableError;
|
|
208
204
|
console.error(`Deployment failed${noRetry ? " (not retryable)" : ""}:`, error.message);
|
|
209
205
|
await handleFailedDeploy(error);
|
|
210
|
-
if (!flags.help && !flags.version
|
|
206
|
+
if (!flags.help && !flags.version) {
|
|
211
207
|
try { writeRunState({ status: "failed", endedAt: Date.now(), reason: (error?.message ?? String(error)).slice(0, 200) }); } catch {}
|
|
212
208
|
}
|
|
213
209
|
process.exit(noRetry ? EXIT_CODE_NO_RETRY : 1);
|
package/dist/bug-report.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
offerBugReport,
|
|
10
10
|
scrubSecrets,
|
|
11
11
|
setDeployContext
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-YX62STIA.js";
|
|
13
|
+
import "./chunk-EECNTEAE.js";
|
|
14
|
+
import "./chunk-Y6CTPQS2.js";
|
|
15
|
+
import "./chunk-HHY32NGJ.js";
|
|
16
16
|
import "./chunk-QGM4M3NI.js";
|
|
17
17
|
export {
|
|
18
18
|
buildCliFlagsSummary,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setDeployContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YX62STIA.js";
|
|
4
4
|
import {
|
|
5
5
|
DotNS,
|
|
6
6
|
TX_TIMEOUT_MS,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
parseDomainName,
|
|
9
9
|
popStatusName,
|
|
10
10
|
verifyNonceAdvanced
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-G6CVI6U2.js";
|
|
12
12
|
import {
|
|
13
13
|
MirrorSkipped,
|
|
14
14
|
mirrorToGitHubPages,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
truncateAddress,
|
|
28
28
|
withDeploySpan,
|
|
29
29
|
withSpan
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-Y6CTPQS2.js";
|
|
31
31
|
import {
|
|
32
32
|
merkleizeJS
|
|
33
33
|
} from "./chunk-B7GUYYAN.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
fetchPoolAuthorizations,
|
|
39
39
|
selectAccount,
|
|
40
40
|
topUpBy
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WIBZPZSY.js";
|
|
42
42
|
|
|
43
43
|
// src/deploy.ts
|
|
44
44
|
import { Buffer } from "buffer";
|
|
@@ -175,10 +175,10 @@ async function getProvider() {
|
|
|
175
175
|
if (!selected) {
|
|
176
176
|
const best = authorizations.reduce((a, b) => a.transactions > b.transactions ? a : b);
|
|
177
177
|
console.log(` All pool accounts low on capacity, auto-authorizing account ${best.index}...`);
|
|
178
|
-
await ensureAuthorized(unsafeApi, best.address,
|
|
178
|
+
await ensureAuthorized(unsafeApi, best.address, `pool account ${best.index}`);
|
|
179
179
|
selected = best;
|
|
180
180
|
} else {
|
|
181
|
-
await ensureAuthorized(unsafeApi, selected.address,
|
|
181
|
+
await ensureAuthorized(unsafeApi, selected.address, `pool account ${selected.index}`);
|
|
182
182
|
}
|
|
183
183
|
console.log(` Using pool account ${selected.index}: ${selected.address}`);
|
|
184
184
|
setDeployAttribute("deploy.signer.mode", "pool");
|
|
@@ -351,7 +351,7 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
351
351
|
Account has insufficient authorization for this upload (need ${requiredTxs} txs / ${(totalBytes / 1e6).toFixed(1)}MB, have ${txsRemaining} txs / ${Number(bytesRemaining) / 1e6}MB)`);
|
|
352
352
|
console.log(` Attempting to re-authorize with Alice...`);
|
|
353
353
|
try {
|
|
354
|
-
await ensureAuthorized(unsafeApi, ss58,
|
|
354
|
+
await ensureAuthorized(unsafeApi, ss58, void 0, { txs: requiredTxs, bytes: requiredBytes });
|
|
355
355
|
console.log(` Re-authorization successful`);
|
|
356
356
|
} catch (e) {
|
|
357
357
|
throw new NonRetryableError(`Account ${ss58} has insufficient Bulletin authorization quota and auto-authorization via Alice failed (${e.message}). Authorize the account on-chain.`);
|
|
@@ -758,7 +758,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
758
758
|
const uploadBytes = Math.ceil(estimated * 1.2);
|
|
759
759
|
const chunksNeeded = Math.max(1, Math.ceil(uploadBytes / CHUNK_SIZE));
|
|
760
760
|
const needs = { txs: BigInt(chunksNeeded + 2), bytes: BigInt(uploadBytes) };
|
|
761
|
-
await topUpBy(provider.
|
|
761
|
+
await topUpBy(provider.unsafeApi, provider.ss58, needs, "uploader");
|
|
762
762
|
}
|
|
763
763
|
console.log("\n" + "=".repeat(60));
|
|
764
764
|
console.log("Storage");
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
captureWarning,
|
|
3
3
|
setDeployAttribute,
|
|
4
4
|
withSpan
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y6CTPQS2.js";
|
|
6
6
|
import {
|
|
7
7
|
isTestnetSpecName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WIBZPZSY.js";
|
|
9
9
|
|
|
10
10
|
// src/dotns.ts
|
|
11
11
|
import { spawn } from "child_process";
|
|
@@ -6,7 +6,7 @@ import * as path from "path";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "bulletin-deploy",
|
|
9
|
-
version: "0.7.
|
|
9
|
+
version: "0.7.6",
|
|
10
10
|
private: false,
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
@@ -20,7 +20,8 @@ var package_default = {
|
|
|
20
20
|
main: "./dist/index.js",
|
|
21
21
|
types: "./dist/index.d.ts",
|
|
22
22
|
bin: {
|
|
23
|
-
"bulletin-deploy": "./bin/bulletin-deploy"
|
|
23
|
+
"bulletin-deploy": "./bin/bulletin-deploy",
|
|
24
|
+
"bulletin-bootstrap": "./bin/bulletin-bootstrap"
|
|
24
25
|
},
|
|
25
26
|
exports: {
|
|
26
27
|
".": {
|
|
@@ -30,12 +31,13 @@ var package_default = {
|
|
|
30
31
|
},
|
|
31
32
|
files: [
|
|
32
33
|
"dist",
|
|
33
|
-
"bin"
|
|
34
|
+
"bin",
|
|
35
|
+
"docs"
|
|
34
36
|
],
|
|
35
37
|
scripts: {
|
|
36
38
|
build: "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts --format esm --dts --clean --target node22",
|
|
37
39
|
prepare: "npm run build",
|
|
38
|
-
test: "npm run build && node --test test/test.js test/
|
|
40
|
+
test: "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js",
|
|
39
41
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
40
42
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
41
43
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
@@ -12,6 +12,7 @@ var TOPUP_TRANSACTIONS = 1e3;
|
|
|
12
12
|
var TOPUP_BYTES = 100000000n;
|
|
13
13
|
var TOPUP_THRESHOLD_TXS = 50n;
|
|
14
14
|
var TOPUP_THRESHOLD_BYTES = 50000000n;
|
|
15
|
+
var WS_HEARTBEAT_TIMEOUT_MS = 3e5;
|
|
15
16
|
function derivePoolAccounts(poolSize = 10, mnemonic = DEV_PHRASE) {
|
|
16
17
|
const entropy = mnemonicToEntropy(mnemonic);
|
|
17
18
|
const miniSecret = entropyToMiniSecret(entropy);
|
|
@@ -126,23 +127,13 @@ function aliceKeyring() {
|
|
|
126
127
|
const signer = getPolkadotSigner(alice.publicKey, "Sr25519", (data) => alice.sign(data));
|
|
127
128
|
return { alice, signer };
|
|
128
129
|
}
|
|
129
|
-
async function withAliceApi(bulletinRpc, fn) {
|
|
130
|
-
const aliceClient = createClient(withPolkadotSdkCompat(getWsProvider(bulletinRpc)));
|
|
131
|
-
const aliceApi = aliceClient.getUnsafeApi();
|
|
132
|
-
try {
|
|
133
|
-
const { signer } = aliceKeyring();
|
|
134
|
-
return await fn(aliceApi, signer);
|
|
135
|
-
} finally {
|
|
136
|
-
aliceClient.destroy();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
130
|
var U32_MAX = 0xFFFFFFFFn;
|
|
140
131
|
function clampU32(n, name) {
|
|
141
132
|
if (n < 0n) throw new Error(`${name} must be non-negative`);
|
|
142
133
|
if (n > U32_MAX) throw new Error(`${name} (${n}) exceeds u32 max \u2014 split the deploy into smaller batches`);
|
|
143
134
|
return Number(n);
|
|
144
135
|
}
|
|
145
|
-
async function ensureAuthorized(api, address,
|
|
136
|
+
async function ensureAuthorized(api, address, label, minimum = { txs: TOPUP_THRESHOLD_TXS, bytes: TOPUP_THRESHOLD_BYTES }) {
|
|
146
137
|
const auth = await api.query.TransactionStorage.Authorizations.getValue(
|
|
147
138
|
Enum("Account", address)
|
|
148
139
|
);
|
|
@@ -152,54 +143,55 @@ async function ensureAuthorized(api, address, bulletinRpc, label, minimum = { tx
|
|
|
152
143
|
return;
|
|
153
144
|
}
|
|
154
145
|
console.log(` Auto-authorizing ${label ?? "account"} (${address.slice(0, 8)}...)...`);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
146
|
+
const { signer } = aliceKeyring();
|
|
147
|
+
await submitAliceTxWithRetry(
|
|
148
|
+
() => api.tx.TransactionStorage.authorize_account({
|
|
149
|
+
who: address,
|
|
150
|
+
transactions: TOPUP_TRANSACTIONS,
|
|
151
|
+
bytes: TOPUP_BYTES
|
|
152
|
+
}),
|
|
153
|
+
signer,
|
|
154
|
+
`authorize_account(${label ?? "account"})`
|
|
155
|
+
);
|
|
156
|
+
console.log(` Authorized: ${TOPUP_TRANSACTIONS} txs, ${TOPUP_BYTES / 1000000n}MB`);
|
|
167
157
|
}
|
|
168
|
-
async function topUpBy(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
158
|
+
async function topUpBy(api, address, needs, label) {
|
|
159
|
+
const currentAuth = await api.query.TransactionStorage.Authorizations.getValue(
|
|
160
|
+
Enum("Account", address)
|
|
161
|
+
);
|
|
162
|
+
const current = {
|
|
163
|
+
transactions: currentAuth ? BigInt(currentAuth.extent.transactions) : 0n,
|
|
164
|
+
bytes: currentAuth ? currentAuth.extent.bytes : 0n
|
|
165
|
+
};
|
|
166
|
+
const fmtMB = (b) => (Number(b) / 1e6).toFixed(1);
|
|
167
|
+
const target = computeTopUpTarget(current, needs);
|
|
168
|
+
if (!target) {
|
|
169
|
+
console.log(` Pre-auth skipped for ${label ?? "account"} (${address.slice(0, 8)}...): current ${current.transactions} txs / ${fmtMB(current.bytes)}MB covers needs + floor.`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const transactions = clampU32(target.transactions, "topUpBy.txs");
|
|
173
|
+
const { signer } = aliceKeyring();
|
|
174
|
+
console.log(` Pre-authorizing ${label ?? "account"} (${address.slice(0, 8)}...): current ${current.transactions} txs / ${fmtMB(current.bytes)}MB \u2192 target ${target.transactions} txs / ${fmtMB(target.bytes)}MB...`);
|
|
175
|
+
await submitAliceTxWithRetry(
|
|
176
|
+
() => api.tx.TransactionStorage.authorize_account({
|
|
177
|
+
who: address,
|
|
178
|
+
transactions,
|
|
179
|
+
bytes: target.bytes
|
|
180
|
+
}),
|
|
181
|
+
signer,
|
|
182
|
+
`topUpBy(${label ?? "account"})`
|
|
183
|
+
);
|
|
184
|
+
console.log(` Pre-authorized: target ${transactions} txs / ${fmtMB(target.bytes)}MB`);
|
|
196
185
|
}
|
|
197
186
|
async function bootstrapPool(bulletinRpc, poolSize = 10, mnemonic) {
|
|
198
187
|
console.log(`Bootstrapping ${poolSize} pool accounts on ${bulletinRpc}...
|
|
199
188
|
`);
|
|
200
189
|
await cryptoWaitReady();
|
|
201
190
|
const accounts = derivePoolAccounts(poolSize, mnemonic);
|
|
202
|
-
const client = createClient(withPolkadotSdkCompat(getWsProvider(
|
|
191
|
+
const client = createClient(withPolkadotSdkCompat(getWsProvider(
|
|
192
|
+
bulletinRpc,
|
|
193
|
+
{ heartbeatTimeout: WS_HEARTBEAT_TIMEOUT_MS }
|
|
194
|
+
)));
|
|
203
195
|
const api = client.getUnsafeApi();
|
|
204
196
|
const keyring = new Keyring({ type: "sr25519" });
|
|
205
197
|
const alice = keyring.addFromUri("//Alice");
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
classifyErrorArea,
|
|
3
3
|
isInteractive,
|
|
4
4
|
promptYesNo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EECNTEAE.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
getCurrentSentryTraceId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Y6CTPQS2.js";
|
|
10
10
|
|
|
11
11
|
// src/bug-report.ts
|
|
12
12
|
import { execSync, execFileSync } from "child_process";
|
|
@@ -74,7 +74,6 @@ function scrubSecrets(text) {
|
|
|
74
74
|
}
|
|
75
75
|
function buildCliFlagsSummary(flags) {
|
|
76
76
|
const parts = [];
|
|
77
|
-
if (flags.bootstrap) parts.push("--bootstrap");
|
|
78
77
|
if (flags.jsMerkle) parts.push("--js-merkle");
|
|
79
78
|
if (flags.ghPagesMirror) parts.push("--gh-pages-mirror");
|
|
80
79
|
if (flags.poolSize != null) parts.push(`--pool-size ${String(flags.poolSize)}`);
|
package/dist/deploy.js
CHANGED
|
@@ -25,15 +25,15 @@ import {
|
|
|
25
25
|
storeChunkedContent,
|
|
26
26
|
storeDirectory,
|
|
27
27
|
storeFile
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-A2J6R5PD.js";
|
|
29
|
+
import "./chunk-YX62STIA.js";
|
|
30
|
+
import "./chunk-EECNTEAE.js";
|
|
31
|
+
import "./chunk-G6CVI6U2.js";
|
|
32
32
|
import "./chunk-2Q2WSKFD.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-Y6CTPQS2.js";
|
|
34
|
+
import "./chunk-HHY32NGJ.js";
|
|
35
35
|
import "./chunk-B7GUYYAN.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-WIBZPZSY.js";
|
|
37
37
|
import "./chunk-QGM4M3NI.js";
|
|
38
38
|
export {
|
|
39
39
|
CHUNK_MORTALITY_PERIOD,
|
package/dist/dotns.js
CHANGED
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
stripTrailingDigits,
|
|
34
34
|
validateDomainLabel,
|
|
35
35
|
verifyNonceAdvanced
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-G6CVI6U2.js";
|
|
37
|
+
import "./chunk-Y6CTPQS2.js";
|
|
38
|
+
import "./chunk-HHY32NGJ.js";
|
|
39
|
+
import "./chunk-WIBZPZSY.js";
|
|
40
40
|
import "./chunk-QGM4M3NI.js";
|
|
41
41
|
export {
|
|
42
42
|
CONNECTION_TIMEOUT_MS,
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deploy
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-A2J6R5PD.js";
|
|
4
|
+
import "./chunk-YX62STIA.js";
|
|
5
|
+
import "./chunk-EECNTEAE.js";
|
|
6
6
|
import {
|
|
7
7
|
DotNS,
|
|
8
8
|
parseDomainName
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-G6CVI6U2.js";
|
|
10
10
|
import "./chunk-2Q2WSKFD.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-Y6CTPQS2.js";
|
|
12
12
|
import {
|
|
13
13
|
VERSION,
|
|
14
14
|
loadRunState,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
shouldSkipStaleWarning,
|
|
19
19
|
stateFilePath,
|
|
20
20
|
writeRunState
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HHY32NGJ.js";
|
|
22
22
|
import {
|
|
23
23
|
merkleizeJS
|
|
24
24
|
} from "./chunk-B7GUYYAN.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
ensureAuthorized,
|
|
29
29
|
fetchPoolAuthorizations,
|
|
30
30
|
selectAccount
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WIBZPZSY.js";
|
|
32
32
|
import "./chunk-QGM4M3NI.js";
|
|
33
33
|
export {
|
|
34
34
|
DotNS,
|
package/dist/memory-report.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
maybeWriteMemoryReport,
|
|
6
6
|
safeHeap,
|
|
7
7
|
sampleFromBytes
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-Y6CTPQS2.js";
|
|
9
|
+
import "./chunk-HHY32NGJ.js";
|
|
10
10
|
import "./chunk-QGM4M3NI.js";
|
|
11
11
|
export {
|
|
12
12
|
DEFAULT_THRESHOLD_MB,
|
package/dist/pool.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ declare function classifyAliceTxError(err: unknown): TxRetryDecision;
|
|
|
30
30
|
declare function isTestnetSpecName(specName: string | undefined | null): boolean;
|
|
31
31
|
declare function detectTestnet(api: any): Promise<boolean>;
|
|
32
32
|
declare function _resetTestnetCacheForTests(): void;
|
|
33
|
-
declare function ensureAuthorized(api: any, address: string,
|
|
34
|
-
declare function topUpBy(
|
|
33
|
+
declare function ensureAuthorized(api: any, address: string, label?: string, minimum?: AuthorizationNeeds): Promise<void>;
|
|
34
|
+
declare function topUpBy(api: any, address: string, needs: AuthorizationNeeds, label?: string): Promise<void>;
|
|
35
35
|
declare function bootstrapPool(bulletinRpc: string, poolSize?: number, mnemonic?: string): Promise<void>;
|
|
36
36
|
|
|
37
37
|
export { type AuthorizationNeeds, type PoolAccount, type PoolAuthorization, type TxRetryDecision, _resetTestnetCacheForTests, bootstrapPool, classifyAliceTxError, computeTopUpTarget, derivePoolAccounts, detectTestnet, ensureAuthorized, fetchPoolAuthorizations, isTestnetSpecName, selectAccount, topUpBy };
|
package/dist/pool.js
CHANGED
package/dist/run-state.js
CHANGED
package/dist/telemetry.js
CHANGED
package/dist/version-check.js
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
isPreReleaseVersion,
|
|
9
9
|
preReleaseWarning,
|
|
10
10
|
promptYesNo
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-EECNTEAE.js";
|
|
12
|
+
import "./chunk-Y6CTPQS2.js";
|
|
13
|
+
import "./chunk-HHY32NGJ.js";
|
|
14
14
|
import "./chunk-QGM4M3NI.js";
|
|
15
15
|
export {
|
|
16
16
|
assessVersion,
|