@tokamak-private-dapps/private-state-cli 2.1.2 → 2.2.0
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 +10 -0
- package/README.md +46 -16
- package/commands/account.mjs +3 -7
- package/commands/channel.mjs +7 -15
- package/commands/notes.mjs +4 -9
- package/commands/wallet.mjs +5 -11
- package/lib/private-state-cli-command-registry.mjs +40 -7
- package/lib/private-state-runtime-management.mjs +294 -25
- package/lib/runtime.mjs +104 -63
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.2.0 - 2026-05-18
|
|
6
|
+
|
|
7
|
+
- Added `install --read-only` for channel-state read commands and commands that do not depend on channel state. This
|
|
8
|
+
mode installs only the bridge deployment, bridge ABI manifest, DApp deployment, and storage layout artifacts.
|
|
9
|
+
- Kept default `install` as full mode for proof-backed and channel-mutating commands, and made deployment artifact
|
|
10
|
+
validation mode-aware before command execution.
|
|
11
|
+
- Extended `help doctor` with per-command availability so read-only installs clearly report which commands are usable
|
|
12
|
+
and which commands still require full install.
|
|
13
|
+
- Added private-state CLI E2E coverage for the read-only install mode before the full install flow.
|
|
14
|
+
|
|
5
15
|
## 2.1.2 - 2026-05-15
|
|
6
16
|
|
|
7
17
|
- Fixed wallet lifecycle recovery log lookups so account-specific registration and exit event scans
|
package/README.md
CHANGED
|
@@ -4,16 +4,16 @@ Command-line client for the Tokamak private-state DApp.
|
|
|
4
4
|
|
|
5
5
|
The full private-state DApp documentation is published with the repository:
|
|
6
6
|
|
|
7
|
-
- https://github.com/tokamak-network/Tokamak-zk-EVM-contracts/tree/main/
|
|
7
|
+
- https://github.com/tokamak-network/Tokamak-zk-EVM-contracts/tree/main/docs/dapps/private-state
|
|
8
8
|
|
|
9
|
-
## Terminology And
|
|
9
|
+
## Terminology And Exchange Boundary
|
|
10
10
|
|
|
11
11
|
This npm README uses the same terminology as the repository README:
|
|
12
12
|
|
|
13
13
|
- `Tokamak Private App Channels`: Ethereum-settled, validity-proven execution domains for bridge-coupled DApps.
|
|
14
14
|
- `private-state DApp`: the current reference DApp that programs confidential application state inside a channel.
|
|
15
15
|
- `canonical Tokamak Network Token`: the L1 asset whose custody remains anchored on Ethereum.
|
|
16
|
-
- `self-custody L1 wallet`: a user-controlled L1 account, not
|
|
16
|
+
- `self-custody L1 wallet`: a user-controlled L1 account, not an exchange deposit address.
|
|
17
17
|
- `L1-transparent bridge edge`: public bridge deposit and withdrawal transactions involving the canonical token.
|
|
18
18
|
- `channel-local accounting balance`: liquid application balance inside a channel before or after note use.
|
|
19
19
|
- `private-state note`: a channel-local application note, not an exchange-supported token or deposit asset.
|
|
@@ -22,10 +22,20 @@ This npm README uses the same terminology as the repository README:
|
|
|
22
22
|
- `viewing key`: the note-receive private key used to decrypt note-delivery events for the registered note-receive public key.
|
|
23
23
|
- `spending key`: the channel-bound L2 private key used to authorize proof-backed note use.
|
|
24
24
|
|
|
25
|
-
Tokamak Private App Channels are not
|
|
25
|
+
Tokamak Private App Channels are not an exchange deposit network. Exchange-facing token transfers and bridge
|
|
26
26
|
entry or exit remain public L1 activity. Internal private-state note counterparty relationships and note provenance are
|
|
27
27
|
not public by default and are not reconstructed by Tokamak on a user's behalf.
|
|
28
28
|
|
|
29
|
+
## Address And Key-Safety Warnings
|
|
30
|
+
|
|
31
|
+
Do not use an exchange deposit address as a private-state wallet address. Private-state notes are not
|
|
32
|
+
supported exchange assets. Always withdraw TON to a self-custody L1 wallet before using a channel.
|
|
33
|
+
|
|
34
|
+
Bridge deposits and withdrawals are public L1 events. Internal note transfers are private by design and are not
|
|
35
|
+
automatically reconstructible by Tokamak, exchanges, or public observers.
|
|
36
|
+
|
|
37
|
+
This CLI does not send your spending key, wallet secret, or private note plaintext to Tokamak.
|
|
38
|
+
|
|
29
39
|
## Tokamak-Operated Mainnet Channels
|
|
30
40
|
|
|
31
41
|
The table below lists private-state mainnet channels directly opened by Tokamak Network. Dates are
|
|
@@ -41,8 +51,8 @@ UTC.
|
|
|
41
51
|
npm install -g @tokamak-private-dapps/private-state-cli
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
Install the local Tokamak zk-EVM runtime workspace, Groth16 runtime workspace, and public private-state deployment
|
|
45
|
-
artifacts:
|
|
54
|
+
Install the full local Tokamak zk-EVM runtime workspace, Groth16 runtime workspace, and public private-state deployment
|
|
55
|
+
artifacts needed by transaction-sending channel commands:
|
|
46
56
|
|
|
47
57
|
```bash
|
|
48
58
|
private-state-cli install
|
|
@@ -61,6 +71,18 @@ selected Groth16 CLI package version.
|
|
|
61
71
|
The Tokamak zk-EVM installer requires the selected CLI package to declare
|
|
62
72
|
`tokamakZkEvm.compatibleBackendVersion` as a canonical major.minor version matching the selected package version.
|
|
63
73
|
|
|
74
|
+
For read-only channel recovery, channel metadata lookup, wallet recovery, wallet metadata lookup, bridge balance
|
|
75
|
+
lookup, bridge deposit, bridge withdrawal, and local helper commands, install only the read-only artifact subset:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
private-state-cli install --read-only
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Read-only install materializes only `bridge.<chainId>.json`, `bridge-abi-manifest.<chainId>.json`,
|
|
82
|
+
`deployment.<chainId>.latest.json`, and `storage-layout.<chainId>.latest.json`. It does not install the Tokamak
|
|
83
|
+
zk-EVM runtime, Groth16 runtime, Groth16 zkey, callable DApp ABI, or DApp registration artifact, so commands that
|
|
84
|
+
create or mutate channel state require a later full `private-state-cli install`.
|
|
85
|
+
|
|
64
86
|
`install` downloads public deployment artifacts from the configured artifact index. It does not read repository-local
|
|
65
87
|
`deployment/` outputs by default. Repository development workflows that need local anvil artifacts can opt in explicitly:
|
|
66
88
|
|
|
@@ -147,8 +169,8 @@ Static warning scope:
|
|
|
147
169
|
| `wallet redeem-notes` | L1 submitter, input nullifier, accounting update, root update | Consumes notes | Prior path by which the note was received |
|
|
148
170
|
| `wallet withdraw-channel` | L1 submitter, registered L2 address, amount, channel id, accounting update | No direct note spend | Prior private-state note path behind the liquid balance |
|
|
149
171
|
|
|
150
|
-
`account deposit-bridge` and `account withdraw-bridge` also print
|
|
151
|
-
|
|
172
|
+
`account deposit-bridge` and `account withdraw-bridge` also print an exchange-controlled address warning. Do not use an
|
|
173
|
+
exchange-controlled address as a self-custody bridge source or as the direct bridge withdrawal target
|
|
152
174
|
unless the user explicitly understands the compliance implications. Prefer a self-custody L1 wallet.
|
|
153
175
|
|
|
154
176
|
Workspace recovery commands use saved recovery indexes by default. If the local channel workspace is missing,
|
|
@@ -208,7 +230,7 @@ already exists. The channel leader can build the static mirror files with
|
|
|
208
230
|
host. If the existing mirror manifest is unreadable or invalid, the leader can use
|
|
209
231
|
`channel publish-workspace-mirror --force` to write a full checkpoint without trusting that remote
|
|
210
232
|
manifest as a delta base. The CLI protocol is documented at
|
|
211
|
-
https://github.com/tokamak-network/Tokamak-zk-EVM-contracts/blob/main/
|
|
233
|
+
https://github.com/tokamak-network/Tokamak-zk-EVM-contracts/blob/main/docs/dapps/private-state/channel-workspace-mirror-protocol.md.
|
|
212
234
|
|
|
213
235
|
Back up a local wallet with:
|
|
214
236
|
|
|
@@ -309,9 +331,11 @@ Channel policy warning:
|
|
|
309
331
|
a new channel; it does not rewrite the policy of an already-created channel.
|
|
310
332
|
|
|
311
333
|
`private-state-cli help doctor` reports the CLI package version, dependency versions recorded by the last
|
|
312
|
-
`private-state-cli install`, selected proof backend runtime versions
|
|
313
|
-
install mode, Docker mode, CUDA runtime metadata, live
|
|
314
|
-
|
|
334
|
+
`private-state-cli install`, selected proof backend runtime versions when full mode was installed, current dependency
|
|
335
|
+
versions through `tokamak-l2js`, Tokamak zk-EVM runtime install mode, Docker mode, CUDA runtime metadata, live
|
|
336
|
+
`nvidia-smi` and Docker GPU probe results, Groth16 runtime health, deployment artifact readiness, and per-command
|
|
337
|
+
availability. In read-only install mode, proof runtime checks are skipped and proof-backed or channel-mutating
|
|
338
|
+
commands are reported unavailable until full install is completed.
|
|
315
339
|
|
|
316
340
|
Local helper commands:
|
|
317
341
|
|
|
@@ -561,8 +585,9 @@ command.
|
|
|
561
585
|
|
|
562
586
|
## Artifacts
|
|
563
587
|
|
|
564
|
-
Proof-backed commands require installed bridge, DApp, and Groth16 artifacts. Run
|
|
565
|
-
|
|
588
|
+
Proof-backed and channel-mutating commands require full installed bridge, DApp, and Groth16 artifacts. Run
|
|
589
|
+
`private-state-cli install` before creating, joining, exiting, or mutating channels on a new machine. Channel-state read
|
|
590
|
+
commands and commands unrelated to channel state can run after `private-state-cli install --read-only`.
|
|
566
591
|
|
|
567
592
|
Channel balance commands such as `wallet deposit-channel` and `wallet withdraw-channel` use the installed Groth16 runtime workspace
|
|
568
593
|
directly. Proof generation writes to the fixed workspace paths under `~/tokamak-private-channels/groth16/proof`; the CLI
|
|
@@ -579,11 +604,16 @@ Release order matters for npm publication. `@tokamak-private-dapps/common-librar
|
|
|
579
604
|
|
|
580
605
|
It installs the `private-state-cli` terminal command and the local files needed by that command.
|
|
581
606
|
It does not install bridge contracts, app contracts, or local deployment outputs. The `private-state-cli install`
|
|
582
|
-
command provisions
|
|
607
|
+
command defaults to full mode, which provisions local Tokamak zk-EVM and Groth16 runtime workspaces used by
|
|
608
|
+
proof-backed commands. `private-state-cli install --read-only` installs only the public bridge and private-state DApp
|
|
609
|
+
artifacts needed by channel-state read commands and commands that do not depend on channel state.
|
|
583
610
|
|
|
584
611
|
### When should I run `private-state-cli install`?
|
|
585
612
|
|
|
586
|
-
Run
|
|
613
|
+
Run full install once on a machine that will create, join, exit, or mutate channels. Run read-only install on a machine
|
|
614
|
+
that only needs channel recovery, wallet recovery, metadata lookup, bridge balance lookup, bridge deposit or withdrawal,
|
|
615
|
+
and local import/export/helper commands. Re-run the relevant mode after public bridge, DApp, Groth16, or Tokamak zk-EVM
|
|
616
|
+
runtime artifacts are updated.
|
|
587
617
|
|
|
588
618
|
### Does this package publish private user data?
|
|
589
619
|
|
package/commands/account.mjs
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
handleDepositBridge,
|
|
11
11
|
handleWithdrawBridge,
|
|
12
12
|
loadExplicitCommandRuntime,
|
|
13
|
-
prepareDeploymentArtifacts,
|
|
14
13
|
} from "../lib/runtime.mjs";
|
|
15
14
|
|
|
16
15
|
export const accountCommands = Object.freeze({
|
|
@@ -24,20 +23,17 @@ export const accountCommands = Object.freeze({
|
|
|
24
23
|
},
|
|
25
24
|
"account-get-bridge-fund": async (args) => {
|
|
26
25
|
assertAccountGetBridgeFundArgs(args);
|
|
27
|
-
const {
|
|
28
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
26
|
+
const { provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
29
27
|
await handleAccountGetBridgeFund({ args, provider });
|
|
30
28
|
},
|
|
31
29
|
"account-deposit-bridge": async (args) => {
|
|
32
30
|
assertDepositBridgeArgs(args);
|
|
33
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
34
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
31
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
35
32
|
await handleDepositBridge({ args, network, provider });
|
|
36
33
|
},
|
|
37
34
|
"account-withdraw-bridge": async (args) => {
|
|
38
35
|
assertWithdrawBridgeArgs(args);
|
|
39
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
40
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
36
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
41
37
|
await handleWithdrawBridge({ args, network, provider });
|
|
42
38
|
},
|
|
43
39
|
});
|
package/commands/channel.mjs
CHANGED
|
@@ -16,51 +16,43 @@ import {
|
|
|
16
16
|
handleWorkspaceInit,
|
|
17
17
|
loadExplicitCommandRuntime,
|
|
18
18
|
loadWalletCommandRuntime,
|
|
19
|
-
prepareDeploymentArtifacts,
|
|
20
19
|
} from "../lib/runtime.mjs";
|
|
21
20
|
|
|
22
21
|
export const channelCommands = Object.freeze({
|
|
23
22
|
"channel-create": async (args) => {
|
|
24
23
|
assertCreateChannelArgs(args);
|
|
25
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
26
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
24
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
27
25
|
await handleChannelCreate({ args, network, provider });
|
|
28
26
|
},
|
|
29
27
|
"channel-recover-workspace": async (args) => {
|
|
30
28
|
assertRecoverWorkspaceArgs(args);
|
|
31
|
-
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true });
|
|
29
|
+
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
32
30
|
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
33
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
34
31
|
await handleWorkspaceInit({ args, network, provider });
|
|
35
32
|
},
|
|
36
33
|
"channel-get-meta": async (args) => {
|
|
37
34
|
assertGetChannelArgs(args);
|
|
38
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
39
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
35
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
40
36
|
await handleGetChannel({ args, network, provider });
|
|
41
37
|
},
|
|
42
38
|
"channel-set-workspace-mirror": async (args) => {
|
|
43
39
|
assertSetWorkspaceMirrorArgs(args);
|
|
44
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
45
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
40
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
46
41
|
await handleSetChannelWorkspaceMirror({ args, network, provider });
|
|
47
42
|
},
|
|
48
43
|
"channel-publish-workspace-mirror": async (args) => {
|
|
49
44
|
assertPublishWorkspaceMirrorArgs(args);
|
|
50
|
-
const { network, provider } = loadExplicitCommandRuntime(args);
|
|
51
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
45
|
+
const { network, provider } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
52
46
|
await handlePublishChannelWorkspaceMirror({ args, network, provider });
|
|
53
47
|
},
|
|
54
48
|
"channel-join": async (args) => {
|
|
55
49
|
assertJoinChannelArgs(args);
|
|
56
|
-
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args);
|
|
57
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
50
|
+
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { prepareArtifacts: true });
|
|
58
51
|
await handleJoinChannel({ args, network, provider, rpcUrl });
|
|
59
52
|
},
|
|
60
53
|
"channel-exit": async (args) => {
|
|
61
54
|
assertExitChannelArgs(args);
|
|
62
|
-
const {
|
|
63
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
55
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
64
56
|
await handleExitChannel({ args, provider });
|
|
65
57
|
},
|
|
66
58
|
});
|
package/commands/notes.mjs
CHANGED
|
@@ -8,32 +8,27 @@ import {
|
|
|
8
8
|
handleTransferNotes,
|
|
9
9
|
handleWalletGetNotes,
|
|
10
10
|
loadWalletCommandRuntime,
|
|
11
|
-
prepareDeploymentArtifacts,
|
|
12
11
|
} from "../lib/runtime.mjs";
|
|
13
12
|
|
|
14
13
|
export const notesCommands = Object.freeze({
|
|
15
14
|
"wallet-mint-notes": async (args) => {
|
|
16
15
|
assertMintNotesArgs(args);
|
|
17
|
-
const {
|
|
18
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
16
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
19
17
|
await handleMintNotes({ args, provider });
|
|
20
18
|
},
|
|
21
19
|
"wallet-redeem-notes": async (args) => {
|
|
22
20
|
assertRedeemNotesArgs(args);
|
|
23
|
-
const {
|
|
24
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
21
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
25
22
|
await handleRedeemNotes({ args, provider });
|
|
26
23
|
},
|
|
27
24
|
"wallet-get-notes": async (args) => {
|
|
28
25
|
assertWalletGetNotesArgs(args);
|
|
29
|
-
const {
|
|
30
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
26
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
31
27
|
await handleWalletGetNotes({ args, provider });
|
|
32
28
|
},
|
|
33
29
|
"wallet-transfer-notes": async (args) => {
|
|
34
30
|
assertTransferNotesArgs(args);
|
|
35
|
-
const {
|
|
36
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
31
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
37
32
|
await handleTransferNotes({ args, provider });
|
|
38
33
|
},
|
|
39
34
|
});
|
package/commands/wallet.mjs
CHANGED
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
handleWalletImportKey,
|
|
21
21
|
loadExplicitCommandRuntime,
|
|
22
22
|
loadWalletCommandRuntime,
|
|
23
|
-
prepareDeploymentArtifacts,
|
|
24
23
|
} from "../lib/runtime.mjs";
|
|
25
24
|
|
|
26
25
|
export const walletCommands = Object.freeze({
|
|
@@ -54,33 +53,28 @@ export const walletCommands = Object.freeze({
|
|
|
54
53
|
},
|
|
55
54
|
"wallet-recover-workspace": async (args) => {
|
|
56
55
|
assertRecoverWalletArgs(args);
|
|
57
|
-
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true });
|
|
56
|
+
const { network, provider, rpcUrl } = loadExplicitCommandRuntime(args, { staticNetwork: true, prepareArtifacts: true });
|
|
58
57
|
await assertProviderChainIdMatchesNetwork({ provider, network, rpcUrl });
|
|
59
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
60
58
|
await handleRecoverWallet({ args, network, provider, rpcUrl });
|
|
61
59
|
},
|
|
62
60
|
"wallet-get-meta": async (args) => {
|
|
63
61
|
assertWalletGetMetaArgs(args);
|
|
64
|
-
const {
|
|
65
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
62
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
66
63
|
await handleWalletGetMeta({ args, provider });
|
|
67
64
|
},
|
|
68
65
|
"wallet-get-channel-fund": async (args) => {
|
|
69
66
|
assertWalletGetChannelFundArgs(args);
|
|
70
|
-
const {
|
|
71
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
67
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
72
68
|
await handleWalletGetChannelFund({ args, provider });
|
|
73
69
|
},
|
|
74
70
|
"wallet-deposit-channel": async (args) => {
|
|
75
71
|
assertWalletChannelMoveArgs(args, "wallet-deposit-channel");
|
|
76
|
-
const {
|
|
77
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
72
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
78
73
|
await handleGrothVaultMove({ args, provider, direction: "deposit" });
|
|
79
74
|
},
|
|
80
75
|
"wallet-withdraw-channel": async (args) => {
|
|
81
76
|
assertWalletChannelMoveArgs(args, "wallet-withdraw-channel");
|
|
82
|
-
const {
|
|
83
|
-
await prepareDeploymentArtifacts(network.chainId);
|
|
77
|
+
const { provider } = loadWalletCommandRuntime(args, { prepareArtifacts: true });
|
|
84
78
|
await handleGrothVaultMove({ args, provider, direction: "withdraw" });
|
|
85
79
|
},
|
|
86
80
|
});
|
|
@@ -188,6 +188,13 @@ export const PRIVATE_STATE_CLI_FIELD_CATALOG = Object.freeze({
|
|
|
188
188
|
valueLabel: "<VERSION>",
|
|
189
189
|
optional: true,
|
|
190
190
|
},
|
|
191
|
+
readOnly: {
|
|
192
|
+
label: "Read-Only Install",
|
|
193
|
+
type: "checkbox",
|
|
194
|
+
hint: "Install only artifacts needed by channel-state read commands and commands that do not depend on channel state.",
|
|
195
|
+
option: "--read-only",
|
|
196
|
+
optional: true,
|
|
197
|
+
},
|
|
191
198
|
fromGenesis: {
|
|
192
199
|
label: "Scan From Genesis",
|
|
193
200
|
type: "checkbox",
|
|
@@ -239,7 +246,7 @@ const ACTION_IMPACT_HELP = Object.freeze({
|
|
|
239
246
|
acknowledgement: "Requires --acknowledge-action-impact after the user reviews the action-impact warning.",
|
|
240
247
|
illegalUse: "The command must not be used for money laundering, sanctions evasion, terrorist financing, illegal gambling, criminal-proceeds concealment, or regulatory evasion.",
|
|
241
248
|
secretRecovery: "Losing wallet secrets, viewing keys, or spending keys can prevent note discovery or note use; the CLI cannot recover lost secrets.",
|
|
242
|
-
|
|
249
|
+
exchangeControlledAddress: "Do not use an exchange-controlled address as a self-custody bridge source or direct bridge withdrawal target.",
|
|
243
250
|
policy: "The user must review the channel policy snapshot before accepting channel-bound actions.",
|
|
244
251
|
provenance: "Public observers cannot reconstruct private note counterparty relationships or note provenance from public contract state alone.",
|
|
245
252
|
});
|
|
@@ -247,10 +254,12 @@ const ACTION_IMPACT_HELP = Object.freeze({
|
|
|
247
254
|
export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
248
255
|
{
|
|
249
256
|
id: "install",
|
|
250
|
-
description: "Install
|
|
251
|
-
fields: ["docker", "includeLocalArtifacts", "groth16CliVersion", "tokamakZkEvmCliVersion"],
|
|
252
|
-
usage: "optional --docker, --include-local-artifacts, --groth16-cli-version, and --tokamak-zk-evm-cli-version",
|
|
257
|
+
description: "Install private-state CLI runtime artifacts in full or read-only mode.",
|
|
258
|
+
fields: ["readOnly", "docker", "includeLocalArtifacts", "groth16CliVersion", "tokamakZkEvmCliVersion"],
|
|
259
|
+
usage: "optional --read-only, --docker, --include-local-artifacts, --groth16-cli-version, and --tokamak-zk-evm-cli-version",
|
|
253
260
|
help: [
|
|
261
|
+
"Default full mode installs proof runtimes and all deployment artifacts needed by transaction-sending commands",
|
|
262
|
+
"--read-only installs only artifacts needed by channel-state read commands and commands unrelated to channel state",
|
|
254
263
|
"Version options install exact CLI package versions; omitted versions resolve to npm registry latest",
|
|
255
264
|
"Use --docker on Linux to forward Docker mode to the Tokamak zk-EVM and Groth16 runtimes",
|
|
256
265
|
"Use --include-local-artifacts to also install local deployment/ artifacts from the current working directory",
|
|
@@ -295,11 +304,12 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
295
304
|
{
|
|
296
305
|
id: "help-doctor",
|
|
297
306
|
display: "help doctor",
|
|
298
|
-
description: "Check private-state CLI package versions,
|
|
307
|
+
description: "Check private-state CLI package versions, install state, deployment artifacts, and command availability.",
|
|
299
308
|
fields: ["gpu", "json"],
|
|
300
309
|
usage: "optional --gpu and optional --json",
|
|
301
310
|
help: [
|
|
302
311
|
"Prints a concise human-readable table by default; use --json for the full machine-readable report",
|
|
312
|
+
"Reports whether each command is usable with the current read-only or full install state",
|
|
303
313
|
"Use --gpu to run live NVIDIA/Docker GPU probes",
|
|
304
314
|
],
|
|
305
315
|
},
|
|
@@ -352,6 +362,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
352
362
|
id: "account-get-bridge-fund",
|
|
353
363
|
display: "account get-bridge-fund",
|
|
354
364
|
description: "Read the local account's current shared bridge vault balance.",
|
|
365
|
+
installMode: "read-only",
|
|
355
366
|
fields: ["network", "account"],
|
|
356
367
|
usage: "--network, --account",
|
|
357
368
|
},
|
|
@@ -359,6 +370,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
359
370
|
id: "channel-create",
|
|
360
371
|
display: "channel create",
|
|
361
372
|
description: "Create a bridge channel and initialize its workspace.",
|
|
373
|
+
installMode: "full",
|
|
362
374
|
fields: ["channelName", "joinToll", "network", "account"],
|
|
363
375
|
usage: "--channel-name, --join-toll, --network, --account",
|
|
364
376
|
help: [
|
|
@@ -370,6 +382,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
370
382
|
id: "channel-recover-workspace",
|
|
371
383
|
display: "channel recover-workspace",
|
|
372
384
|
description: "Rebuild the local channel workspace from bridge state.",
|
|
385
|
+
installMode: "read-only",
|
|
373
386
|
fields: ["channelName", "network", "source", "fromGenesis"],
|
|
374
387
|
usage: "--channel-name, --network, optional --source, optional --from-genesis",
|
|
375
388
|
help: [
|
|
@@ -387,6 +400,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
387
400
|
id: "channel-set-workspace-mirror",
|
|
388
401
|
display: "channel set-workspace-mirror",
|
|
389
402
|
description: "Register or update the channel leader's workspace mirror base URL.",
|
|
403
|
+
installMode: "full",
|
|
390
404
|
fields: ["channelName", "network", "account", "url"],
|
|
391
405
|
usage: "--channel-name, --network, --account, --url",
|
|
392
406
|
help: [
|
|
@@ -398,6 +412,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
398
412
|
id: "channel-publish-workspace-mirror",
|
|
399
413
|
display: "channel publish-workspace-mirror",
|
|
400
414
|
description: "Build static workspace mirror files for the registered mirror URL.",
|
|
415
|
+
installMode: "read-only",
|
|
401
416
|
fields: ["channelName", "network", "account", "output", "force"],
|
|
402
417
|
usage: "--channel-name, --network, --account, --output, optional --force",
|
|
403
418
|
help: [
|
|
@@ -411,6 +426,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
411
426
|
id: "channel-get-meta",
|
|
412
427
|
display: "channel get-meta",
|
|
413
428
|
description: "Read channel existence, manager, vault, toll, refund schedule, and immutable policy snapshot.",
|
|
429
|
+
installMode: "read-only",
|
|
414
430
|
fields: ["channelName", "network"],
|
|
415
431
|
usage: "--channel-name, --network",
|
|
416
432
|
},
|
|
@@ -418,12 +434,13 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
418
434
|
id: "account-deposit-bridge",
|
|
419
435
|
display: "account deposit-bridge",
|
|
420
436
|
description: "Deposit canonical tokens into the shared bridge vault.",
|
|
437
|
+
installMode: "read-only",
|
|
421
438
|
fields: ["amount", "network", "account", "acknowledgeActionImpact"],
|
|
422
439
|
usage: "--amount, --network, --account, --acknowledge-action-impact",
|
|
423
440
|
help: [
|
|
424
441
|
"Action impact: emits public L1 approval and bridge funding events that expose the local L1 account, bridge vault, amount, and transaction hashes.",
|
|
425
442
|
"Private note state is not changed by this command.",
|
|
426
|
-
ACTION_IMPACT_HELP.
|
|
443
|
+
ACTION_IMPACT_HELP.exchangeControlledAddress,
|
|
427
444
|
ACTION_IMPACT_HELP.illegalUse,
|
|
428
445
|
ACTION_IMPACT_HELP.acknowledgement,
|
|
429
446
|
],
|
|
@@ -432,12 +449,13 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
432
449
|
id: "account-withdraw-bridge",
|
|
433
450
|
display: "account withdraw-bridge",
|
|
434
451
|
description: "Withdraw tokens from the shared bridge vault back to the wallet.",
|
|
452
|
+
installMode: "read-only",
|
|
435
453
|
fields: ["amount", "network", "account", "acknowledgeActionImpact"],
|
|
436
454
|
usage: "--amount, --network, --account, --acknowledge-action-impact",
|
|
437
455
|
help: [
|
|
438
456
|
"Action impact: emits a public L1 bridge withdrawal event that exposes the local L1 recipient, bridge vault, amount, and transaction hash.",
|
|
439
457
|
"Private note state is not changed by this command; prior note provenance is not public by default.",
|
|
440
|
-
ACTION_IMPACT_HELP.
|
|
458
|
+
ACTION_IMPACT_HELP.exchangeControlledAddress,
|
|
441
459
|
ACTION_IMPACT_HELP.illegalUse,
|
|
442
460
|
ACTION_IMPACT_HELP.acknowledgement,
|
|
443
461
|
],
|
|
@@ -446,6 +464,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
446
464
|
id: "wallet-recover-workspace",
|
|
447
465
|
display: "wallet recover-workspace",
|
|
448
466
|
description: "Rebuild a recoverable local wallet from on-chain channel state.",
|
|
467
|
+
installMode: "read-only",
|
|
449
468
|
fields: ["channelName", "network", "account", "fromGenesis"],
|
|
450
469
|
usage: "--channel-name, --network, --account, optional --from-genesis",
|
|
451
470
|
help: [
|
|
@@ -462,6 +481,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
462
481
|
id: "channel-join",
|
|
463
482
|
display: "channel join",
|
|
464
483
|
description: "Pay the channel join toll and bind a wallet to a channel-specific L2 identity.",
|
|
484
|
+
installMode: "full",
|
|
465
485
|
fields: ["channelName", "network", "account", "walletSecretPath", "acknowledgeActionImpact"],
|
|
466
486
|
usage: "--channel-name, --network, --account, --wallet-secret-path, --acknowledge-action-impact",
|
|
467
487
|
help: [
|
|
@@ -481,6 +501,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
481
501
|
id: "wallet-get-meta",
|
|
482
502
|
display: "wallet get-meta",
|
|
483
503
|
description: "Check whether a wallet matches the on-chain channel registration.",
|
|
504
|
+
installMode: "read-only",
|
|
484
505
|
fields: ["wallet", "network"],
|
|
485
506
|
usage: "--wallet and --network",
|
|
486
507
|
help: [
|
|
@@ -550,6 +571,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
550
571
|
id: "wallet-deposit-channel",
|
|
551
572
|
display: "wallet deposit-channel",
|
|
552
573
|
description: "Move bridged funds into the channel L2 accounting balance.",
|
|
574
|
+
installMode: "full",
|
|
553
575
|
fields: ["wallet", "network", "amount", "acknowledgeActionImpact"],
|
|
554
576
|
usage: "--wallet, --network, --amount, and --acknowledge-action-impact",
|
|
555
577
|
help: [
|
|
@@ -566,6 +588,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
566
588
|
id: "wallet-withdraw-channel",
|
|
567
589
|
display: "wallet withdraw-channel",
|
|
568
590
|
description: "Move channel L2 balance back into the shared bridge vault.",
|
|
591
|
+
installMode: "full",
|
|
569
592
|
fields: ["wallet", "network", "amount", "acknowledgeActionImpact"],
|
|
570
593
|
usage: "--wallet, --network, --amount, and --acknowledge-action-impact",
|
|
571
594
|
help: [
|
|
@@ -583,6 +606,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
583
606
|
id: "wallet-get-channel-fund",
|
|
584
607
|
display: "wallet get-channel-fund",
|
|
585
608
|
description: "Read the current channel L2 accounting balance.",
|
|
609
|
+
installMode: "read-only",
|
|
586
610
|
fields: ["wallet", "network"],
|
|
587
611
|
usage: "--wallet and --network",
|
|
588
612
|
help: ["Refreshes the local channel workspace through the saved recovery index before reading the L2 accounting balance when the scan fits the 10 second pre-command budget"],
|
|
@@ -591,6 +615,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
591
615
|
id: "channel-exit",
|
|
592
616
|
display: "channel exit",
|
|
593
617
|
description: "Exit a channel. Both the CLI and bridge contract require a zero channel balance.",
|
|
618
|
+
installMode: "full",
|
|
594
619
|
fields: ["wallet", "network"],
|
|
595
620
|
usage: "--wallet and --network",
|
|
596
621
|
help: [
|
|
@@ -602,6 +627,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
602
627
|
id: "wallet-mint-notes",
|
|
603
628
|
display: "wallet mint-notes",
|
|
604
629
|
description: "Mint one or two private-state notes from the wallet's channel balance.",
|
|
630
|
+
installMode: "full",
|
|
605
631
|
fields: ["wallet", "network", "amounts", "acknowledgeActionImpact", "txSubmitter"],
|
|
606
632
|
usage: "--wallet, --network, --amounts, --acknowledge-action-impact, and optional --tx-submitter",
|
|
607
633
|
help: [
|
|
@@ -621,6 +647,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
621
647
|
id: "wallet-transfer-notes",
|
|
622
648
|
display: "wallet transfer-notes",
|
|
623
649
|
description: "Spend input notes into the registered 1->1, 1->2, or 2->1 private transfer shapes.",
|
|
650
|
+
installMode: "full",
|
|
624
651
|
fields: ["wallet", "network", "noteIds", "recipients", "amounts", "acknowledgeActionImpact", "txSubmitter"],
|
|
625
652
|
usage: "--wallet, --network, --note-ids, --recipients, --amounts, --acknowledge-action-impact, and optional --tx-submitter",
|
|
626
653
|
help: [
|
|
@@ -639,6 +666,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
639
666
|
id: "wallet-redeem-notes",
|
|
640
667
|
display: "wallet redeem-notes",
|
|
641
668
|
description: "Redeem one tracked note back into the wallet's channel balance.",
|
|
669
|
+
installMode: "full",
|
|
642
670
|
fields: ["wallet", "network", "noteIds", "acknowledgeActionImpact", "txSubmitter"],
|
|
643
671
|
usage: "--wallet, --network, --note-ids, --acknowledge-action-impact, and optional --tx-submitter",
|
|
644
672
|
help: [
|
|
@@ -657,6 +685,7 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
657
685
|
id: "wallet-get-notes",
|
|
658
686
|
display: "wallet get-notes",
|
|
659
687
|
description: "Refresh received notes when the saved recovery index is recent, then show tracked note state.",
|
|
688
|
+
installMode: "read-only",
|
|
660
689
|
fields: ["wallet", "network", "exportEvidence", "acknowledgeFullNotePlaintextExport"],
|
|
661
690
|
usage: "--wallet, --network, optional --export-evidence, and optional --acknowledge-full-note-plaintext-export",
|
|
662
691
|
help: [
|
|
@@ -669,6 +698,10 @@ export const PRIVATE_STATE_CLI_COMMANDS = Object.freeze([
|
|
|
669
698
|
},
|
|
670
699
|
]);
|
|
671
700
|
|
|
701
|
+
export function privateStateCliCommandInstallMode(command) {
|
|
702
|
+
return command.installMode ?? "none";
|
|
703
|
+
}
|
|
704
|
+
|
|
672
705
|
export function privateStateCliCommandDisplay(command) {
|
|
673
706
|
return command.display ?? command.id;
|
|
674
707
|
}
|