Skip to content

Commit 3e6a5af

Browse files
committed
add dump command doc
1 parent 8bd7386 commit 3e6a5af

File tree

1 file changed

+57
-23
lines changed

1 file changed

+57
-23
lines changed

docs/commands/readme.md

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,26 @@ Currently Available Subcommands:
66

77
- `account`:Account Management
88
- `rpc`:RPC-based subcommands, used for querying blockchain information and sending transactions
9+
- `dump`: Dump eSpace account state at a given block number
910
- `help`:Print help message
1011

1112
```sh
12-
./conflux -h
13-
conflux conflux-rust/v2.4.0-82500ad-20250418/x86_64-linux-gnu/rustc1.77.2
14-
The Conflux Team
15-
Conflux client.
13+
Conflux client
1614

17-
USAGE:
18-
conflux [FLAGS] [OPTIONS] [SUBCOMMAND]
15+
Usage: conflux [OPTIONS] [COMMAND]
1916

20-
FLAGS:
21-
--archive
22-
--full
23-
-h, --help Prints help information
24-
--light
25-
--tg_archive
26-
-V, --version Prints version information
27-
28-
OPTIONS:
29-
-c, --config <FILE> Sets a custom config file.
30-
...
31-
17+
Commands:
18+
account Manage accounts
19+
dump Dump eSpace account state at a given block number
20+
rpc RPC based subcommands to query blockchain information and send transactions
21+
help Print this message or the help of the given subcommand(s)
3222

33-
SUBCOMMANDS:
34-
account Manage accounts
35-
help Prints this message or the help of the given subcommand(s)
36-
rpc RPC based subcommands to query blockchain information and send transactions
23+
Options:
24+
--mode <MODE>
25+
Use the preset testing configurations. dev or test
26+
-p, --port <PORT>
27+
Specify the port for P2P connections
28+
...
3729
```
3830

3931
Each command-line tool comes with its own help information. Users can view the help message by using the -h or --help flag.
@@ -57,4 +49,46 @@ SUBCOMMANDS:
5749
import Import accounts from JSON UTC keystore files to the specified --chain (default conflux)
5850
list List existing accounts of the given --chain (default conflux).
5951
new Create a new account (and its associated key) for the given --chain (default conflux).
60-
```
52+
```
53+
54+
## dump subcommand
55+
56+
This command can be used to export all account states at a certain block height in eSpace to JSON files, facilitating development and debugging. The exported data structure example is as follows
57+
58+
```sh
59+
$ ./conflux --config devnode.toml dump --block 1000 # export state at height 1000
60+
{
61+
"root": "0xdd606752e465cb6a1e2f0df718057536ab00cd66d9c6fa46085309145823d3c0",
62+
"accounts": {
63+
"0x004e322e7ea7e63547d25639d8e8ed282318eec9": {
64+
"balance": "0x152cfd9872b245dcbcae",
65+
"nonce": 210,
66+
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
67+
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
68+
"address": "0x004e322e7ea7e63547d25639d8e8ed282318eec9",
69+
"key": "0x0c1bad9586421be5b0d8eda4446cac4ce7692d67301d07146a87455e7bc9d30e"
70+
},
71+
"0x0c80d6926edc73977dce4c97ff8966abf04fe80e": {
72+
"balance": "0x0",
73+
"nonce": 2,
74+
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
75+
"codeHash": "0xe79d1e04e3004c8d97ad51f5f08cfd1a79e6cdcce2a3a6d59676a9858bccd173",
76+
"code": "0xf90338b903206080604052600436106100385760003.....",
77+
"storage": {
78+
"0x0000000000000000000000000000000000000000000000000000000000000000": "0xc",
79+
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x27e26b9234ec81a0247a6083edf8b329fb1ccde9"
80+
},
81+
"address": "0x0c80d6926edc73977dce4c97ff8966abf04fe80e",
82+
"key": "0x691460d9548cee180ba8cd9f0960fee74fed16501d80cdb3182aa0f41b160e54"
83+
}
84+
}
85+
}
86+
```
87+
88+
Note:
89+
90+
1. Conflux contract data storage differs significantly from Ethereum, as it is not stored in separate MPT form, therefore the storage root cannot be obtained. The exported data's `account.root` is fixed as `0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421`
91+
2. The exported root information is the full state root of Conflux dual-space (Core Space, eSpace), only for maintaining data format consistency, not the state root of all eSpace accounts.
92+
3. When exporting mainnet state data, due to the large number of accounts, high machine configuration is required, and the runtime will be quite long; if you want to export the state at a certain height in history, it needs to be performed on a fullstate node data.
93+
4. When performing state export, please stop the node program first, then execute the export operation in the node directory.
94+
5. Please use the binary corresponding to the network and execute the export operation in the corresponding network data directory; do not use testnet or master code compiled binary to execute export operations on mainnet data.

0 commit comments

Comments
 (0)