Skip to content

Releases: kuiralabs/midnight-cli

v0.6.0-rc.9: mn grant runs the account package it installs

Choose a tag to compare

@nel349 nel349 released this 18 Oct 05:12
2b4b361

Changed

  • mn grant runs the account package it installs. mn now depends on @kuiralabs/midnight-account-chain 0.2.2 and drives it by default, so no account build has to be named first. Its proving artefacts are not in the package (4 GB in all): each is fetched from GitHub the first time a command needs it, from the build's release in kuiralabs/midnight-account-artifacts, into ~/.midnight/account-artifacts, and kept only if it matches the package's manifest. The verifier keys (under 0.1 MB in all) come when a command first reads the account; each circuit's proving key comes when a command first proves with it. A deposit's is 11 MB; each of the owner's other circuits (issue, revoke, rotate the viewing key, append to the inbox) is about 235 MB, fetched once, and said as it is fetched. A fetch that fails says what failed and that running the command again retries, keeping what was already fetched.
  • The account build gets only what mn gives it. BENCH_PROFILE, MIDNIGHT_ACCOUNT_ARTEFACTS_DIR and MIDNIGHT_ACCOUNT_ARTEFACTS_SOURCE set in the shell no longer reach it (a profile moved the account's records where mn never looks), and it runs on the Node.js running mn, not the first node on PATH.
  • mn grant revoke on a grant already revoked says so (alreadyRevoked, exit 0) instead of "the roster holds no revocable grant". That is what a revoke run again after one cut short sees: the rerun first finishes the rotation the revocation owes, and the grant is then revoked.
  • --account-build <dir> (or mn config set account-build <dir>) still drives a local build instead, which uses its own proving keys. It must speak interface version 4; an older one is refused with "This account build speaks version 3 of its interface; this mn speaks version 4", which says to update the build or drop it (mn config unset account-build) for the package mn installs.

Install: npm install -g midnight-wallet-cli@next

v0.6.0-rc.10: MCP tool calls report progress and stop when cancelled

Choose a tag to compare

@nel349 nel349 released this 18 Oct 07:54
5b5140f

Changed

  • MCP tool calls report progress, and stop when cancelled. A call that carries a progress token gets what the command says as it runs, as numbered progress notifications: the steps a terminal shows (the wallet check, mn serve starting and syncing, the transactions it balances and submits, the account build's proofs and each proving artefact it fetches), though the command runs in --json mode. A client that resets its timeout on progress keeps waiting through a first issue or revoke. A call the client cancels stops: a grant or contract command's script is stopped, and the mn serve it started with it. A transaction already submitted when the cancel comes may still land, so read the state (midnight_grant_status, a balance) before running the call again.

Install: npm install -g midnight-wallet-cli@next

v0.5.8: mn test and localnet fixes, and the MCP skill resource ships

Choose a tag to compare

@nel349 nel349 released this 17 Oct 03:44
be6ca44

📦 npm: https://www.npmjs.com/package/midnight-wallet-cli/v/0.5.8 (npm i -g midnight-wallet-cli@0.5.8)

Fixed

  • The MCP server's core skill resource can be read from an installed package. midnight-wallet://skill/core is the first document an agent is pointed at, and reading it failed with ENOENT ... docs/SKILL-CORE.md: the file was missing from the published package (every 0.5.x release since the skill was split in two). It ships now, and the fresh-install check in CI reads every resource the installed MCP server lists.
  • The skill document no longer points agents at tools that do not exist. Two error recipes said to call midnight_status(), and the testing section said to run suites with midnight_test_run; neither is a tool of this line. The recipes name midnight_localnet_status() and what to do on a hosted network, and the testing section says mn test run is a CLI command. The fresh-install check now compares every tool call the skill documents show with the tools the installed server lists.
  • A failed mn test run exits 1. It printed FAIL and exited 0, so a failing suite passed in CI. (Every wallet command ended with exit(0) whatever exit code the command had set.)
  • mn test run passes the first time on a new chain. The dust prep step ended as soon as the wallet had any Dust, and the suite's deploy, a moment later, failed with "Insufficient Funds: could not balance dust"; a second run passed. The step now waits for the amount mn asks for before any transaction (0.8 DUST, about a minute and a half for the 1000 NIGHT the prep funds), and says how much there is while it waits. A CLI suite waits for the same amount before each deploy and call, since each fee leaves the wallet short until its Dust regrows: a call sent the moment a deploy landed failed the same way.
  • mn test run no longer needs curl. Its localnet-up step probed the indexer by shelling out to curl. Where there is none (a slim container image, a CI runner) it decided a healthy localnet was broken, tore it down twice, and failed with "Localnet failed to start after 2 attempts". It asks over HTTP from Node now. The waits in mn localnet up no longer shell out to sleep either, which Windows does not have.
  • A suite does not reuse a contract from a chain that is gone. mn test run keeps the address it deployed at, to reuse the contract on the next run. After mn localnet down and up that address is on no chain, and the run failed with "No contract found at address ...". Before reusing the address the suite now asks the indexer whether a contract is there, and deploys again when there is none. (A new local network has the same genesis hash as the last, so nothing short of asking can tell them apart.)
  • mn test results shows results. It read the runner's own .contract-cache-<suite>.json in the results directory as the latest result, printed undefined — FAIL (undefineds) and crashed.
  • Adding a browser suite to a project that has a CLI suite gives a suite that can run. mn test create --strategy ui left an existing dapp.test.json as it was, without the port, the build command or the build-and-serve step the new suite needs. Whichever of those the file lacks are added; everything already in it is kept.
  • mn localnet up explains the failures a user can fix. A port held by another container ("port is already allocated") got Docker's raw message; only a port held by a program on the host was explained. Both are now, naming the port. A Docker daemon that is not running is said to be that.
  • mn localnet status shows a stopped localnet as stopped. After mn localnet stop it reported no services, the same as after down.

Changed

  • mn says when a long Dust sync is not using the native reader. Without the dust-sync sidecar a first Dust sync runs through the built-in WASM reader, several times slower, and nothing said so unless --verbose was on. On a sync of more than 50,000 events mn now prints one line on stderr with the reason: Native Dust reader not installed (@nel349/dust-sync-linux-x64): reading with the built-in one, several times slower on a long sync. The reasons are not installed (npm ran with --omit=optional, or no build for the platform), can't start on this system (Alpine and other musl Linux, where the glibc binary installs but cannot run), disabled by MN_DISABLE_NATIVE_DUST=1, and failed. A short sync says nothing.
  • mn test run output: one mark per line, and the error, not a stack. Prep steps and actions printed two marks (✓ ✗ deploy: ...), and a failed deploy or call printed the generated script's whole stderr, Node stack included; mn contract deploy and call did the same. The line is now the error itself ("Insufficient Funds: could not balance dust"). A browser suite run without the Claude Code CLI says that is what it needs.
  • --verbose names the reader on every Dust sync: dust: native sidecar: <path>, or dust: native sidecar <reason>, using WASM.
  • Docs: how long a first sync takes, and what the native reader needs. The README, mn manual, mn help --agent and both MCP skill documents give the measured times of a wallet's first Dust sync with 0.5.7 installed from npm (preprod, 1.6M events: about 5 minutes native; preview, 144k events: about 30 seconds native against about 2 minutes in WASM; seconds after that), say which commands trigger it, which platforms the sidecar is built for (macOS arm64 and x64, Linux x64 and arm64 on glibc, Windows x64), how to tell which reader ran, and how to get the native one back.

Package on npm: https://www.npmjs.com/package/midnight-wallet-cli

Full changelog: https://github.com/nel349/midnight-wallet-cli/blob/main/CHANGELOG.md

v0.5.2 — native dust-sync sidecar ships to npm

Choose a tag to compare

@nel349 nel349 released this 11 Sep 03:36
3a9c0bd

📦 npm: https://www.npmjs.com/package/midnight-wallet-cli/v/0.5.2 — npm i -g midnight-wallet-cli@0.5.2

Added

  • The native dust-sync sidecar now ships to npm — fast cold dust sync out of the box. Until now the Rust sidecar was source-only, so every npm install fell back to the WASM reader (~22 min for a cold ~1.45M-event preprod prime vs ~4.5 min native); native was reachable only from a repo checkout or via MN_DUST_SYNC_BIN. The prebuilt binary now ships as per-platform packages (@nel349/dust-sync-<os>-<arch> for darwin-arm64/x64, linux-x64/arm64, win32-x64), wired as optionalDependencies so npm installs only the one matching the host and a platform with no published binary still installs fine and falls back to WASM. A GitHub Actions matrix builds each target on its native runner (Cargo pins --locked to ledger-v8 =8.1.0 so the serialized DustLocalState round-trips byte-identically) and publishes the platform packages before the main package. resolveSidecarBinary() already preferred this package; it now finds it on a plain install. MN_DUST_SYNC_BIN still overrides; MN_DISABLE_NATIVE_DUST=1 still forces WASM.

Fixed

  • mn serve no longer orphans its heap-bumped child when the launcher is killed. Facade commands re-exec themselves with a larger --max-old-space-size (the heap-guard), and the re-exec'd child is the process that binds the serve port. The launcher previously ignored SIGINT/SIGTERM (it blocked in spawnSync), so kill <launcher-pid> was swallowed and the child kept running and holding the port. The launcher now forwards SIGINT/SIGTERM/SIGHUP to the child and force-kills it on any exit, and the child self-terminates if it gets reparented (the uncatchable kill -9 <launcher> case). Verified live: killing only the launcher now takes the child down and frees the port.

Package on npm: https://www.npmjs.com/package/midnight-wallet-cli

Full changelog: https://github.com/nel349/midnight-wallet-cli/blob/main/CHANGELOG.md

v0.5.1

Choose a tag to compare

@nel349 nel349 released this 24 Aug 23:07
b8ce5ef

midnight-wallet-cli 0.5.1

Follow-up fixes on top of 0.5.0. Full detail in CHANGELOG.md.

Changed

  • Native dust-sync path now collapses the generation tree. The 0.5.0 collapse ran only on the WASM reader; the native sidecar (fast/default path) returned an uncollapsed state, so a cold native sync exported an unbounded snapshot. adaptResult now collapses the native result too (fails safe to uncollapsed via the balance+root guard). Verified on preprod: a cold native export (1.42M events) dropped from ~1.46 MB to ~78 KB.

Fixed

  • mn dust export on a brand-new wallet no longer silently truncates. It now routes through the repository (native sidecar + bounded partial-resume loop) and surfaces partial in --json and a loud warning, instead of exiting 0 with a snapshot half the chain behind.
  • mn balance now honours MN_SEED (and --seed). A seed-only caller previously got the active wallet's balance; all seed-operating commands now share one resolver (--seed → MN_SEED → --wallet → active).
  • A completed dust/unshielded sync is no longer discarded by a transient tip-probe timeout.

Note: not yet published to npm at release time — install from source or bun link locally. The native sidecar ships as source; an npm installed mn falls back to WASM until the platform binaries ship.

v0.5.0

Choose a tag to compare

@nel349 nel349 released this 19 Aug 03:11
47f0cbe

midnight-wallet-cli 0.5.0

Re-cut to include all work through the review-hardening pass. Full detail in CHANGELOG.md.

Highlights

  • Native dust-sync sidecar — cold dust sync ~22 min → ~3.7 min (~5×), optional, with transparent WASM fallback. Ships as source in this release; a local bun link gets native.
  • Shielded balance sync rewritten as a direct indexer reader — hours → ~1 min, memory-bounded (no more 16 GB OOM).
  • Dust generation-tree collapse — bounded dust-cache size and restart cost (~300× smaller serialized cache on a real preprod state).
  • mn dust export — restorable dust snapshot for fast warm-restore.
  • mn contract deploy --secret-key — seed a caller-chosen initial private-state secret (env-passed, never on disk).

Correctness fixes

  • Cache chain-reset guard now actually enforced for dust + wallet caches (was a silent no-op — could surface a stale balance after a chain reset).
  • Native sidecar no longer caches an incomplete sync as complete — a mid-stream WS drop now resumes instead of being recorded as done.
  • Direct-indexer readers share one graphql-ws subscription driver — uniform, resumable settle semantics; fixes the fast dust reader reporting a dropped stream as complete.

DX / consistency

  • mn address accepts --wallet and MN_SEED; mn generate accepts MN_SEED (keeps seeds off the process list).
  • Native sidecar warm-at-tip resume ~2× faster (initial-silence fast-return).
  • Localnet self-heal — every service uses restart: unless-stopped (survives Docker Desktop restarts; no more half-dead localnet).
  • Localnet images bumped to the current Preview/Preprod support-matrix generation.
  • MCP tool count corrected (30), plus documentation of new flags/commands.

Note: not yet published to npm — install from source or bun link locally.