Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve CLI reference generator #5740

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
book/cli/**/*.md linguist-vendored
book/cli/cli.md -linguist-vendored

crates/storage/libmdbx-rs/mdbx-sys/** linguist-vendored
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ db-tools: ## Compile MDBX debugging tools.
update-book-cli: ## Update book cli documentation.
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"
@echo "Updating book cli doc..."
@./book/cli/update.sh $(BUILD_PATH)
@./book/cli/update.sh $(BUILD_PATH)/$(PROFILE)/reth

.PHONY: maxperf
maxperf:
Expand Down
106 changes: 67 additions & 39 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,69 @@
# Reth Book

1. [Introduction](./intro.md)
1. [Installation](./installation/installation.md)
1. [Pre-Built Binaries](./installation/binaries.md)
1. [Docker](./installation/docker.md)
1. [Build from Source](./installation/source.md)
1. [Build for ARM devices](./installation/build-for-arm-devices.md)
1. [Update Priorities](./installation/priorities.md)
1. [Run a Node](./run/run-a-node.md)
1. [Mainnet or official testnets](./run/mainnet.md)
1. [OP Stack](./run/optimism.md)
1. [Private testnet](./run/private-testnet.md)
1. [Metrics](./run/observability.md)
1. [Configuring Reth](./run/config.md)
1. [Transaction types](./run/transactions.md)
1. [Pruning & Full Node](./run/pruning.md)
1. [Ports](./run/ports.md)
1. [Troubleshooting](./run/troubleshooting.md)
1. [Interacting with Reth over JSON-RPC](./jsonrpc/intro.md)
1. [eth](./jsonrpc/eth.md)
1. [web3](./jsonrpc/web3.md)
1. [net](./jsonrpc/net.md)
1. [txpool](./jsonrpc/txpool.md)
1. [debug](./jsonrpc/debug.md)
1. [trace](./jsonrpc/trace.md)
1. [admin](./jsonrpc/admin.md)
1. [rpc](./jsonrpc/rpc.md)
1. [CLI Reference](./cli/cli.md)
1. [reth node](./cli/node.md)
1. [reth init](./cli/init.md)
1. [reth import](./cli/import.md)
1. [reth db](./cli/db.md)
1. [reth stage](./cli/stage.md)
1. [reth p2p](./cli/p2p.md)
1. [reth test-vectors](./cli/test-vectors.md)
1. [reth config](./cli/config.md)
1. [reth debug](./cli/debug.md)
1. [reth recover](./cli/recover.md)
1. [Developers](./developers/developers.md)
1. [Contribute](./developers/contribute.md)
- [Introduction](./intro.md)
- [Installation](./installation/installation.md)
- [Pre-Built Binaries](./installation/binaries.md)
- [Docker](./installation/docker.md)
- [Build from Source](./installation/source.md)
- [Build for ARM devices](./installation/build-for-arm-devices.md)
- [Update Priorities](./installation/priorities.md)
- [Run a Node](./run/run-a-node.md)
- [Mainnet or official testnets](./run/mainnet.md)
- [OP Stack](./run/optimism.md)
- [Private testnet](./run/private-testnet.md)
- [Metrics](./run/observability.md)
- [Configuring Reth](./run/config.md)
- [Transaction types](./run/transactions.md)
- [Pruning & Full Node](./run/pruning.md)
- [Ports](./run/ports.md)
- [Troubleshooting](./run/troubleshooting.md)
- [Interacting with Reth over JSON-RPC](./jsonrpc/intro.md)
- [eth](./jsonrpc/eth.md)
- [web3](./jsonrpc/web3.md)
- [net](./jsonrpc/net.md)
- [txpool](./jsonrpc/txpool.md)
- [debug](./jsonrpc/debug.md)
- [trace](./jsonrpc/trace.md)
- [admin](./jsonrpc/admin.md)
- [rpc](./jsonrpc/rpc.md)
- [CLI Reference](./cli/cli.md) <!-- CLI_REFERENCE START -->
- [`reth`](./cli/reth.md)
- [`reth node`](./cli/reth/node.md)
- [`reth init`](./cli/reth/init.md)
- [`reth import`](./cli/reth/import.md)
- [`reth db`](./cli/reth/db.md)
- [`reth db stats`](./cli/reth/db/stats.md)
- [`reth db list`](./cli/reth/db/list.md)
- [`reth db diff`](./cli/reth/db/diff.md)
- [`reth db get`](./cli/reth/db/get.md)
- [`reth db drop`](./cli/reth/db/drop.md)
- [`reth db clear`](./cli/reth/db/clear.md)
- [`reth db snapshot`](./cli/reth/db/snapshot.md)
- [`reth db version`](./cli/reth/db/version.md)
- [`reth db path`](./cli/reth/db/path.md)
- [`reth stage`](./cli/reth/stage.md)
- [`reth stage run`](./cli/reth/stage/run.md)
- [`reth stage drop`](./cli/reth/stage/drop.md)
- [`reth stage dump`](./cli/reth/stage/dump.md)
- [`reth stage dump execution`](./cli/reth/stage/dump/execution.md)
- [`reth stage dump storage-hashing`](./cli/reth/stage/dump/storage-hashing.md)
- [`reth stage dump account-hashing`](./cli/reth/stage/dump/account-hashing.md)
- [`reth stage dump merkle`](./cli/reth/stage/dump/merkle.md)
- [`reth stage unwind`](./cli/reth/stage/unwind.md)
- [`reth stage unwind to-block`](./cli/reth/stage/unwind/to-block.md)
- [`reth stage unwind num-blocks`](./cli/reth/stage/unwind/num-blocks.md)
- [`reth p2p`](./cli/reth/p2p.md)
- [`reth p2p header`](./cli/reth/p2p/header.md)
- [`reth p2p body`](./cli/reth/p2p/body.md)
- [`reth test-vectors`](./cli/reth/test-vectors.md)
- [`reth test-vectors tables`](./cli/reth/test-vectors/tables.md)
- [`reth config`](./cli/reth/config.md)
- [`reth debug`](./cli/reth/debug.md)
- [`reth debug execution`](./cli/reth/debug/execution.md)
- [`reth debug merkle`](./cli/reth/debug/merkle.md)
- [`reth debug in-memory-merkle`](./cli/reth/debug/in-memory-merkle.md)
- [`reth debug build-block`](./cli/reth/debug/build-block.md)
- [`reth recover`](./cli/reth/recover.md)
- [`reth recover storage-tries`](./cli/reth/recover/storage-tries.md)
- [Developers](./developers/developers.md) <!-- CLI_REFERENCE END -->
- [Contribute](./developers/contribute.md)
39 changes: 39 additions & 0 deletions book/cli/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- [`reth`](./reth.md)
- [`reth node`](./reth/node.md)
- [`reth init`](./reth/init.md)
- [`reth import`](./reth/import.md)
- [`reth db`](./reth/db.md)
- [`reth db stats`](./reth/db/stats.md)
- [`reth db list`](./reth/db/list.md)
- [`reth db diff`](./reth/db/diff.md)
- [`reth db get`](./reth/db/get.md)
- [`reth db drop`](./reth/db/drop.md)
- [`reth db clear`](./reth/db/clear.md)
- [`reth db snapshot`](./reth/db/snapshot.md)
- [`reth db version`](./reth/db/version.md)
- [`reth db path`](./reth/db/path.md)
- [`reth stage`](./reth/stage.md)
- [`reth stage run`](./reth/stage/run.md)
- [`reth stage drop`](./reth/stage/drop.md)
- [`reth stage dump`](./reth/stage/dump.md)
- [`reth stage dump execution`](./reth/stage/dump/execution.md)
- [`reth stage dump storage-hashing`](./reth/stage/dump/storage-hashing.md)
- [`reth stage dump account-hashing`](./reth/stage/dump/account-hashing.md)
- [`reth stage dump merkle`](./reth/stage/dump/merkle.md)
- [`reth stage unwind`](./reth/stage/unwind.md)
- [`reth stage unwind to-block`](./reth/stage/unwind/to-block.md)
- [`reth stage unwind num-blocks`](./reth/stage/unwind/num-blocks.md)
- [`reth p2p`](./reth/p2p.md)
- [`reth p2p header`](./reth/p2p/header.md)
- [`reth p2p body`](./reth/p2p/body.md)
- [`reth test-vectors`](./reth/test-vectors.md)
- [`reth test-vectors tables`](./reth/test-vectors/tables.md)
- [`reth config`](./reth/config.md)
- [`reth debug`](./reth/debug.md)
- [`reth debug execution`](./reth/debug/execution.md)
- [`reth debug merkle`](./reth/debug/merkle.md)
- [`reth debug in-memory-merkle`](./reth/debug/in-memory-merkle.md)
- [`reth debug build-block`](./reth/debug/build-block.md)
- [`reth recover`](./reth/recover.md)
- [`reth recover storage-tries`](./reth/recover/storage-tries.md)

120 changes: 2 additions & 118 deletions book/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,6 @@

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.

However, Reth has more commands than that:
However, Reth has more commands:

```bash
reth --help
```

Some of the most useful commands as a node developer are:
* [`reth node`](./node.md): Starts the Reth node's components, including the JSON-RPC.
* [`reth init`](./init.md): Initialize the database from a genesis file.
* [`reth import`](./import.md): This syncs RLP encoded blocks from a file.
* [`reth db`](./db.md): Administrative TUI to the key-value store.
* [`reth stage`](./stage.md): Runs a stage in isolation. Useful for testing and benchmarking.
* [`reth p2p`](./p2p.md): P2P-related utilities
* [`reth test-vectors`](./test-vectors.md): Generate Test Vectors
* [`reth config`](./config.md): Write config to stdout
* [`reth debug`](./debug.md): Various debug routines

See below for the full list of commands.

## Commands

```bash
$ reth --help
Reth

Usage: reth [OPTIONS] <COMMAND>

Commands:
node Start the node
init Initialize the database from a genesis file
import This syncs RLP encoded blocks from a file
db Database debugging utilities
stage Manipulate individual stages
p2p P2P Debugging utilities
test-vectors Generate Test Vectors
config Write config to stdout
debug Various debug routines
recover Scripts for node recovery
help Print this message or the help of the given subcommand(s)

Options:
--chain <CHAIN_OR_PATH>
The chain this node is running.
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev

[default: mainnet]

--instance <INSTANCE>
Add a new instance of a node.

Configures the ports of the node to avoid conflicts with the defaults. This is useful for running multiple nodes on the same machine.

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.

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

[default: 1]

-h, --help
Print help (see a summary with '-h')

-V, --version
Print version

Logging:
--log.file.directory <PATH>
The path to put log files in

[default: /reth/logs]

--log.file.max-size <SIZE>
The maximum size (in MB) of one log file

[default: 200]

--log.file.max-files <COUNT>
The maximum amount of log files that will be stored. If set to 0, background file logging is disabled

[default: 5]

--log.file.filter <FILTER>
The filter to use for logs written to the log file

[default: debug]

--log.journald
Write logs to journald

--log.journald.filter <FILTER>
The filter to use for logs written to journald

[default: error]

--color <COLOR>
Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting

[default: always]

Possible values:
- always: Colors on
- auto: Colors on
- never: Colors off

Display:
-v, --verbosity...
Set the minimum log level.

-v Errors
-vv Warnings
-vvv Info
-vvvv Debug
-vvvvv Traces (warning: very verbose!)

-q, --quiet
Silence all log output
```
{{#include ./SUMMARY.md}}
39 changes: 0 additions & 39 deletions book/cli/config.json

This file was deleted.

Loading
Loading