midnight-wallet-cli 0.5.7 → 0.5.8
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 +26 -4
- package/dist/mcp-server.js +358 -349
- package/dist/wallet.js +581 -537
- package/docs/SKILL-CORE.md +47 -0
- package/docs/SKILL.md +22 -8
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -98,6 +98,8 @@ midnight balance
|
|
|
98
98
|
midnight transfer mn_addr_preprod1... 100
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
The first command that needs the wallet's Dust (`dust register`, a transfer, `midnight serve`, a contract deploy or call) reads the chain's Dust history first: about 5 minutes on preprod and 30 seconds on preview, once per wallet and network. After that it takes seconds. See [Native dust acceleration](#native-dust-acceleration).
|
|
102
|
+
|
|
101
103
|
## Supported Networks
|
|
102
104
|
|
|
103
105
|
| Network | Description |
|
|
@@ -124,12 +126,32 @@ midnight config set blockfrost-project-id <project id> # or: export BLOCKFROST
|
|
|
124
126
|
|
|
125
127
|
## Native dust acceleration
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
A wallet's first Dust sync on a hosted network (`preprod`, `preview`) reads the chain's whole Dust event history, and that is the slow part of a first run. mn reads it with a native (Rust) program, the `dust-sync` sidecar, several times faster than the built-in WASM reader. Later runs resume from a cache and take seconds with either reader.
|
|
130
|
+
|
|
131
|
+
| Network | Dust events | First sync, native | First sync, WASM | Later runs |
|
|
132
|
+
|---------|-------------|--------------------|------------------|------------|
|
|
133
|
+
| `preprod` | 1.6M | about 5 min | about 27 min (estimated) | about 6 s |
|
|
134
|
+
| `preview` | 144k | about 30 s | about 2 min | about 10 s |
|
|
135
|
+
|
|
136
|
+
Measured on 2026-10-11 with 0.5.7 installed from npm on an Apple Silicon Mac (Linux arm64 gave the same preview time). The times grow with the chain. The preprod WASM figure is worked out from that reader's measured 1,000 events a second: Blockfrost closes the connection of a reader that slow about every 75 seconds, and mn resumes each time until the sync is done.
|
|
137
|
+
|
|
138
|
+
**It installs by itself.** npm adds one optional package for your platform, `@nel349/dust-sync-<os>-<arch>`: macOS (arm64, x64), Linux (x64, arm64; glibc) and Windows (x64). No configuration and no install scripts.
|
|
139
|
+
|
|
140
|
+
**When it can't be used, mn reads with the WASM reader**: everything works, more slowly. That is the case when:
|
|
141
|
+
|
|
142
|
+
- the package isn't there: npm ran with `--omit=optional` (or `--no-optional`), or there is no build for the platform;
|
|
143
|
+
- the binary can't start: Alpine and other musl-based Linux (the Linux builds need glibc);
|
|
144
|
+
- `MN_DISABLE_NATIVE_DUST=1` is set;
|
|
145
|
+
- a run of the sidecar fails (mn carries on in WASM from the last saved event).
|
|
146
|
+
|
|
147
|
+
On a long sync mn says so in 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.` With `--verbose` every sync names its reader: `dust: native sidecar: <path>`, or `dust: native sidecar <reason>, using WASM`.
|
|
128
148
|
|
|
129
|
-
|
|
149
|
+
To get the native reader back, reinstall without leaving optional dependencies out (`npm install -g midnight-wallet-cli`); in a container, use a glibc image (for example `node:22-slim`, not `node:22-alpine`).
|
|
130
150
|
|
|
131
|
-
- `
|
|
132
|
-
- `
|
|
151
|
+
- `MN_DUST_SYNC_BIN=/path/to/dust-sync`: use your own build (`cargo build --release` in `sidecar/dust-sync`) in place of the installed one.
|
|
152
|
+
- `MN_DISABLE_NATIVE_DUST=1`: force the WASM reader (to compare, or if a binary misbehaves).
|
|
153
|
+
- The sidecar keeps its own checkpoint beside the wallet cache (`~/.midnight/cache/<network>/dust-native-*.json`), so an interrupted sync resumes; `midnight cache clear` removes it with the rest.
|
|
154
|
+
- On preprod the sidecar is started with the indexer URL, your Blockfrost project id included, as an argument: other processes of your own user can see it while the sync runs.
|
|
133
155
|
|
|
134
156
|
## DApp Connector
|
|
135
157
|
|