Skip to content

Commit 744930f

Browse files
authored
docs: improve CLI reference generator (paradigmxyz#5740)
1 parent 013b4c9 commit 744930f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3482
-3800
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
book/cli/**/*.md linguist-vendored
2+
book/cli/cli.md -linguist-vendored
3+
14
crates/storage/libmdbx-rs/mdbx-sys/** linguist-vendored

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ db-tools: ## Compile MDBX debugging tools.
227227
update-book-cli: ## Update book cli documentation.
228228
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"
229229
@echo "Updating book cli doc..."
230-
@./book/cli/update.sh $(BUILD_PATH)
230+
@./book/cli/update.sh $(BUILD_PATH)/$(PROFILE)/reth
231231

232232
.PHONY: maxperf
233233
maxperf:

book/SUMMARY.md

+67-39
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,69 @@
11
# Reth Book
22

3-
1. [Introduction](./intro.md)
4-
1. [Installation](./installation/installation.md)
5-
1. [Pre-Built Binaries](./installation/binaries.md)
6-
1. [Docker](./installation/docker.md)
7-
1. [Build from Source](./installation/source.md)
8-
1. [Build for ARM devices](./installation/build-for-arm-devices.md)
9-
1. [Update Priorities](./installation/priorities.md)
10-
1. [Run a Node](./run/run-a-node.md)
11-
1. [Mainnet or official testnets](./run/mainnet.md)
12-
1. [OP Stack](./run/optimism.md)
13-
1. [Private testnet](./run/private-testnet.md)
14-
1. [Metrics](./run/observability.md)
15-
1. [Configuring Reth](./run/config.md)
16-
1. [Transaction types](./run/transactions.md)
17-
1. [Pruning & Full Node](./run/pruning.md)
18-
1. [Ports](./run/ports.md)
19-
1. [Troubleshooting](./run/troubleshooting.md)
20-
1. [Interacting with Reth over JSON-RPC](./jsonrpc/intro.md)
21-
1. [eth](./jsonrpc/eth.md)
22-
1. [web3](./jsonrpc/web3.md)
23-
1. [net](./jsonrpc/net.md)
24-
1. [txpool](./jsonrpc/txpool.md)
25-
1. [debug](./jsonrpc/debug.md)
26-
1. [trace](./jsonrpc/trace.md)
27-
1. [admin](./jsonrpc/admin.md)
28-
1. [rpc](./jsonrpc/rpc.md)
29-
1. [CLI Reference](./cli/cli.md)
30-
1. [reth node](./cli/node.md)
31-
1. [reth init](./cli/init.md)
32-
1. [reth import](./cli/import.md)
33-
1. [reth db](./cli/db.md)
34-
1. [reth stage](./cli/stage.md)
35-
1. [reth p2p](./cli/p2p.md)
36-
1. [reth test-vectors](./cli/test-vectors.md)
37-
1. [reth config](./cli/config.md)
38-
1. [reth debug](./cli/debug.md)
39-
1. [reth recover](./cli/recover.md)
40-
1. [Developers](./developers/developers.md)
41-
1. [Contribute](./developers/contribute.md)
3+
- [Introduction](./intro.md)
4+
- [Installation](./installation/installation.md)
5+
- [Pre-Built Binaries](./installation/binaries.md)
6+
- [Docker](./installation/docker.md)
7+
- [Build from Source](./installation/source.md)
8+
- [Build for ARM devices](./installation/build-for-arm-devices.md)
9+
- [Update Priorities](./installation/priorities.md)
10+
- [Run a Node](./run/run-a-node.md)
11+
- [Mainnet or official testnets](./run/mainnet.md)
12+
- [OP Stack](./run/optimism.md)
13+
- [Private testnet](./run/private-testnet.md)
14+
- [Metrics](./run/observability.md)
15+
- [Configuring Reth](./run/config.md)
16+
- [Transaction types](./run/transactions.md)
17+
- [Pruning & Full Node](./run/pruning.md)
18+
- [Ports](./run/ports.md)
19+
- [Troubleshooting](./run/troubleshooting.md)
20+
- [Interacting with Reth over JSON-RPC](./jsonrpc/intro.md)
21+
- [eth](./jsonrpc/eth.md)
22+
- [web3](./jsonrpc/web3.md)
23+
- [net](./jsonrpc/net.md)
24+
- [txpool](./jsonrpc/txpool.md)
25+
- [debug](./jsonrpc/debug.md)
26+
- [trace](./jsonrpc/trace.md)
27+
- [admin](./jsonrpc/admin.md)
28+
- [rpc](./jsonrpc/rpc.md)
29+
- [CLI Reference](./cli/cli.md) <!-- CLI_REFERENCE START -->
30+
- [`reth`](./cli/reth.md)
31+
- [`reth node`](./cli/reth/node.md)
32+
- [`reth init`](./cli/reth/init.md)
33+
- [`reth import`](./cli/reth/import.md)
34+
- [`reth db`](./cli/reth/db.md)
35+
- [`reth db stats`](./cli/reth/db/stats.md)
36+
- [`reth db list`](./cli/reth/db/list.md)
37+
- [`reth db diff`](./cli/reth/db/diff.md)
38+
- [`reth db get`](./cli/reth/db/get.md)
39+
- [`reth db drop`](./cli/reth/db/drop.md)
40+
- [`reth db clear`](./cli/reth/db/clear.md)
41+
- [`reth db snapshot`](./cli/reth/db/snapshot.md)
42+
- [`reth db version`](./cli/reth/db/version.md)
43+
- [`reth db path`](./cli/reth/db/path.md)
44+
- [`reth stage`](./cli/reth/stage.md)
45+
- [`reth stage run`](./cli/reth/stage/run.md)
46+
- [`reth stage drop`](./cli/reth/stage/drop.md)
47+
- [`reth stage dump`](./cli/reth/stage/dump.md)
48+
- [`reth stage dump execution`](./cli/reth/stage/dump/execution.md)
49+
- [`reth stage dump storage-hashing`](./cli/reth/stage/dump/storage-hashing.md)
50+
- [`reth stage dump account-hashing`](./cli/reth/stage/dump/account-hashing.md)
51+
- [`reth stage dump merkle`](./cli/reth/stage/dump/merkle.md)
52+
- [`reth stage unwind`](./cli/reth/stage/unwind.md)
53+
- [`reth stage unwind to-block`](./cli/reth/stage/unwind/to-block.md)
54+
- [`reth stage unwind num-blocks`](./cli/reth/stage/unwind/num-blocks.md)
55+
- [`reth p2p`](./cli/reth/p2p.md)
56+
- [`reth p2p header`](./cli/reth/p2p/header.md)
57+
- [`reth p2p body`](./cli/reth/p2p/body.md)
58+
- [`reth test-vectors`](./cli/reth/test-vectors.md)
59+
- [`reth test-vectors tables`](./cli/reth/test-vectors/tables.md)
60+
- [`reth config`](./cli/reth/config.md)
61+
- [`reth debug`](./cli/reth/debug.md)
62+
- [`reth debug execution`](./cli/reth/debug/execution.md)
63+
- [`reth debug merkle`](./cli/reth/debug/merkle.md)
64+
- [`reth debug in-memory-merkle`](./cli/reth/debug/in-memory-merkle.md)
65+
- [`reth debug build-block`](./cli/reth/debug/build-block.md)
66+
- [`reth recover`](./cli/reth/recover.md)
67+
- [`reth recover storage-tries`](./cli/reth/recover/storage-tries.md)
68+
- [Developers](./developers/developers.md) <!-- CLI_REFERENCE END -->
69+
- [Contribute](./developers/contribute.md)

book/cli/SUMMARY.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- [`reth`](./reth.md)
2+
- [`reth node`](./reth/node.md)
3+
- [`reth init`](./reth/init.md)
4+
- [`reth import`](./reth/import.md)
5+
- [`reth db`](./reth/db.md)
6+
- [`reth db stats`](./reth/db/stats.md)
7+
- [`reth db list`](./reth/db/list.md)
8+
- [`reth db diff`](./reth/db/diff.md)
9+
- [`reth db get`](./reth/db/get.md)
10+
- [`reth db drop`](./reth/db/drop.md)
11+
- [`reth db clear`](./reth/db/clear.md)
12+
- [`reth db snapshot`](./reth/db/snapshot.md)
13+
- [`reth db version`](./reth/db/version.md)
14+
- [`reth db path`](./reth/db/path.md)
15+
- [`reth stage`](./reth/stage.md)
16+
- [`reth stage run`](./reth/stage/run.md)
17+
- [`reth stage drop`](./reth/stage/drop.md)
18+
- [`reth stage dump`](./reth/stage/dump.md)
19+
- [`reth stage dump execution`](./reth/stage/dump/execution.md)
20+
- [`reth stage dump storage-hashing`](./reth/stage/dump/storage-hashing.md)
21+
- [`reth stage dump account-hashing`](./reth/stage/dump/account-hashing.md)
22+
- [`reth stage dump merkle`](./reth/stage/dump/merkle.md)
23+
- [`reth stage unwind`](./reth/stage/unwind.md)
24+
- [`reth stage unwind to-block`](./reth/stage/unwind/to-block.md)
25+
- [`reth stage unwind num-blocks`](./reth/stage/unwind/num-blocks.md)
26+
- [`reth p2p`](./reth/p2p.md)
27+
- [`reth p2p header`](./reth/p2p/header.md)
28+
- [`reth p2p body`](./reth/p2p/body.md)
29+
- [`reth test-vectors`](./reth/test-vectors.md)
30+
- [`reth test-vectors tables`](./reth/test-vectors/tables.md)
31+
- [`reth config`](./reth/config.md)
32+
- [`reth debug`](./reth/debug.md)
33+
- [`reth debug execution`](./reth/debug/execution.md)
34+
- [`reth debug merkle`](./reth/debug/merkle.md)
35+
- [`reth debug in-memory-merkle`](./reth/debug/in-memory-merkle.md)
36+
- [`reth debug build-block`](./reth/debug/build-block.md)
37+
- [`reth recover`](./reth/recover.md)
38+
- [`reth recover storage-tries`](./reth/recover/storage-tries.md)
39+

book/cli/cli.md

+2-118
Original file line numberDiff line numberDiff line change
@@ -2,122 +2,6 @@
22

33
The Reth node is operated via the CLI by running the `reth node` command. To stop it, press `ctrl-c`. You may need to wait a bit as Reth tears down existing p2p connections or other cleanup tasks.
44

5-
However, Reth has more commands than that:
5+
However, Reth has more commands:
66

7-
```bash
8-
reth --help
9-
```
10-
11-
Some of the most useful commands as a node developer are:
12-
* [`reth node`](./node.md): Starts the Reth node's components, including the JSON-RPC.
13-
* [`reth init`](./init.md): Initialize the database from a genesis file.
14-
* [`reth import`](./import.md): This syncs RLP encoded blocks from a file.
15-
* [`reth db`](./db.md): Administrative TUI to the key-value store.
16-
* [`reth stage`](./stage.md): Runs a stage in isolation. Useful for testing and benchmarking.
17-
* [`reth p2p`](./p2p.md): P2P-related utilities
18-
* [`reth test-vectors`](./test-vectors.md): Generate Test Vectors
19-
* [`reth config`](./config.md): Write config to stdout
20-
* [`reth debug`](./debug.md): Various debug routines
21-
22-
See below for the full list of commands.
23-
24-
## Commands
25-
26-
```bash
27-
$ reth --help
28-
Reth
29-
30-
Usage: reth [OPTIONS] <COMMAND>
31-
32-
Commands:
33-
node Start the node
34-
init Initialize the database from a genesis file
35-
import This syncs RLP encoded blocks from a file
36-
db Database debugging utilities
37-
stage Manipulate individual stages
38-
p2p P2P Debugging utilities
39-
test-vectors Generate Test Vectors
40-
config Write config to stdout
41-
debug Various debug routines
42-
recover Scripts for node recovery
43-
help Print this message or the help of the given subcommand(s)
44-
45-
Options:
46-
--chain <CHAIN_OR_PATH>
47-
The chain this node is running.
48-
Possible values are either a built-in chain or the path to a chain specification file.
49-
50-
Built-in chains:
51-
mainnet, sepolia, goerli, holesky, dev
52-
53-
[default: mainnet]
54-
55-
--instance <INSTANCE>
56-
Add a new instance of a node.
57-
58-
Configures the ports of the node to avoid conflicts with the defaults. This is useful for running multiple nodes on the same machine.
59-
60-
Max number of instances is 200. It is chosen in a way so that it's not possible to have port numbers that conflict with each other.
61-
62-
Changes to the following port numbers: - DISCOVERY_PORT: default + `instance` - 1 - AUTH_PORT: default + `instance` * 100 - 100 - HTTP_RPC_PORT: default - `instance` + 1 - WS_RPC_PORT: default + `instance` * 2 - 2
63-
64-
[default: 1]
65-
66-
-h, --help
67-
Print help (see a summary with '-h')
68-
69-
-V, --version
70-
Print version
71-
72-
Logging:
73-
--log.file.directory <PATH>
74-
The path to put log files in
75-
76-
[default: /reth/logs]
77-
78-
--log.file.max-size <SIZE>
79-
The maximum size (in MB) of one log file
80-
81-
[default: 200]
82-
83-
--log.file.max-files <COUNT>
84-
The maximum amount of log files that will be stored. If set to 0, background file logging is disabled
85-
86-
[default: 5]
87-
88-
--log.file.filter <FILTER>
89-
The filter to use for logs written to the log file
90-
91-
[default: debug]
92-
93-
--log.journald
94-
Write logs to journald
95-
96-
--log.journald.filter <FILTER>
97-
The filter to use for logs written to journald
98-
99-
[default: error]
100-
101-
--color <COLOR>
102-
Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting
103-
104-
[default: always]
105-
106-
Possible values:
107-
- always: Colors on
108-
- auto: Colors on
109-
- never: Colors off
110-
111-
Display:
112-
-v, --verbosity...
113-
Set the minimum log level.
114-
115-
-v Errors
116-
-vv Warnings
117-
-vvv Info
118-
-vvvv Debug
119-
-vvvvv Traces (warning: very verbose!)
120-
121-
-q, --quiet
122-
Silence all log output
123-
```
7+
{{#include ./SUMMARY.md}}

book/cli/config.json

-39
This file was deleted.

0 commit comments

Comments
 (0)