@secondlayer/cli 19.1.3 → 19.2.1
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 +1 -0
- package/dist/cli.js +219 -22
- package/dist/cli.js.map +5 -4
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ No account. Writes `.env.local`, restores history, prints the Stacks observer st
|
|
|
99
99
|
| `secondlayer bootstrap --against <manifest> [--from-block <n>] [--to-block <n>] [--verify all\|blocks] [--public-key <pem>] [-y] [--json]` | Restore chain history from a verified archive into an empty database. A run that died mid-way resumes per dataset on re-run. After the load, digests for blocks, transactions, and events are checked over the restored range (`--verify blocks` skips the child datasets and the minutes they cost). Partition fetches retry three times with backoff on resets, timeouts, 429 (honoring `Retry-After`) and 5xx; a link that stays down exits `1` with a re-run hint, and the re-run resumes. Exit `0` restored, `1` diverged or interrupted, `2` refused |
|
|
100
100
|
| `secondlayer observer [--mode indexer\|signer-shared] [--endpoint host:port] [--network …]` | Print the `[[events_observer]]` stanza. Signer-shared skips retries; a missed block stays a gap until `repair` |
|
|
101
101
|
| `secondlayer verify [all\|raw\|decode:<name>\|subgraph:<name>] --against <manifest> [--quick\|--deep\|--anchor]` | Compare local data to a signed archive. Default target `raw`. Exit `0` clean, `1` diverged, `2` unanchored |
|
|
102
|
+
| `secondlayer verify block <height\|index_block_hash> [--node <url>] [--checkpoint <file>] [--rows] [--json]` | Prove one Stacks block from the checkpoint built into this release: Bitcoin headers, burn block, signer set, signatures, state root, state diff, and with `--rows` the indexed rows. Nothing else is trusted; proofs come from the API, or a node with `--node`. Exit `0` proven, `1` a link is broken, `2` could not check |
|
|
102
103
|
| `secondlayer repair --against <archive> [--apply] [-y]` | Plan (default) or apply an archive repair. A fixed block is rewritten with its transactions and events from the archive; when the reference has no child partition for a height, the block is rewritten alone, the height is named with a `bootstrap --from-block H --to-block H` remedy, and the exit is `1`. Partition fetches retry like `bootstrap`; a link that stays down exits `1` with a re-run hint, and heights already repaired are kept |
|
|
103
104
|
|
|
104
105
|
Bootstrap and repair against the official hosted archive (`archive.secondlayer.tools`)
|
package/dist/cli.js
CHANGED
|
@@ -16630,7 +16630,7 @@ var init_dist3 = __esm(() => {
|
|
|
16630
16630
|
// ../../node_modules/tinyexec/dist/main.js
|
|
16631
16631
|
import { createRequire as e } from "module";
|
|
16632
16632
|
import { spawn as t } from "node:child_process";
|
|
16633
|
-
import { delimiter as
|
|
16633
|
+
import { delimiter as n2, dirname as r, normalize as i, resolve as a2 } from "node:path";
|
|
16634
16634
|
import { cwd as o } from "node:process";
|
|
16635
16635
|
import { PassThrough as s } from "node:stream";
|
|
16636
16636
|
import c from "node:readline";
|
|
@@ -16649,7 +16649,7 @@ function x(e) {
|
|
|
16649
16649
|
return b;
|
|
16650
16650
|
}
|
|
16651
16651
|
function S(e, t) {
|
|
16652
|
-
const i = t.value.split(
|
|
16652
|
+
const i = t.value.split(n2);
|
|
16653
16653
|
let o = e;
|
|
16654
16654
|
let s;
|
|
16655
16655
|
do {
|
|
@@ -16659,7 +16659,7 @@ function S(e, t) {
|
|
|
16659
16659
|
} while (o !== s);
|
|
16660
16660
|
return {
|
|
16661
16661
|
key: t.key,
|
|
16662
|
-
value: i.join(
|
|
16662
|
+
value: i.join(n2)
|
|
16663
16663
|
};
|
|
16664
16664
|
}
|
|
16665
16665
|
function C(e, t) {
|
|
@@ -23945,19 +23945,19 @@ class c2 {
|
|
|
23945
23945
|
}
|
|
23946
23946
|
}
|
|
23947
23947
|
function i2() {
|
|
23948
|
-
return this[
|
|
23948
|
+
return this[n3].next();
|
|
23949
23949
|
}
|
|
23950
23950
|
function o2(r) {
|
|
23951
|
-
return this[
|
|
23951
|
+
return this[n3].return(r);
|
|
23952
23952
|
}
|
|
23953
23953
|
function h2({ preventCancel: r = false } = {}) {
|
|
23954
23954
|
const e = this.getReader(), t = new c2(e, r), s = Object.create(u2);
|
|
23955
|
-
return s[
|
|
23955
|
+
return s[n3] = t, s;
|
|
23956
23956
|
}
|
|
23957
|
-
var a3,
|
|
23957
|
+
var a3, n3, u2;
|
|
23958
23958
|
var init_asyncIterator = __esm(() => {
|
|
23959
23959
|
a3 = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype);
|
|
23960
|
-
|
|
23960
|
+
n3 = Symbol();
|
|
23961
23961
|
Object.defineProperty(i2, "name", { value: "next" });
|
|
23962
23962
|
Object.defineProperty(o2, "name", { value: "return" });
|
|
23963
23963
|
u2 = Object.create(a3, {
|
|
@@ -29053,13 +29053,13 @@ import { createHash as createHash3 } from "node:crypto";
|
|
|
29053
29053
|
import {
|
|
29054
29054
|
mkdir as mkdir2,
|
|
29055
29055
|
open,
|
|
29056
|
-
readFile as
|
|
29056
|
+
readFile as readFile4,
|
|
29057
29057
|
stat,
|
|
29058
29058
|
unlink as unlink3,
|
|
29059
29059
|
writeFile as writeFile4
|
|
29060
29060
|
} from "node:fs/promises";
|
|
29061
29061
|
async function readJsonFile(path) {
|
|
29062
|
-
const text = await
|
|
29062
|
+
const text = await readFile4(path, "utf-8");
|
|
29063
29063
|
return JSON.parse(text);
|
|
29064
29064
|
}
|
|
29065
29065
|
async function writeTextFile(path, content) {
|
|
@@ -29440,7 +29440,7 @@ var init_git_status = () => {};
|
|
|
29440
29440
|
|
|
29441
29441
|
// ../../node_modules/typescript/lib/typescript.js
|
|
29442
29442
|
var require_typescript = __commonJS(function(exports, module) {
|
|
29443
|
-
var __dirname = "/Users/ryan/projects/secondlayer/node_modules/typescript/lib", __filename = "/Users/ryan/projects/secondlayer/node_modules/typescript/lib/typescript.js";
|
|
29443
|
+
var __dirname = "/Users/ryan/projects/secondlayer/.claude/worktrees/agent-adcb760acc54b4c28/node_modules/typescript/lib", __filename = "/Users/ryan/projects/secondlayer/.claude/worktrees/agent-adcb760acc54b4c28/node_modules/typescript/lib/typescript.js";
|
|
29444
29444
|
/*! *****************************************************************************
|
|
29445
29445
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
29446
29446
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -202526,7 +202526,7 @@ var {
|
|
|
202526
202526
|
// package.json
|
|
202527
202527
|
var package_default = {
|
|
202528
202528
|
name: "@secondlayer/cli",
|
|
202529
|
-
version: "19.1
|
|
202529
|
+
version: "19.2.1",
|
|
202530
202530
|
description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
|
|
202531
202531
|
repository: {
|
|
202532
202532
|
type: "git",
|
|
@@ -202565,10 +202565,11 @@ var package_default = {
|
|
|
202565
202565
|
"@inquirer/prompts": "^8.2.0",
|
|
202566
202566
|
"@secondlayer/bundler": "^0.6.1",
|
|
202567
202567
|
"@secondlayer/scaffold": "^1.6.1",
|
|
202568
|
-
"@secondlayer/sdk": "^14.
|
|
202569
|
-
"@secondlayer/shared": "^11.
|
|
202568
|
+
"@secondlayer/sdk": "^14.3.0",
|
|
202569
|
+
"@secondlayer/shared": "^11.20.0",
|
|
202570
202570
|
"@secondlayer/stacks": "^6.1.1",
|
|
202571
202571
|
"@secondlayer/subgraphs": "^6.3.6",
|
|
202572
|
+
"@secondlayer/verify": "^0.1.0",
|
|
202572
202573
|
esbuild: "^0.28.2",
|
|
202573
202574
|
"smol-toml": "^1.8.0",
|
|
202574
202575
|
zod: "^4.3.6"
|
|
@@ -204000,6 +204001,197 @@ import {
|
|
|
204000
204001
|
import { getDb as getDb3 } from "@secondlayer/shared/db";
|
|
204001
204002
|
init_output();
|
|
204002
204003
|
init_resolve_auth();
|
|
204004
|
+
|
|
204005
|
+
// src/commands/verify-block.ts
|
|
204006
|
+
init_output();
|
|
204007
|
+
init_resolve_auth();
|
|
204008
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
204009
|
+
import {
|
|
204010
|
+
BlockVerifier,
|
|
204011
|
+
MAINNET_CHECKPOINT,
|
|
204012
|
+
NodeRpcProofSource,
|
|
204013
|
+
SecondlayerProofSource,
|
|
204014
|
+
parseNakamotoHeader,
|
|
204015
|
+
unhex
|
|
204016
|
+
} from "@secondlayer/verify";
|
|
204017
|
+
var LINKS = [
|
|
204018
|
+
{ step: "block", label: "block" },
|
|
204019
|
+
{ step: "bitcoin", label: "bitcoin" },
|
|
204020
|
+
{ step: "burn", label: "burn" },
|
|
204021
|
+
{ step: "signer-set", label: "cycle" },
|
|
204022
|
+
{ step: "signatures", label: "signatures" },
|
|
204023
|
+
{ step: "witness", label: "state root" },
|
|
204024
|
+
{ step: "names", label: "diff" },
|
|
204025
|
+
{ step: "rows", label: "rows" }
|
|
204026
|
+
];
|
|
204027
|
+
var LABEL_WIDTH = Math.max(...LINKS.map((l) => l.label.length));
|
|
204028
|
+
var n = (v) => v.toLocaleString("en-US");
|
|
204029
|
+
function parseBlockRef(raw) {
|
|
204030
|
+
if (/^\d+$/.test(raw)) {
|
|
204031
|
+
const height = Number(raw);
|
|
204032
|
+
if (Number.isSafeInteger(height))
|
|
204033
|
+
return height;
|
|
204034
|
+
}
|
|
204035
|
+
const hash = raw.replace(/^0x/i, "").toLowerCase();
|
|
204036
|
+
if (/^[0-9a-f]{64}$/.test(hash))
|
|
204037
|
+
return hash;
|
|
204038
|
+
throw new Error(`expected a block height or a 64-hex index block hash, got "${raw}"`);
|
|
204039
|
+
}
|
|
204040
|
+
async function readCheckpoint(path) {
|
|
204041
|
+
const cp = JSON.parse(await readFile3(path, "utf8"));
|
|
204042
|
+
const ok = typeof cp?.stacks?.header === "string" && Number.isSafeInteger(cp.stacks.cycle) && typeof cp.stacks.signerSet === "string" && Number.isSafeInteger(cp.bitcoin?.height) && typeof cp.bitcoin?.header === "string";
|
|
204043
|
+
if (!ok)
|
|
204044
|
+
throw new Error(`${path}: a checkpoint needs stacks.{header, cycle, signerSet} and bitcoin.{height, header}`);
|
|
204045
|
+
return cp;
|
|
204046
|
+
}
|
|
204047
|
+
function defaultSource(node) {
|
|
204048
|
+
const api = new SecondlayerProofSource({
|
|
204049
|
+
baseUrl: resolveApiUrl(),
|
|
204050
|
+
apiKey: resolveDataPlaneKey() ?? ""
|
|
204051
|
+
});
|
|
204052
|
+
return node ? { ...api, ...new NodeRpcProofSource({ nodeUrl: node }) } : api;
|
|
204053
|
+
}
|
|
204054
|
+
function prepareSource(src) {
|
|
204055
|
+
const out = {
|
|
204056
|
+
getBlock: (ref) => src.getBlock(ref),
|
|
204057
|
+
getMarfProof: (path, tip) => src.getMarfProof(path, tip),
|
|
204058
|
+
getBurnPreimage: (ch) => src.getBurnPreimage(ch),
|
|
204059
|
+
getWitness: (id) => {
|
|
204060
|
+
note(` fetching state witness ${id}`);
|
|
204061
|
+
return src.getWitness(id);
|
|
204062
|
+
},
|
|
204063
|
+
getBitcoinHeaders: (from, count) => {
|
|
204064
|
+
note(` syncing Bitcoin headers ${n(from)}..${n(from + count - 1)}`);
|
|
204065
|
+
return src.getBitcoinHeaders(from, count);
|
|
204066
|
+
}
|
|
204067
|
+
};
|
|
204068
|
+
const { getStateWrites, getVmEvents } = src;
|
|
204069
|
+
if (getStateWrites)
|
|
204070
|
+
out.getStateWrites = (height) => getStateWrites.call(src, height);
|
|
204071
|
+
if (getVmEvents)
|
|
204072
|
+
out.getVmEvents = (height) => {
|
|
204073
|
+
note(` fetching indexed rows for ${n(height)}`);
|
|
204074
|
+
return getVmEvents.call(src, height);
|
|
204075
|
+
};
|
|
204076
|
+
return out;
|
|
204077
|
+
}
|
|
204078
|
+
function linkDetail(step, r, cp, rows) {
|
|
204079
|
+
switch (step) {
|
|
204080
|
+
case "block":
|
|
204081
|
+
return `${n(r.height ?? 0)} ${r.blockId}`;
|
|
204082
|
+
case "bitcoin":
|
|
204083
|
+
return `headers ${n(cp.bitcoin.height)}..${n(r.burnHeight ?? 0)}, proof-of-work and retargets checked`;
|
|
204084
|
+
case "burn":
|
|
204085
|
+
return `height ${n(r.burnHeight ?? 0)} ${r.bitcoinBlockHash}`;
|
|
204086
|
+
case "signer-set":
|
|
204087
|
+
return r.cycle === cp.stacks.cycle ? `${r.cycle}, the checkpoint's own signer set` : `${r.cycle}, signer set proven forward from checkpoint cycle ${cp.stacks.cycle}`;
|
|
204088
|
+
case "signatures":
|
|
204089
|
+
return `${n(r.signerWeight ?? 0n)} / ${n(r.totalWeight ?? 0n)} weight signed, threshold ${n(r.threshold ?? 0n)}`;
|
|
204090
|
+
case "witness":
|
|
204091
|
+
return `${r.stateRoot} matches the witness`;
|
|
204092
|
+
case "names": {
|
|
204093
|
+
const d = r.diff;
|
|
204094
|
+
if (!d)
|
|
204095
|
+
return "";
|
|
204096
|
+
const named = d.writes.filter((w) => w.named).length;
|
|
204097
|
+
const written = named ? `${d.writes.length} written (${named} named, ${d.writes.length - named} unnamed)` : `${d.writes.length} written (unnamed${rows ? "" : "; --rows names them"})`;
|
|
204098
|
+
return `${written}, ${d.carried.length} carried, ${d.internal.length} internal`;
|
|
204099
|
+
}
|
|
204100
|
+
case "rows":
|
|
204101
|
+
return `${n(r.rowsChecked ?? 0)} vm_events rows match the diff`;
|
|
204102
|
+
}
|
|
204103
|
+
}
|
|
204104
|
+
function report(r, cp, rows) {
|
|
204105
|
+
const first = r.failures[0];
|
|
204106
|
+
const broken = first ? LINKS.findIndex((l) => l.step === first.step) : LINKS.length;
|
|
204107
|
+
for (const [i, link] of LINKS.entries()) {
|
|
204108
|
+
const label = link.label.padEnd(LABEL_WIDTH);
|
|
204109
|
+
const failure = r.failures.find((f) => f.step === link.step);
|
|
204110
|
+
if (failure)
|
|
204111
|
+
writeData(`${red("✗")} ${label} ${failure.message}`);
|
|
204112
|
+
else if (link.step === "rows" && !rows)
|
|
204113
|
+
writeData(dim(`· ${label} not checked (pass --rows)`));
|
|
204114
|
+
else if (i > broken)
|
|
204115
|
+
writeData(dim(`· ${label} not checked: an earlier link is broken`));
|
|
204116
|
+
else if (link.step === "rows" && r.rowsChecked === undefined)
|
|
204117
|
+
writeData(dim(`· ${label} not checked: the source serves no indexed rows`));
|
|
204118
|
+
else
|
|
204119
|
+
writeData(`${green("✓")} ${label} ${linkDetail(link.step, r, cp, rows)}`);
|
|
204120
|
+
}
|
|
204121
|
+
for (const line of r.notes)
|
|
204122
|
+
if (rows || !line.includes("state_writes"))
|
|
204123
|
+
note(` note: ${line}`);
|
|
204124
|
+
if (!first) {
|
|
204125
|
+
const from = n(parseNakamotoHeader(unhex(cp.stacks.header)).chainLength);
|
|
204126
|
+
writeData(green(`✓ Block ${n(r.height ?? 0)} is proven. Trusted: only the checkpoint (Stacks ${from}, Bitcoin ${n(cp.bitcoin.height)}).`));
|
|
204127
|
+
return;
|
|
204128
|
+
}
|
|
204129
|
+
const label = LINKS[broken]?.label ?? first.step;
|
|
204130
|
+
writeData(red(first.code === "unavailable" ? `✗ Could not check the ${label} link: the source could not serve it.` : `✗ Not proven: the ${label} link is broken.`));
|
|
204131
|
+
}
|
|
204132
|
+
function verificationJson(r) {
|
|
204133
|
+
return JSON.stringify(r, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
|
|
204134
|
+
}
|
|
204135
|
+
function exitCodeOf(r) {
|
|
204136
|
+
if (r.ok)
|
|
204137
|
+
return VERIFY_EXIT.CLEAN;
|
|
204138
|
+
return r.failures[0]?.code === "unavailable" ? VERIFY_EXIT.UNANCHORED : VERIFY_EXIT.DIVERGED;
|
|
204139
|
+
}
|
|
204140
|
+
async function runVerifyBlock(ref, opts, deps = {}) {
|
|
204141
|
+
let checkpoint;
|
|
204142
|
+
let verifier;
|
|
204143
|
+
let target;
|
|
204144
|
+
try {
|
|
204145
|
+
target = parseBlockRef(ref);
|
|
204146
|
+
checkpoint = opts.checkpoint ? await readCheckpoint(opts.checkpoint) : MAINNET_CHECKPOINT;
|
|
204147
|
+
const source = prepareSource(deps.source ?? defaultSource(opts.node));
|
|
204148
|
+
verifier = new BlockVerifier({ source, checkpoint, rows: !!opts.rows });
|
|
204149
|
+
} catch (err) {
|
|
204150
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
204151
|
+
return VERIFY_EXIT.UNANCHORED;
|
|
204152
|
+
}
|
|
204153
|
+
note(`Verifying block ${typeof target === "number" ? n(target) : target}`);
|
|
204154
|
+
const result = await verifier.verify(target);
|
|
204155
|
+
if (opts.json)
|
|
204156
|
+
writeData(verificationJson(result));
|
|
204157
|
+
else
|
|
204158
|
+
report(result, checkpoint, !!opts.rows);
|
|
204159
|
+
return exitCodeOf(result);
|
|
204160
|
+
}
|
|
204161
|
+
function attachVerifyBlockCommand(verify) {
|
|
204162
|
+
return verify.command("block").description("Prove one Stacks block from the checkpoint built into this release, trusting nothing else").argument("<ref>", "block height or index block hash").option("--node <url>", "read blocks and MARF proofs from this Stacks node RPC instead of the API").option("--checkpoint <file>", "trust this checkpoint JSON instead of the one built into this release").option("--rows", "also prove the indexer's rows for the block (state_writes, vm_events) against its state diff").addHelpText("after", `
|
|
204163
|
+
What is proven, link by link:
|
|
204164
|
+
bitcoin headers from the checkpoint to the block's burn block: proof-of-work and retargets
|
|
204165
|
+
burn the block's consensus hash commits to that Bitcoin block
|
|
204166
|
+
cycle the reward cycle's signer set, proven forward from the checkpoint's set
|
|
204167
|
+
signatures signers holding at least 70% of the weight signed the block header
|
|
204168
|
+
state root the state witness hashes to the root in the signed header
|
|
204169
|
+
diff every leaf the block wrote, carried, or kept as bookkeeping
|
|
204170
|
+
rows with --rows: the Index API's rows match that diff
|
|
204171
|
+
|
|
204172
|
+
Nothing is trusted except the checkpoint. Proofs come from the API
|
|
204173
|
+
(SECONDLAYER_API_URL, or --api-url) with your account key, or from a node
|
|
204174
|
+
with --node; a source that lies can fail a link but never pass one.
|
|
204175
|
+
|
|
204176
|
+
Examples:
|
|
204177
|
+
$ secondlayer verify block 9137005
|
|
204178
|
+
$ secondlayer verify block 0x2e5962b00b8f243e1a4b5a1b7ff3076618ce5e737e30c019bc61e461c92f57ff
|
|
204179
|
+
$ secondlayer verify block 9137005 --node http://127.0.0.1:20443 --rows
|
|
204180
|
+
$ secondlayer verify block 9137005 --json
|
|
204181
|
+
|
|
204182
|
+
Output: one line per link on stdout, progress on stderr. --json prints the
|
|
204183
|
+
full verification result instead (signer weights as decimal strings).
|
|
204184
|
+
|
|
204185
|
+
Exit codes:
|
|
204186
|
+
0 every link holds
|
|
204187
|
+
1 a link is broken (the first is named)
|
|
204188
|
+
2 could not check: the source could not serve a link, or bad input`).action(async (ref, opts, cmd) => {
|
|
204189
|
+
const json = cmd.optsWithGlobals().json === true;
|
|
204190
|
+
process.exit(await runVerifyBlock(ref, { ...opts, json }));
|
|
204191
|
+
});
|
|
204192
|
+
}
|
|
204193
|
+
|
|
204194
|
+
// src/commands/verify.ts
|
|
204003
204195
|
var VERIFY_EXIT = {
|
|
204004
204196
|
CLEAN: 0,
|
|
204005
204197
|
DIVERGED: 1,
|
|
@@ -204022,7 +204214,7 @@ function statusLabel(status) {
|
|
|
204022
204214
|
return yellow("missing");
|
|
204023
204215
|
}
|
|
204024
204216
|
function attachVerifyCommand(cmd) {
|
|
204025
|
-
return cmd.argument("[target]", "all | raw | decode:<name> | subgraph:<name>", "raw").option("--quick", "coverage/identity only (default)").option("--deep", "include semantic / scratch replay where available").option("--anchor", "require a verified archive signature").
|
|
204217
|
+
return cmd.argument("[target]", "all | raw | decode:<name> | subgraph:<name>", "raw").option("--quick", "coverage/identity only (default)").option("--deep", "include semantic / scratch replay where available").option("--anchor", "require a verified archive signature").option("--against <manifest>", "archive manifest: an https URL or a local file path (required)").option("--from-block <n>", "first height to check").option("--to-block <n>", "last height to check").option("--counts", "also compare transaction/event row counts (slower)").option("--semantic", "also recompute per-partition semantic digests locally and compare (slow: full re-stream)").option("--public-key <pem>", "pin a signing key; default is the archive key built into this release").option("--insecure", "skip the manifest signature check (not recommended)").option("--json", "Output as JSON").addHelpText("after", `
|
|
204026
204218
|
Examples:
|
|
204027
204219
|
$ secondlayer verify --against https://archive.secondlayer.tools/.../snapshots/<digest>.json
|
|
204028
204220
|
$ secondlayer verify raw --against ./snapshot.json --from-block 8000000 --to-block 8499999
|
|
@@ -204033,7 +204225,11 @@ Examples:
|
|
|
204033
204225
|
Exit codes:
|
|
204034
204226
|
0 local data matches the archive
|
|
204035
204227
|
1 divergence found (divergent ranges are listed)
|
|
204036
|
-
2 unanchored — reference unavailable or unverifiable`).action(async (targetArg, opts) => {
|
|
204228
|
+
2 unanchored — reference unavailable or unverifiable`).action(async (targetArg, opts, command) => {
|
|
204229
|
+
if (opts.against === undefined)
|
|
204230
|
+
command.error("error: required option '--against <manifest>' not specified", {
|
|
204231
|
+
code: "commander.missingMandatoryOptionValue"
|
|
204232
|
+
});
|
|
204037
204233
|
try {
|
|
204038
204234
|
const target = parseVerifyTarget(targetArg);
|
|
204039
204235
|
const mode = opts.deep ? "deep" : opts.anchor ? "anchor" : "quick";
|
|
@@ -204212,7 +204408,8 @@ Exit codes:
|
|
|
204212
204408
|
});
|
|
204213
204409
|
}
|
|
204214
204410
|
function registerVerifyCommand(program) {
|
|
204215
|
-
attachVerifyCommand(program.command("verify").description("Compare local chain data against a signed archive (read-only
|
|
204411
|
+
const verify = attachVerifyCommand(program.command("verify").description("Compare local chain data against a signed archive, or prove one block with `verify block` (read-only)"));
|
|
204412
|
+
attachVerifyBlockCommand(verify);
|
|
204216
204413
|
}
|
|
204217
204414
|
|
|
204218
204415
|
// src/commands/archive.ts
|
|
@@ -206262,7 +206459,7 @@ init_resolve_auth();
|
|
|
206262
206459
|
|
|
206263
206460
|
// src/commands/faucet.ts
|
|
206264
206461
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
206265
|
-
import { readFile as
|
|
206462
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
206266
206463
|
import { join as join11 } from "node:path";
|
|
206267
206464
|
import { http as http3, createWalletClient } from "@secondlayer/stacks";
|
|
206268
206465
|
import { mnemonicToAccount } from "@secondlayer/stacks/accounts";
|
|
@@ -206276,7 +206473,7 @@ async function readDeployerMnemonic(projectDir) {
|
|
|
206276
206473
|
const path = join11(projectDir, "settings", "Devnet.toml");
|
|
206277
206474
|
let raw;
|
|
206278
206475
|
try {
|
|
206279
|
-
raw = await
|
|
206476
|
+
raw = await readFile5(path, "utf8");
|
|
206280
206477
|
} catch {
|
|
206281
206478
|
throw new Error(`could not read ${path}`);
|
|
206282
206479
|
}
|
|
@@ -207366,7 +207563,7 @@ import { resolveApiKey as resolveApiKey4 } from "@secondlayer/sdk";
|
|
|
207366
207563
|
|
|
207367
207564
|
// src/lib/project-file.ts
|
|
207368
207565
|
import { existsSync as existsSync8 } from "node:fs";
|
|
207369
|
-
import { mkdir as mkdir4, readFile as
|
|
207566
|
+
import { mkdir as mkdir4, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
|
|
207370
207567
|
import { homedir as homedir5 } from "node:os";
|
|
207371
207568
|
import { dirname as dirname10, join as join14, parse as parsePath2, resolve as resolve9 } from "node:path";
|
|
207372
207569
|
import { z as z4 } from "zod";
|
|
@@ -207383,7 +207580,7 @@ async function readActiveProject(cwd, globalDefault) {
|
|
|
207383
207580
|
const candidate = join14(dir, DIRNAME, FILENAME);
|
|
207384
207581
|
if (existsSync8(candidate)) {
|
|
207385
207582
|
try {
|
|
207386
|
-
const raw = await
|
|
207583
|
+
const raw = await readFile6(candidate, "utf8");
|
|
207387
207584
|
const parsed = ProjectFileSchema.parse(JSON.parse(raw));
|
|
207388
207585
|
return { slug: parsed.slug, resolvedFrom: candidate };
|
|
207389
207586
|
} catch {}
|
|
@@ -209308,5 +209505,5 @@ registerCreditsCommand(program);
|
|
|
209308
209505
|
registerArchiveCommand(program);
|
|
209309
209506
|
program.parse();
|
|
209310
209507
|
|
|
209311
|
-
//# debugId=
|
|
209508
|
+
//# debugId=063D7FC6388E8ABC64756E2164756E21
|
|
209312
209509
|
//# sourceMappingURL=cli.js.map
|