opschain governance evidence export
packs:security-governance
opschain governance evidence export [--after-seq <n>] [--limit <n>] [--out <file>] [flags]
Exports one hash-chained batch of evidence ledger rows for an external
auditor (GovernanceService.ExportEvidenceLedger): the canonical NDJSON
encoding (opschain-evidence-export/v1 — one JSON object per row, chain
order, every row carrying its stored prev_hash/row_hash verbatim).
Before anything is written, the CLI re-encodes the served rows and checks
its digest against the server's entries_sha256 — a mismatch refuses the
export.
Batches chain: pass the previous batch's last seq as --after-seq and the
new batch's first row links to it by prev_hash, so the accumulated
export re-verifies offline without the server. An empty batch means the
cursor is caught up; the response's archived_through_seq names the
sealed-archive boundary (rows at or below it live in verified blob-store
archive segments, not in this lane — see opschain docs retention).
With --out the batch lands in the named file (mode 0600) and a summary
line prints the range and digest; without it the raw NDJSON streams to
stdout. -o json / -o yaml emit the typed response instead, including
entries_sha256 and the batch range.
Flags
| Flag | Meaning |
|---|---|
--after-seq <n> | The export cursor: rows with seq strictly greater are exported (0 starts at the oldest stored row). |
--limit <n> | Batch size (server default 1000, capped at 1000). |
--out <file> | Write the NDJSON batch to this file instead of stdout. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Exported (an empty batch prints that the cursor is caught up). |
| 1 | The export failed — including the named packs:security-governance refusal and a digest mismatch. |
| 2 | Usage error, including a missing server target. |