@tokamak-private-dapps/private-state-cli 1.0.0 → 1.0.2
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/CHANGELOG.md +35 -0
- package/README.md +104 -0
- package/assets/tx-fees.json +170 -0
- package/lib/private-state-cli-command-registry.mjs +56 -9
- package/lib/private-state-runtime-management.mjs +2 -0
- package/package.json +2 -1
- package/private-state-bridge-cli.mjs +794 -99
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.0.2 - 2026-05-06
|
|
6
|
+
|
|
7
|
+
- Added `update`, which checks npm registry for the latest private-state CLI package and updates
|
|
8
|
+
global npm installs when a newer version exists.
|
|
9
|
+
- Kept repository checkouts and non-global installs read-only during `update`; those modes print
|
|
10
|
+
the exact `npm install -g @tokamak-private-dapps/private-state-cli@latest` command instead.
|
|
11
|
+
- Reused runtime-management output parsing helpers for `update` and `uninstall` instead of
|
|
12
|
+
duplicating npm JSON and ANSI-output handling in the CLI entrypoint.
|
|
13
|
+
- Added `transaction-fees`, which reads packaged measured gas data from `assets/tx-fees.json`,
|
|
14
|
+
combines it with live RPC fee data and live ETH/USD pricing, and prints a per-command ETH/USD
|
|
15
|
+
fee table.
|
|
16
|
+
- Split `transaction-fees` estimates into typical cost from RPC `gasPrice` and worst-case cost
|
|
17
|
+
from EIP-1559 `maxFeePerGas`.
|
|
18
|
+
- Added optional `--tx-submitter <ACCOUNT>` support to `mint-notes`, `transfer-notes`, and
|
|
19
|
+
`redeem-notes` so proof-backed note owners can separate note ownership from the L1 account
|
|
20
|
+
that submits `executeChannelTransaction` and pays gas.
|
|
21
|
+
- Expanded LLM-agent README guidance so agents explain private key files, local account aliases,
|
|
22
|
+
wallet secret source files, network RPC URLs, and immutable channel policy step by step before
|
|
23
|
+
guiding new users through `join-channel`.
|
|
24
|
+
- Added RPC log scan progress output to `recover-workspace` and `recover-wallet`, with progress
|
|
25
|
+
routed to stderr in `--json` mode so machine-readable command results stay valid.
|
|
26
|
+
- Added `recover-wallet --from-genesis` and removed implicit genesis replay fallback from
|
|
27
|
+
`recover-workspace` and `recover-wallet`; both commands now require a usable recovery index
|
|
28
|
+
unless the user explicitly requests `--from-genesis`.
|
|
29
|
+
- Changed `get-my-wallet-meta`, `get-my-channel-fund`, and `get-my-notes` to use indexed
|
|
30
|
+
recovery only before reading channel state, with `get-my-notes` also validating the wallet
|
|
31
|
+
note-receive recovery index before scanning delivery logs.
|
|
32
|
+
- Unified wallet command workspace refresh through the same recovery-indexed path used by
|
|
33
|
+
`recover-workspace`, and shared received-note recovery through the wallet's
|
|
34
|
+
`noteReceiveLastScannedBlock` index.
|
|
35
|
+
|
|
36
|
+
## 1.0.1 - 2026-05-05
|
|
37
|
+
|
|
38
|
+
- Added global `--version` output for scripts that need the installed private-state CLI package
|
|
39
|
+
version without running `doctor`.
|
|
5
40
|
- Changed the channel-bound L2 identity derivation signing domain and mode from password wording
|
|
6
41
|
to wallet-secret wording. Existing local wallets from the pre-1.0.0 cleanup path are not
|
|
7
42
|
compatibility targets.
|
package/README.md
CHANGED
|
@@ -51,6 +51,22 @@ Check the installed package and runtime state with:
|
|
|
51
51
|
private-state-cli doctor
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Print only the installed CLI package version with:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
private-state-cli --version
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Check npm registry for a newer CLI package and update a global npm install when possible:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
private-state-cli update
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`update` keeps `--version` suitable for scripts by using a separate command for registry checks. If the CLI is running
|
|
67
|
+
from a repository checkout or npm does not report a global install, it does not edit local source files; it prints the
|
|
68
|
+
recommended `npm install -g @tokamak-private-dapps/private-state-cli@latest` command instead.
|
|
69
|
+
|
|
54
70
|
Remove all local private-state CLI data with:
|
|
55
71
|
|
|
56
72
|
```bash
|
|
@@ -80,6 +96,46 @@ A common private-state flow is:
|
|
|
80
96
|
|
|
81
97
|
Use `private-state-cli --help` for the full command list and required options.
|
|
82
98
|
|
|
99
|
+
Workspace recovery commands use the saved recovery index by default. If the local workspace is missing, corrupted, or
|
|
100
|
+
does not contain a usable index, `recover-workspace` and `recover-wallet` stop with an explicit error instead of
|
|
101
|
+
silently replaying logs from channel genesis. Use `--from-genesis` only when you intentionally want to rebuild from the
|
|
102
|
+
channel creation block:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
private-state-cli recover-workspace --channel-name <CHANNEL> --network mainnet --from-genesis
|
|
106
|
+
private-state-cli recover-wallet --channel-name <CHANNEL> --network mainnet --account <ACCOUNT> --from-genesis
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`create-channel` is the exception: after the channel is created on-chain, the CLI initializes that new local workspace
|
|
110
|
+
by replaying from the channel's genesis block because no prior recovery index can exist for a new channel.
|
|
111
|
+
|
|
112
|
+
Wallet getter commands that need channel state, including `get-my-wallet-meta`, `get-my-channel-fund`, and
|
|
113
|
+
`get-my-notes`, follow the same indexed recovery rule before reading local or on-chain state. `get-my-notes` also uses
|
|
114
|
+
the wallet's saved note-receive scan index for encrypted note delivery logs. If either index is unusable, the command
|
|
115
|
+
stops and asks the user to run the appropriate recovery command with `--from-genesis`.
|
|
116
|
+
|
|
117
|
+
Estimate live transaction costs before sending commands with:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
private-state-cli transaction-fees --network mainnet --rpc-url <RPC_URL>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`transaction-fees` uses the measured gas data packaged in `assets/tx-fees.json`, the selected network's live fee data,
|
|
124
|
+
and live ETH/USD pricing to print an ETH/USD fee table for transaction-sending commands. The table separates typical
|
|
125
|
+
cost, based on the RPC `gasPrice`, from worst-case cost, based on `maxFeePerGas` when the network reports EIP-1559 fee
|
|
126
|
+
data.
|
|
127
|
+
|
|
128
|
+
Proof-backed note commands can use a separate L1 transaction submitter:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
private-state-cli mint-notes --wallet <WALLET> --network mainnet --amounts '[1]' --tx-submitter <ACCOUNT>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`--tx-submitter <ACCOUNT>` is available on `mint-notes`, `transfer-notes`, and `redeem-notes`. The wallet still proves
|
|
135
|
+
note ownership and builds the ZK proof, but the selected local account submits `executeChannelTransaction` and pays gas.
|
|
136
|
+
Use this option when you want stronger privacy by avoiding a direct on-chain link between the note owner's wallet L1
|
|
137
|
+
account and the proof-submission transaction.
|
|
138
|
+
|
|
83
139
|
Channel policy warning:
|
|
84
140
|
|
|
85
141
|
- `create-channel` commits to an immutable channel policy: verifier bindings, DApp execution metadata, function layout,
|
|
@@ -162,6 +218,43 @@ Operating rules:
|
|
|
162
218
|
|
|
163
219
|
- Do not ask the user to reveal raw private keys or wallet secrets in chat. Use `account import --private-key-file`
|
|
164
220
|
once, then use `--account` for L1 signing commands. Wallet commands use wallet-local default secret files.
|
|
221
|
+
- Treat `private key file`, `account`, `wallet secret`, `wallet`, `network RPC URL`, and `channel policy` as
|
|
222
|
+
new concepts unless the user has already demonstrated that they understand them. Define each term before using it
|
|
223
|
+
in an instruction.
|
|
224
|
+
- Explain local-secret handling in plain language:
|
|
225
|
+
- A private key file is a local file that contains the user's L1 wallet private key. The CLI reads it once during
|
|
226
|
+
`account import` and stores a protected local account secret.
|
|
227
|
+
- An account is the local nickname created by `account import`. After import, signing commands should use
|
|
228
|
+
`--account <NAME>` instead of asking for the raw key again.
|
|
229
|
+
- A wallet secret source file is a separate high-entropy local secret chosen by the user for this private-state
|
|
230
|
+
wallet. It is not the L1 private key. `join-channel` imports it once and uses it to protect and recover the
|
|
231
|
+
channel-local wallet.
|
|
232
|
+
- A wallet is the encrypted local private-state wallet created during `join-channel`. Its deterministic name is
|
|
233
|
+
`<channelName>-<l1Address>`.
|
|
234
|
+
- The network RPC URL is the endpoint used to read and write chain state. It can be supplied once with `--rpc-url`
|
|
235
|
+
on a bridge-facing command, after which the CLI saves it under the selected network.
|
|
236
|
+
- A workspace recovery index is the saved block pointer and state-root hash that lets the CLI resume log scanning
|
|
237
|
+
without replaying the channel from its creation block. If it is missing, explain `--from-genesis` before using it
|
|
238
|
+
because genesis replay can take much longer.
|
|
239
|
+
- When the user does not have a network RPC URL yet, explain that they need an Ethereum JSON-RPC endpoint for the
|
|
240
|
+
selected network. They can obtain one from an infrastructure provider such as Alchemy, Infura, QuickNode, or from
|
|
241
|
+
their own node. Ask the user to create or select the endpoint in that provider's UI, then paste only the endpoint URL
|
|
242
|
+
into the CLI command that accepts `--rpc-url`; do not ask for provider account passwords, API dashboards, seed phrases,
|
|
243
|
+
private keys, or wallet secrets.
|
|
244
|
+
- When a user wants to join a channel, do not jump straight to `join-channel`. Walk them through:
|
|
245
|
+
1. choose the network and channel name
|
|
246
|
+
2. run `private-state-cli install`
|
|
247
|
+
3. run `private-state-cli doctor`
|
|
248
|
+
4. obtain or confirm a network RPC URL for the selected network
|
|
249
|
+
5. prepare a private key source file locally, without pasting the key into chat
|
|
250
|
+
6. run `account import --account <NAME> --network <NETWORK> --private-key-file <PATH>`
|
|
251
|
+
7. prepare a wallet secret source file locally, for example with `openssl rand -hex 32 > ./wallet-secret.txt`
|
|
252
|
+
8. inspect the channel with `get-channel` if it already exists, or create it with `create-channel` if the user is
|
|
253
|
+
the channel creator
|
|
254
|
+
9. explain the immutable policy warning printed by the CLI
|
|
255
|
+
10. run `join-channel --channel-name <CHANNEL> --network <NETWORK> --account <ACCOUNT> --wallet-secret-path <PATH>`
|
|
256
|
+
- Before asking the user to create a file, explain what will be inside that file, who should be able to read it, and
|
|
257
|
+
whether losing it prevents wallet recovery.
|
|
165
258
|
- Prefer testnet examples unless the user explicitly asks for mainnet.
|
|
166
259
|
- Before any proof-backed or bridge-facing workflow, ask the user to run `private-state-cli doctor` and inspect
|
|
167
260
|
whether the runtime, Docker mode, CUDA/GPU probes, Groth16 runtime, and deployment artifacts are healthy.
|
|
@@ -175,6 +268,9 @@ Operating rules:
|
|
|
175
268
|
telling the user to move funds.
|
|
176
269
|
- Explain that wallet names are local CLI identifiers, while private transfers use notes owned by L2 addresses
|
|
177
270
|
registered in the channel.
|
|
271
|
+
- Explain `--tx-submitter <ACCOUNT>` when the user wants stronger privacy for `mint-notes`, `transfer-notes`, or
|
|
272
|
+
`redeem-notes`: the wallet owner still proves note ownership, but another imported local L1 account can submit the
|
|
273
|
+
on-chain `executeChannelTransaction` and pay gas.
|
|
178
274
|
- Before guiding a user through `create-channel` or `join-channel`, explain that channel policy is immutable after
|
|
179
275
|
creation and that joining a channel means accepting its current verifier, DApp metadata, function layout, managed
|
|
180
276
|
storage vector, and refund policy.
|
|
@@ -198,6 +294,14 @@ Suggested interaction flow:
|
|
|
198
294
|
`get-my-wallet-meta`, then build `transfer-notes`.
|
|
199
295
|
8. After transfer, guide the recipient to run `get-my-notes` to recover received notes from event logs.
|
|
200
296
|
|
|
297
|
+
Example onboarding explanation for `join-channel`:
|
|
298
|
+
|
|
299
|
+
> First we need two different local secrets. Your L1 private key proves which Ethereum account pays gas and signs
|
|
300
|
+
> bridge transactions. We import it once into a local account nickname, so later commands can say `--account alice`
|
|
301
|
+
> instead of handling the raw key again. Separately, the wallet secret protects the encrypted private-state wallet for
|
|
302
|
+
> this channel. It is not sent on-chain and it is not the same as your L1 private key. If you lose the wallet secret,
|
|
303
|
+
> recovering this channel wallet can become impossible.
|
|
304
|
+
|
|
201
305
|
Example style: if the user says, "ADDR6 sends 10 tokens privately to ADDR8", do not assume the required note exists.
|
|
202
306
|
First ask or check which channel and network to use, whether ADDR6 and ADDR8 are already joined, what the local wallet
|
|
203
307
|
names are, and whether ADDR6 has an unused note worth exactly 10 or notes that sum to 10. Then provide the next concrete
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "tokamak-private-state-cli-tx-fees.v1",
|
|
3
|
+
"measuredAt": "2026-05-05",
|
|
4
|
+
"measurementBasis": "Measured directly from the current repository worktree with forge test --root bridge --gas-report and completed local CLI e2e transaction receipts.",
|
|
5
|
+
"notes": [
|
|
6
|
+
"Gas values are protocol transaction gasUsed values, not a guarantee for every future calldata shape or verifier implementation.",
|
|
7
|
+
"ERC-20 approval transactions are listed as separate approve components when the CLI command sends an approval transaction.",
|
|
8
|
+
"transfer-notes and redeem-notes use the same proof-backed executeChannelTransaction baseline measured from the successful mint-notes CLI e2e receipt because the current e2e run stopped before producing fresh transfer/redeem receipts."
|
|
9
|
+
],
|
|
10
|
+
"commands": [
|
|
11
|
+
{
|
|
12
|
+
"command": "create-channel",
|
|
13
|
+
"description": "Create a bridge channel and initialize its policy snapshot.",
|
|
14
|
+
"transactions": [
|
|
15
|
+
{
|
|
16
|
+
"label": "createChannel",
|
|
17
|
+
"contract": "BridgeCore",
|
|
18
|
+
"function": "createChannel",
|
|
19
|
+
"gasUsed": 2736229,
|
|
20
|
+
"source": "forge-gas-report",
|
|
21
|
+
"sourceDetail": "BridgeCore.createChannel max successful path from forge test --root bridge --gas-report."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"command": "deposit-bridge",
|
|
27
|
+
"description": "Deposit canonical tokens into the shared bridge vault.",
|
|
28
|
+
"transactions": [
|
|
29
|
+
{
|
|
30
|
+
"label": "approve",
|
|
31
|
+
"contract": "MockERC20",
|
|
32
|
+
"function": "approve",
|
|
33
|
+
"gasUsed": 45729,
|
|
34
|
+
"source": "cast-local-measurement",
|
|
35
|
+
"sourceDetail": "Measured on local anvil by deploying bridge/src/mocks/MockERC20.sol and sending approve(address,uint256)."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "fund",
|
|
39
|
+
"contract": "L1TokenVault",
|
|
40
|
+
"function": "fund",
|
|
41
|
+
"gasUsed": 68343,
|
|
42
|
+
"source": "forge-gas-report",
|
|
43
|
+
"sourceDetail": "L1TokenVault.fund from forge test --root bridge --gas-report."
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"command": "withdraw-bridge",
|
|
49
|
+
"description": "Withdraw canonical tokens from the shared bridge vault.",
|
|
50
|
+
"transactions": [
|
|
51
|
+
{
|
|
52
|
+
"label": "claimToWallet",
|
|
53
|
+
"contract": "L1TokenVault",
|
|
54
|
+
"function": "claimToWallet",
|
|
55
|
+
"gasUsed": 33824,
|
|
56
|
+
"source": "forge-gas-report",
|
|
57
|
+
"sourceDetail": "L1TokenVault.claimToWallet from forge test --root bridge --gas-report."
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"command": "join-channel",
|
|
63
|
+
"description": "Pay the channel join toll and register a wallet identity.",
|
|
64
|
+
"transactions": [
|
|
65
|
+
{
|
|
66
|
+
"label": "approve",
|
|
67
|
+
"contract": "MockERC20",
|
|
68
|
+
"function": "approve",
|
|
69
|
+
"gasUsed": 45729,
|
|
70
|
+
"source": "cast-local-measurement",
|
|
71
|
+
"sourceDetail": "Measured on local anvil by deploying bridge/src/mocks/MockERC20.sol and sending approve(address,uint256). join-channel sends this approval only when the channel join toll is nonzero."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"label": "joinChannel",
|
|
75
|
+
"contract": "L1TokenVault",
|
|
76
|
+
"function": "joinChannel",
|
|
77
|
+
"gasUsed": 341775,
|
|
78
|
+
"source": "forge-gas-report",
|
|
79
|
+
"sourceDetail": "L1TokenVault.joinChannel max successful path from forge test --root bridge --gas-report."
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"command": "deposit-channel",
|
|
85
|
+
"description": "Move bridged funds into the channel L2 accounting vault.",
|
|
86
|
+
"transactions": [
|
|
87
|
+
{
|
|
88
|
+
"label": "depositToChannelVault",
|
|
89
|
+
"contract": "L1TokenVault",
|
|
90
|
+
"function": "depositToChannelVault",
|
|
91
|
+
"gasUsed": 336496,
|
|
92
|
+
"gasUsedMin": 336464,
|
|
93
|
+
"gasUsedMax": 336496,
|
|
94
|
+
"source": "cli-e2e-receipts",
|
|
95
|
+
"sourceDetail": "Three completed local CLI e2e deposit-channel receipts from the current worktree."
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"command": "withdraw-channel",
|
|
101
|
+
"description": "Move channel L2 accounting vault funds back into the shared bridge vault.",
|
|
102
|
+
"transactions": [
|
|
103
|
+
{
|
|
104
|
+
"label": "withdrawFromChannelVault",
|
|
105
|
+
"contract": "L1TokenVault",
|
|
106
|
+
"function": "withdrawFromChannelVault",
|
|
107
|
+
"gasUsed": 95861,
|
|
108
|
+
"source": "forge-gas-report",
|
|
109
|
+
"sourceDetail": "L1TokenVault.withdrawFromChannelVault max successful path from forge test --root bridge --gas-report."
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"command": "exit-channel",
|
|
115
|
+
"description": "Exit a channel after the channel balance is zero.",
|
|
116
|
+
"transactions": [
|
|
117
|
+
{
|
|
118
|
+
"label": "exitChannel",
|
|
119
|
+
"contract": "L1TokenVault",
|
|
120
|
+
"function": "exitChannel",
|
|
121
|
+
"gasUsed": 119031,
|
|
122
|
+
"source": "forge-gas-report",
|
|
123
|
+
"sourceDetail": "L1TokenVault.exitChannel max successful path from forge test --root bridge --gas-report."
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"command": "mint-notes",
|
|
129
|
+
"description": "Submit a proof-backed private-state mint transaction.",
|
|
130
|
+
"transactions": [
|
|
131
|
+
{
|
|
132
|
+
"label": "executeChannelTransaction",
|
|
133
|
+
"contract": "ChannelManager",
|
|
134
|
+
"function": "executeChannelTransaction",
|
|
135
|
+
"gasUsed": 861627,
|
|
136
|
+
"source": "cli-e2e-receipt",
|
|
137
|
+
"sourceDetail": "Completed local CLI e2e mint-notes bridge-submit-receipt.json from the current worktree."
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"command": "transfer-notes",
|
|
143
|
+
"description": "Submit a proof-backed private-state transfer transaction.",
|
|
144
|
+
"transactions": [
|
|
145
|
+
{
|
|
146
|
+
"label": "executeChannelTransaction",
|
|
147
|
+
"contract": "ChannelManager",
|
|
148
|
+
"function": "executeChannelTransaction",
|
|
149
|
+
"gasUsed": 861627,
|
|
150
|
+
"source": "cli-e2e-baseline",
|
|
151
|
+
"sourceDetail": "Uses the current successful mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"command": "redeem-notes",
|
|
157
|
+
"description": "Submit a proof-backed private-state redeem transaction.",
|
|
158
|
+
"transactions": [
|
|
159
|
+
{
|
|
160
|
+
"label": "executeChannelTransaction",
|
|
161
|
+
"contract": "ChannelManager",
|
|
162
|
+
"function": "executeChannelTransaction",
|
|
163
|
+
"gasUsed": 861627,
|
|
164
|
+
"source": "cli-e2e-baseline",
|
|
165
|
+
"sourceDetail": "Uses the current successful mint-notes executeChannelTransaction receipt as the shared proof-backed DApp command baseline."
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
@@ -29,6 +29,15 @@ export const PRIVATE_STATE_CLI_FIELD_CATALOG = Object.freeze({
|
|
|
29
29
|
valueLabel: "<NAME>",
|
|
30
30
|
option: "--account",
|
|
31
31
|
},
|
|
32
|
+
txSubmitter: {
|
|
33
|
+
label: "Transaction Submitter",
|
|
34
|
+
type: "text",
|
|
35
|
+
placeholder: "relayer-account",
|
|
36
|
+
valueLabel: "<ACCOUNT>",
|
|
37
|
+
hint: "Optional for proof-backed note commands. Uses a separate local L1 account to submit executeChannelTransaction.",
|
|
38
|
+
option: "--tx-submitter",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
32
41
|
privateKeyFile: {
|
|
33
42
|
label: "Private Key File",
|
|
34
43
|
type: "text",
|
|
@@ -158,6 +167,16 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
158
167
|
fields: [],
|
|
159
168
|
usage: "no options",
|
|
160
169
|
},
|
|
170
|
+
{
|
|
171
|
+
id: "update",
|
|
172
|
+
description: "Check npm registry for the latest private-state CLI package and update global installs when possible.",
|
|
173
|
+
fields: ["json"],
|
|
174
|
+
usage: "optional --json",
|
|
175
|
+
help: [
|
|
176
|
+
"Global npm installs are updated with npm install -g when a newer registry version exists",
|
|
177
|
+
"Repository checkouts and non-global installs print the required update command instead of modifying source files",
|
|
178
|
+
],
|
|
179
|
+
},
|
|
161
180
|
{
|
|
162
181
|
id: "doctor",
|
|
163
182
|
description: "Check private-state CLI package versions, runtime install state, Docker mode, CUDA mode, and deployment artifacts.",
|
|
@@ -176,6 +195,16 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
176
195
|
usage: "optional --network, --channel-name, --account, and --wallet",
|
|
177
196
|
help: ["Does not accept --rpc-url and never writes RPC configuration"],
|
|
178
197
|
},
|
|
198
|
+
{
|
|
199
|
+
id: "transaction-fees",
|
|
200
|
+
description: "Estimate ETH and USD fees for transaction-sending commands from packaged measured gas data and live network fee data.",
|
|
201
|
+
fields: ["network", "rpcUrl", "json"],
|
|
202
|
+
usage: "--network, optional --rpc-url, and optional --json",
|
|
203
|
+
help: [
|
|
204
|
+
"Uses packages/apps/private-state/cli/assets/tx-fees.json as the measured gas source packaged with the CLI",
|
|
205
|
+
"Reads live fee data from the selected network RPC and live ETH/USD from CoinGecko",
|
|
206
|
+
],
|
|
207
|
+
},
|
|
179
208
|
{
|
|
180
209
|
id: "account-import",
|
|
181
210
|
display: "account import",
|
|
@@ -188,7 +217,10 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
188
217
|
description: "Create a bridge channel and initialize its workspace.",
|
|
189
218
|
fields: ["channelName", "joinToll", "network", "account", "rpcUrl"],
|
|
190
219
|
usage: "--channel-name, --join-toll, --network, --account, and optional --rpc-url",
|
|
191
|
-
help: [
|
|
220
|
+
help: [
|
|
221
|
+
"Prints the immutable policy snapshot before sending the transaction",
|
|
222
|
+
"Initializes the local channel workspace by replaying channel logs from channel genesis",
|
|
223
|
+
],
|
|
192
224
|
},
|
|
193
225
|
{
|
|
194
226
|
id: "recover-workspace",
|
|
@@ -197,7 +229,9 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
197
229
|
usage: "--channel-name, --network, optional --from-genesis, and optional --rpc-url",
|
|
198
230
|
help: [
|
|
199
231
|
"By default, resumes RPC log scanning from the workspace recovery index when available",
|
|
232
|
+
"Fails instead of falling back to genesis when no usable recovery index exists",
|
|
200
233
|
"Use --from-genesis to ignore the recovery index and replay logs from channel genesis",
|
|
234
|
+
"Prints RPC log scan progress while rebuilding the workspace",
|
|
201
235
|
],
|
|
202
236
|
},
|
|
203
237
|
{
|
|
@@ -227,11 +261,15 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
227
261
|
{
|
|
228
262
|
id: "recover-wallet",
|
|
229
263
|
description: "Rebuild a recoverable local wallet from on-chain channel state.",
|
|
230
|
-
fields: ["channelName", "network", "account", "rpcUrl"],
|
|
231
|
-
usage: "--channel-name, --network, --account, and optional --rpc-url",
|
|
264
|
+
fields: ["channelName", "network", "account", "fromGenesis", "rpcUrl"],
|
|
265
|
+
usage: "--channel-name, --network, --account, optional --from-genesis, and optional --rpc-url",
|
|
232
266
|
help: [
|
|
233
267
|
"Requires the protected wallet-local secret imported during join-channel to exist at the canonical secret path",
|
|
234
268
|
"Does not create or recover the wallet secret itself",
|
|
269
|
+
"By default, resumes RPC log scanning from the workspace recovery index when available",
|
|
270
|
+
"Fails instead of falling back to genesis when no usable recovery index exists",
|
|
271
|
+
"Use --from-genesis to ignore the recovery index and replay channel logs from channel genesis",
|
|
272
|
+
"Prints RPC log scan progress while rebuilding channel state and received-note state",
|
|
235
273
|
],
|
|
236
274
|
},
|
|
237
275
|
{
|
|
@@ -249,6 +287,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
249
287
|
description: "Check whether a wallet matches the on-chain channel registration.",
|
|
250
288
|
fields: ["wallet", "network"],
|
|
251
289
|
usage: "--wallet and --network",
|
|
290
|
+
help: ["Refreshes channel state through the workspace recovery index before reading registration metadata"],
|
|
252
291
|
},
|
|
253
292
|
{
|
|
254
293
|
id: "get-my-l1-address",
|
|
@@ -280,6 +319,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
280
319
|
description: "Read the current channel L2 accounting balance.",
|
|
281
320
|
fields: ["wallet", "network"],
|
|
282
321
|
usage: "--wallet and --network",
|
|
322
|
+
help: ["Refreshes channel state through the workspace recovery index before reading the L2 accounting balance"],
|
|
283
323
|
},
|
|
284
324
|
{
|
|
285
325
|
id: "exit-channel",
|
|
@@ -290,26 +330,33 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
290
330
|
{
|
|
291
331
|
id: "mint-notes",
|
|
292
332
|
description: "Mint one or two private-state notes from the wallet's channel balance.",
|
|
293
|
-
fields: ["wallet", "network", "amounts"],
|
|
294
|
-
usage: "--wallet, --network, and --
|
|
333
|
+
fields: ["wallet", "network", "amounts", "txSubmitter"],
|
|
334
|
+
usage: "--wallet, --network, --amounts, and optional --tx-submitter",
|
|
335
|
+
help: ["Use --tx-submitter <ACCOUNT> to let a separate local L1 account pay gas for stronger transaction privacy"],
|
|
295
336
|
},
|
|
296
337
|
{
|
|
297
338
|
id: "transfer-notes",
|
|
298
339
|
description: "Spend input notes into the registered 1->1, 1->2, or 2->1 private transfer shapes.",
|
|
299
|
-
fields: ["wallet", "network", "noteIds", "recipients", "amounts"],
|
|
300
|
-
usage: "--wallet, --network, --note-ids, --recipients, and --
|
|
340
|
+
fields: ["wallet", "network", "noteIds", "recipients", "amounts", "txSubmitter"],
|
|
341
|
+
usage: "--wallet, --network, --note-ids, --recipients, --amounts, and optional --tx-submitter",
|
|
342
|
+
help: ["Use --tx-submitter <ACCOUNT> to let a separate local L1 account pay gas for stronger transaction privacy"],
|
|
301
343
|
},
|
|
302
344
|
{
|
|
303
345
|
id: "redeem-notes",
|
|
304
346
|
description: "Redeem one tracked note back into the wallet's channel balance.",
|
|
305
|
-
fields: ["wallet", "network", "noteIds"],
|
|
306
|
-
usage: "--wallet, --network, and --
|
|
347
|
+
fields: ["wallet", "network", "noteIds", "txSubmitter"],
|
|
348
|
+
usage: "--wallet, --network, --note-ids, and optional --tx-submitter",
|
|
349
|
+
help: ["Use --tx-submitter <ACCOUNT> to let a separate local L1 account pay gas for stronger transaction privacy"],
|
|
307
350
|
},
|
|
308
351
|
{
|
|
309
352
|
id: "get-my-notes",
|
|
310
353
|
description: "Show the wallet's tracked note state and refresh received notes.",
|
|
311
354
|
fields: ["wallet", "network"],
|
|
312
355
|
usage: "--wallet and --network",
|
|
356
|
+
help: [
|
|
357
|
+
"Refreshes channel state through the workspace recovery index before reading notes",
|
|
358
|
+
"Refreshes received-note logs through the wallet note recovery index",
|
|
359
|
+
],
|
|
313
360
|
},
|
|
314
361
|
]);
|
|
315
362
|
|
|
@@ -1300,9 +1300,11 @@ export {
|
|
|
1300
1300
|
installGroth16RuntimeForPrivateState,
|
|
1301
1301
|
installPrivateStateCliArtifacts,
|
|
1302
1302
|
writePrivateStateCliInstallManifest,
|
|
1303
|
+
parseJsonReport,
|
|
1303
1304
|
resolveArtifactCacheBaseRoot,
|
|
1304
1305
|
privateStateCliArtifactPaths,
|
|
1305
1306
|
inspectGroth16Runtime,
|
|
1307
|
+
stripAnsi,
|
|
1306
1308
|
resolveActiveGroth16ProverRuntime,
|
|
1307
1309
|
resolveActiveTokamakCliInvocation,
|
|
1308
1310
|
readTokamakCliPackageReport,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokamak-private-dapps/private-state-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Command-line client for the Tokamak private-state DApp.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Tokamak Network",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"LICENSE",
|
|
31
31
|
"private-state-bridge-cli.mjs",
|
|
32
32
|
"cli-assistant.html",
|
|
33
|
+
"assets",
|
|
33
34
|
"lib"
|
|
34
35
|
],
|
|
35
36
|
"scripts": {
|