From 744930f1de7c8621743c137bf4f95114046bcece Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:18:18 +0200 Subject: [PATCH] docs: improve CLI reference generator (#5740) --- .gitattributes | 3 + Makefile | 2 +- book/SUMMARY.md | 106 +- book/cli/SUMMARY.md | 39 + book/cli/cli.md | 120 +- book/cli/config.json | 39 - book/cli/db.md | 986 --------------- book/cli/debug.md | 665 ---------- book/cli/help.py | 264 ++++ book/cli/p2p.md | 318 ----- book/cli/reth.md | 100 ++ book/cli/{ => reth}/config.md | 7 +- book/cli/reth/db.md | 121 ++ book/cli/reth/db/clear.md | 99 ++ book/cli/reth/db/diff.md | 118 ++ book/cli/reth/db/drop.md | 98 ++ book/cli/reth/db/get.md | 107 ++ book/cli/reth/db/list.md | 141 +++ book/cli/reth/db/path.md | 95 ++ book/cli/reth/db/snapshot.md | 144 +++ book/cli/reth/db/stats.md | 95 ++ book/cli/reth/db/version.md | 95 ++ book/cli/reth/debug.md | 91 ++ book/cli/{ => reth}/import.md | 7 +- book/cli/{ => reth}/init.md | 7 +- book/cli/{ => reth}/node.md | 11 +- book/cli/{recover.md => reth/p2p.md} | 151 +-- book/cli/reth/p2p/body.md | 79 ++ book/cli/reth/p2p/header.md | 79 ++ book/cli/reth/recover.md | 88 ++ book/cli/reth/recover/storage-tries.md | 95 ++ book/cli/reth/stage.md | 91 ++ book/cli/reth/stage/drop.md | 112 ++ book/cli/reth/stage/dump.md | 116 ++ book/cli/reth/stage/dump/account-hashing.md | 87 ++ book/cli/reth/stage/dump/execution.md | 87 ++ book/cli/reth/stage/dump/merkle.md | 87 ++ book/cli/reth/stage/dump/storage-hashing.md | 87 ++ book/cli/reth/stage/run.md | 213 ++++ book/cli/reth/stage/unwind.md | 114 ++ book/cli/reth/stage/unwind/num-blocks.md | 99 ++ book/cli/reth/stage/unwind/to-block.md | 99 ++ book/cli/reth/test-vectors.md | 88 ++ book/cli/reth/test-vectors/tables.md | 88 ++ book/cli/stage.md | 1215 ------------------- book/cli/test-vectors.md | 179 --- book/cli/update.sh | 144 +-- book/run/mainnet.md | 2 +- book/run/troubleshooting.md | 4 +- 49 files changed, 3482 insertions(+), 3800 deletions(-) create mode 100644 book/cli/SUMMARY.md delete mode 100644 book/cli/config.json delete mode 100644 book/cli/db.md delete mode 100644 book/cli/debug.md create mode 100755 book/cli/help.py delete mode 100644 book/cli/p2p.md create mode 100644 book/cli/reth.md rename book/cli/{ => reth}/config.md (97%) create mode 100644 book/cli/reth/db.md create mode 100644 book/cli/reth/db/clear.md create mode 100644 book/cli/reth/db/diff.md create mode 100644 book/cli/reth/db/drop.md create mode 100644 book/cli/reth/db/get.md create mode 100644 book/cli/reth/db/list.md create mode 100644 book/cli/reth/db/path.md create mode 100644 book/cli/reth/db/snapshot.md create mode 100644 book/cli/reth/db/stats.md create mode 100644 book/cli/reth/db/version.md create mode 100644 book/cli/reth/debug.md rename book/cli/{ => reth}/import.md (98%) rename book/cli/{ => reth}/init.md (98%) rename book/cli/{ => reth}/node.md (98%) rename book/cli/{recover.md => reth/p2p.md} (51%) create mode 100644 book/cli/reth/p2p/body.md create mode 100644 book/cli/reth/p2p/header.md create mode 100644 book/cli/reth/recover.md create mode 100644 book/cli/reth/recover/storage-tries.md create mode 100644 book/cli/reth/stage.md create mode 100644 book/cli/reth/stage/drop.md create mode 100644 book/cli/reth/stage/dump.md create mode 100644 book/cli/reth/stage/dump/account-hashing.md create mode 100644 book/cli/reth/stage/dump/execution.md create mode 100644 book/cli/reth/stage/dump/merkle.md create mode 100644 book/cli/reth/stage/dump/storage-hashing.md create mode 100644 book/cli/reth/stage/run.md create mode 100644 book/cli/reth/stage/unwind.md create mode 100644 book/cli/reth/stage/unwind/num-blocks.md create mode 100644 book/cli/reth/stage/unwind/to-block.md create mode 100644 book/cli/reth/test-vectors.md create mode 100644 book/cli/reth/test-vectors/tables.md delete mode 100644 book/cli/stage.md delete mode 100644 book/cli/test-vectors.md diff --git a/.gitattributes b/.gitattributes index 72601fc1f8a5..1315d378f8f9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ +book/cli/**/*.md linguist-vendored +book/cli/cli.md -linguist-vendored + crates/storage/libmdbx-rs/mdbx-sys/** linguist-vendored diff --git a/Makefile b/Makefile index 9ce4eb7d17e8..c3ea8f6db516 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/book/SUMMARY.md b/book/SUMMARY.md index 1c77704a950b..4ffbf84588c0 100644 --- a/book/SUMMARY.md +++ b/book/SUMMARY.md @@ -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) + - [`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) + - [Contribute](./developers/contribute.md) diff --git a/book/cli/SUMMARY.md b/book/cli/SUMMARY.md new file mode 100644 index 000000000000..7427e488c7e1 --- /dev/null +++ b/book/cli/SUMMARY.md @@ -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) + diff --git a/book/cli/cli.md b/book/cli/cli.md index 394883c5c4b2..ef1a98af5259 100644 --- a/book/cli/cli.md +++ b/book/cli/cli.md @@ -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] - -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 - 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 - 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 - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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}} diff --git a/book/cli/config.json b/book/cli/config.json deleted file mode 100644 index 406575eebea4..000000000000 --- a/book/cli/config.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "commands": { - "config": [], - "db": { - "stats": [], - "list": [], - "diff": [], - "get": [], - "drop": [], - "clear": [], - "version": [], - "path": [] - }, - "debug": { - "execution": [], - "merkle": [], - "in-memory-merkle": [] - }, - "import": [], - "init": [], - "node": [], - "p2p": { - "header": [], - "body": [] - }, - "recover": { - "storage-tries": [] - }, - "stage": { - "run": [], - "drop": [], - "dump": ["execution", "storage-hashing", "account-hashing", "merkle"], - "unwind": ["to-block", "num-blocks"] - }, - "test-vectors": { - "tables": [] - } - } -} diff --git a/book/cli/db.md b/book/cli/db.md deleted file mode 100644 index 47f843ad8883..000000000000 --- a/book/cli/db.md +++ /dev/null @@ -1,986 +0,0 @@ -# `reth db` - -Database debugging utilities - -```bash -$ reth db --help - -Usage: reth db [OPTIONS] - -Commands: - stats Lists all the tables, their entry count and their size - list Lists the contents of a table - diff Create a diff between two database tables or two entire databases - get Gets the content of a table for the given key - drop Deletes all database entries - clear Deletes all table entries - snapshot Snapshots tables from database - version Lists current and local database versions - path Returns the full database path - help Print this message or the help of the given subcommand(s) - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db clear` - -Deletes all table entries - -```bash -$ reth db clear --help - -Usage: reth db clear [OPTIONS] - -Arguments: -
- Table name - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db diff` - -Create a diff between two database tables or two entire databases - -```bash -$ reth db diff --help - -Usage: reth db diff [OPTIONS] --secondary-datadir --output - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --secondary-datadir - The path to the data dir for all reth files and subdirectories. - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - - --table
- The table name to diff. If not specified, all tables are diffed. - - --output - The output directory for the diff report. - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db drop` - -Deletes all database entries - -```bash -$ reth db drop --help - -Usage: reth db drop [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - -f, --force - Bypasses the interactive confirmation and drops the database directly - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db get` - -Gets the content of a table for the given key - -```bash -$ reth db get --help - -Usage: reth db get [OPTIONS]
- -Arguments: -
- The table name - - NOTE: The dupsort tables are not supported now. - - - The key to get content for - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --raw - Output bytes instead of human-readable decoded value - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db list` - -Lists the contents of a table - -```bash -$ reth db list --help - -Usage: reth db list [OPTIONS]
- -Arguments: -
- The table name - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - -s, --skip - Skip first N entries - - [default: 0] - - --chain - 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] - - -r, --reverse - Reverse the order of the entries. If enabled last table entries are read - - -l, --len - How many items to take from the walker - - [default: 5] - - --search - Search parameter for both keys and values. Prefix it with `0x` to search for binary data, and text otherwise. - - ATTENTION! For compressed tables (`Transactions` and `Receipts`), there might be missing results since the search uses the raw uncompressed value from the database. - - --min-row-size - Minimum size of row in bytes - - [default: 0] - - --min-key-size - Minimum size of key in bytes - - [default: 0] - - --min-value-size - Minimum size of value in bytes - - [default: 0] - - -c, --count - Returns the number of rows found - - -j, --json - Dump as JSON instead of using TUI - - --raw - Output bytes instead of human-readable decoded value - - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db path` - -Returns the full database path - -```bash -$ reth db path --help - -Usage: reth db path [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db stats` - -Lists all the tables, their entry count and their size - -```bash -$ reth db stats --help - -Usage: reth db stats [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth db version` - -Lists current and local database versions - -```bash -$ reth db version --help - -Usage: reth db version [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` diff --git a/book/cli/debug.md b/book/cli/debug.md deleted file mode 100644 index f0498b800979..000000000000 --- a/book/cli/debug.md +++ /dev/null @@ -1,665 +0,0 @@ -# `reth debug` - -Various debug routines - -```bash -$ reth debug --help - -Usage: reth debug [OPTIONS] - -Commands: - execution Debug the roundtrip execution of blocks as well as the generated data - merkle Debug the clean & incremental state root calculations - in-memory-merkle Debug in-memory state root calculation - build-block Debug block building - help Print this message or the help of the given subcommand(s) - -Options: - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth debug execution` - -Debug the roundtrip execution of blocks as well as the generated data - -```bash -$ reth debug execution --help - -Usage: reth debug execution [OPTIONS] --to - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Networking: - -d, --disable-discovery - Disable the discovery service - - --disable-dns-discovery - Disable the DNS discovery - - --disable-discv4-discovery - Disable Discv4 discovery - - --discovery.addr - The UDP address to use for P2P discovery/networking - - [default: 0.0.0.0] - - --discovery.port - The UDP port to use for P2P discovery/networking - - [default: 30303] - - --trusted-peers - Comma separated enode URLs of trusted peers for P2P connections. - - --trusted-peers enode://abcd@192.168.0.1:30303 - - --trusted-only - Connect only to trusted peers - - --bootnodes - Comma separated enode URLs for P2P discovery bootstrap. - - Will fall back to a network-specific default if not specified. - - --peers-file - The path to the known peers file. Connected peers are dumped to this file on nodes - shutdown, and read on startup. Cannot be used with `--no-persist-peers`. - - --identity - Custom node identity - - [default: reth/v0.1.0-alpha.13-10a83e594/aarch64-apple-darwin] - - --p2p-secret-key - Secret key to use for this node. - - This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used. - - --no-persist-peers - Do not persist peers. - - --nat - NAT resolution method (any|none|upnp|publicip|extip:) - - [default: any] - - --addr - Network listening address - - [default: 0.0.0.0] - - --port - Network listening port - - [default: 30303] - - --max-outbound-peers - Maximum number of outbound requests. default: 100 - - --max-inbound-peers - Maximum number of inbound requests. default: 30 - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - - --to - The maximum block height - - --interval - The block interval for sync and unwind. Defaults to `1000` - - [default: 1000] - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth debug in-memory-merkle` - -Debug in-memory state root calculation - -```bash -$ reth debug in-memory-merkle --help - -Usage: reth debug in-memory-merkle [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Networking: - -d, --disable-discovery - Disable the discovery service - - --disable-dns-discovery - Disable the DNS discovery - - --disable-discv4-discovery - Disable Discv4 discovery - - --discovery.addr - The UDP address to use for P2P discovery/networking - - [default: 0.0.0.0] - - --discovery.port - The UDP port to use for P2P discovery/networking - - [default: 30303] - - --trusted-peers - Comma separated enode URLs of trusted peers for P2P connections. - - --trusted-peers enode://abcd@192.168.0.1:30303 - - --trusted-only - Connect only to trusted peers - - --bootnodes - Comma separated enode URLs for P2P discovery bootstrap. - - Will fall back to a network-specific default if not specified. - - --peers-file - The path to the known peers file. Connected peers are dumped to this file on nodes - shutdown, and read on startup. Cannot be used with `--no-persist-peers`. - - --identity - Custom node identity - - [default: reth/v0.1.0-alpha.13-10a83e594/aarch64-apple-darwin] - - --p2p-secret-key - Secret key to use for this node. - - This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used. - - --no-persist-peers - Do not persist peers. - - --nat - NAT resolution method (any|none|upnp|publicip|extip:) - - [default: any] - - --addr - Network listening address - - [default: 0.0.0.0] - - --port - Network listening port - - [default: 30303] - - --max-outbound-peers - Maximum number of outbound requests. default: 100 - - --max-inbound-peers - Maximum number of inbound requests. default: 30 - - --retries - The number of retries per request - - [default: 5] - - --skip-node-depth - The depth after which we should start comparing branch nodes - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth debug merkle` - -Debug the clean & incremental state root calculations - -```bash -$ reth debug merkle --help - -Usage: reth debug merkle [OPTIONS] --to - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Networking: - -d, --disable-discovery - Disable the discovery service - - --disable-dns-discovery - Disable the DNS discovery - - --disable-discv4-discovery - Disable Discv4 discovery - - --discovery.addr - The UDP address to use for P2P discovery/networking - - [default: 0.0.0.0] - - --discovery.port - The UDP port to use for P2P discovery/networking - - [default: 30303] - - --trusted-peers - Comma separated enode URLs of trusted peers for P2P connections. - - --trusted-peers enode://abcd@192.168.0.1:30303 - - --trusted-only - Connect only to trusted peers - - --bootnodes - Comma separated enode URLs for P2P discovery bootstrap. - - Will fall back to a network-specific default if not specified. - - --peers-file - The path to the known peers file. Connected peers are dumped to this file on nodes - shutdown, and read on startup. Cannot be used with `--no-persist-peers`. - - --identity - Custom node identity - - [default: reth/v0.1.0-alpha.13-10a83e594/aarch64-apple-darwin] - - --p2p-secret-key - Secret key to use for this node. - - This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used. - - --no-persist-peers - Do not persist peers. - - --nat - NAT resolution method (any|none|upnp|publicip|extip:) - - [default: any] - - --addr - Network listening address - - [default: 0.0.0.0] - - --port - Network listening port - - [default: 30303] - - --max-outbound-peers - Maximum number of outbound requests. default: 100 - - --max-inbound-peers - Maximum number of inbound requests. default: 30 - - --retries - The number of retries per request - - [default: 5] - - --to - The height to finish at - - --skip-node-depth - The depth after which we should start comparing branch nodes - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` diff --git a/book/cli/help.py b/book/cli/help.py new file mode 100755 index 000000000000..6f86da4a6f3a --- /dev/null +++ b/book/cli/help.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python3 + +import argparse +import os +import re +import subprocess +import sys +from os import makedirs, path + +HELP_KEY = "help" +SECTION_START = "" +SECTION_END = "" +SECTION_RE = rf"\s*{SECTION_START}.*?{SECTION_END}" + +README = """\ +# CLI Reference + + + +Automatically-generated CLI reference from `--help` output. + +{{#include ./SUMMARY.md}} +""" + + +def main(): + args = parse_args(sys.argv[1:]) + for cmd in args.commands: + if cmd.find(" ") >= 0: + raise Exception(f"subcommands are not allowed: {cmd}") + makedirs(args.out_dir, exist_ok=True) + + output = {} + + # Iterate over all commands and their subcommands. + cmd_iter = [[cmd] for cmd in args.commands] + for cmd in cmd_iter: + subcmds, stdout = get_entry(cmd) + if args.verbose and len(subcmds) > 0: + eprint(f"Found subcommands for \"{' '.join(cmd)}\": {subcmds}") + + # Add entry to output map, e.g. `output["cmd"]["subcmd"]["help"] = "..."`. + e = output + for arg in cmd: + tmp = e.get(arg) + if not tmp: + e[arg] = {} + tmp = e[arg] + e = tmp + e[HELP_KEY] = stdout + + # Append subcommands. + for subcmd in subcmds: + cmd_iter.append(cmd + [subcmd]) + + # Generate markdown files. + summary = "" + root_summary = "" + for cmd, obj in output.items(): + cmd_markdown(args.out_dir, cmd, obj) + + root_path = path.relpath(args.out_dir, args.root_dir) + summary += cmd_summary("", cmd, obj, 0) + summary += "\n" + + root_summary += cmd_summary(root_path, cmd, obj, args.root_indentation) + root_summary += "\n" + with open(path.join(args.out_dir, "SUMMARY.md"), "w") as f: + f.write(summary) + + # Generate README.md. + if args.readme: + with open(path.join(args.out_dir, "README.md"), "w") as f: + f.write(README) + + if args.root_summary: + update_root_summary(args.root_dir, root_summary) + + +def parse_args(args: list[str]): + """Parses command line arguments.""" + parser = argparse.ArgumentParser( + description="Generate markdown files from help output of commands" + ) + parser.add_argument("--root-dir", default=".", help="Root directory") + parser.add_argument( + "--root-indentation", + default=0, + type=int, + help="Indentation for the root SUMMARY.md file", + ) + parser.add_argument("--out-dir", help="Output directory") + parser.add_argument( + "--readme", + action="store_true", + help="Whether to add a README.md file", + ) + parser.add_argument( + "--root-summary", + action="store_true", + help="Whether to update the root SUMMARY.md file", + ) + parser.add_argument( + "commands", + nargs="+", + help="Command to generate markdown for. Can be a subcommand.", + ) + parser.add_argument( + "--verbose", "-v", action="store_true", help="Print verbose output" + ) + return parser.parse_known_args(args)[0] + + +def get_entry(cmd: list[str]): + """Returns the subcommands and help output for a command.""" + env = os.environ.copy() + env["NO_COLOR"] = "1" + env["COLUMNS"] = "100" + env["LINES"] = "10000" + output = subprocess.run(cmd + ["--help"], capture_output=True, env=env) + if output.returncode != 0: + stderr = output.stderr.decode("utf-8") + raise Exception(f"Command \"{' '.join(cmd)}\" failed:\n{stderr}") + stdout = output.stdout.decode("utf-8") + subcmds = parse_sub_commands(stdout) + return subcmds, stdout + + +def parse_sub_commands(s: str): + """Returns a list of subcommands from the help output of a command.""" + idx = s.find("Commands:") + if idx < 0: + return [] + s = s[idx:] + + idx = s.find("Options:") + if idx < 0: + return [] + s = s[:idx] + + idx = s.find("Arguments:") + if idx >= 0: + s = s[:idx] + + subcmds = s.splitlines()[1:] + subcmds = filter( + lambda x: x.strip() != "" and x.startswith(" ") and x[2] != " ", subcmds + ) + subcmds = map(lambda x: x.strip().split(" ")[0], subcmds) + subcmds = filter(lambda x: x != "help", subcmds) + return list(subcmds) + + +def cmd_markdown(out_dir: str, cmd: str, obj: object): + """Writes the markdown for a command and its subcommands to out_dir.""" + + def rec(cmd: list[str], obj: object): + out = "" + out += f"# {' '.join(cmd)}\n\n" + out += help_markdown(cmd, obj[HELP_KEY]) + out_path = out_dir + for arg in cmd: + out_path = path.join(out_path, arg) + makedirs(path.dirname(out_path), exist_ok=True) + with open(f"{out_path}.md", "w") as f: + f.write(out) + + for k, v in obj.items(): + if k == HELP_KEY: + continue + rec(cmd + [k], v) + + rec([command_name(cmd)], obj) + + +def help_markdown(cmd: list[str], s: str): + """Returns the markdown for a command's help output.""" + cmd[0] = command_name(cmd[0]) + description, s = parse_description(s) + return f"""\ +{description} + +```bash +$ {' '.join(cmd)} --help +{preprocess_help(s.strip())} +```""" + + +def parse_description(s: str): + """Splits the help output into a description and the rest.""" + idx = s.find("Usage:") + if idx < 0: + return "", s + return s[:idx].strip().splitlines()[0].strip(), s[idx:] + + +def cmd_summary(md_root: str, cmd: str, obj: object, indent: int): + """Returns the summary for a command and its subcommands.""" + + def rec(cmd: list[str], obj: object, indent: int): + nonlocal out + cmd_s = " ".join(cmd) + cmd_path = cmd_s.replace(" ", "/") + if md_root != "": + cmd_path = f"{md_root}/{cmd_path}" + out += f"{' ' * indent}- [`{cmd_s}`](./{cmd_path}.md)\n" + + for k, v in obj.items(): + if k == HELP_KEY: + continue + rec(cmd + [k], v, indent + 2) + + out = "" + rec([command_name(cmd)], obj, indent) + return out + + +def update_root_summary(root_dir: str, root_summary: str): + """Replaces the CLI_REFERENCE section in the root SUMMARY.md file.""" + summary_file = path.join(root_dir, "SUMMARY.md") + + with open(summary_file, "r") as f: + real_root_summary = f.read() + + if not re.search(SECTION_RE, real_root_summary, flags=re.DOTALL): + raise Exception( + f"Could not find CLI_REFERENCE section in {summary_file}. " + "Please add the following section to the file:\n" + f"{SECTION_START}\n{SECTION_END}" + ) + + last_line = re.findall(f".*{SECTION_END}", real_root_summary)[0] + root_summary_s = root_summary.rstrip().replace("\n\n", "\n") + replace_with = f" {SECTION_START}\n{root_summary_s}\n{last_line}" + + real_root_summary = re.sub( + SECTION_RE, replace_with, real_root_summary, flags=re.DOTALL + ) + root_summary_file = path.join(root_dir, "SUMMARY.md") + with open(root_summary_file, "w") as f: + f.write(real_root_summary) + + +def eprint(*args, **kwargs): + """Prints to stderr.""" + print(*args, file=sys.stderr, **kwargs) + + +def command_name(cmd: str): + """Returns the name of a command.""" + return cmd.split("/")[-1] + +def preprocess_help(s: str): + """Preprocesses the help output of a command.""" + # Remove the user-specific paths. + s = re.sub(r"default: /.*/reth", "default: ", s) + # Remove the commit SHA. + s = re.sub(r"-[0-9A-Fa-f]{6,10}/", "-/", s) + + return s + + +if __name__ == "__main__": + main() diff --git a/book/cli/p2p.md b/book/cli/p2p.md deleted file mode 100644 index ba94a774ae2c..000000000000 --- a/book/cli/p2p.md +++ /dev/null @@ -1,318 +0,0 @@ -# `reth p2p` - -P2P Debugging utilities - -```bash -$ reth p2p --help - -Usage: reth p2p [OPTIONS] - -Commands: - header Download block header - body Download block body - help Print this message or the help of the given subcommand(s) - -Options: - --config - The path to the configuration file to use. - - --chain - 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] - - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --p2p-secret-key - Secret key to use for this node. - - This also will deterministically set the peer ID. - - -d, --disable-discovery - Disable the discovery service - - --disable-dns-discovery - Disable the DNS discovery - - --disable-discv4-discovery - Disable Discv4 discovery - - --discovery.addr - The UDP address to use for P2P discovery/networking - - [default: 0.0.0.0] - - --discovery.port - The UDP port to use for P2P discovery/networking - - [default: 30303] - - --trusted-peer - Target trusted peer - - --trusted-only - Connect only to trusted peers - - --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] - - --retries - The number of retries per request - - [default: 5] - - --nat - [default: any] - - -h, --help - Print help (see a summary with '-h') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth p2p body` - -Download block body - -```bash -$ reth p2p body --help - -Usage: reth p2p body [OPTIONS] - -Arguments: - - The block number or hash - -Options: - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth p2p header` - -Download block header - -```bash -$ reth p2p header --help - -Usage: reth p2p header [OPTIONS] - -Arguments: - - The header number or hash - -Options: - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` diff --git a/book/cli/reth.md b/book/cli/reth.md new file mode 100644 index 000000000000..08772686347f --- /dev/null +++ b/book/cli/reth.md @@ -0,0 +1,100 @@ +# reth + +Reth + +```bash +$ reth --help +Usage: reth [OPTIONS] + +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 + 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 + 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 + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/config.md b/book/cli/reth/config.md similarity index 97% rename from book/cli/config.md rename to book/cli/reth/config.md index 78f64a1792ba..bd1abe4fe9d6 100644 --- a/book/cli/config.md +++ b/book/cli/reth/config.md @@ -1,10 +1,9 @@ -# `reth config` +# reth config Write config to stdout ```bash $ reth config --help - Usage: reth config [OPTIONS] Options: @@ -41,7 +40,7 @@ Logging: --log.file.directory The path to put log files in - [default: /reth/logs] + [default: /logs] --log.file.max-size The maximum size (in MB) of one log file @@ -88,4 +87,4 @@ Display: -q, --quiet Silence all log output -``` +``` \ No newline at end of file diff --git a/book/cli/reth/db.md b/book/cli/reth/db.md new file mode 100644 index 000000000000..0ef1ac526d11 --- /dev/null +++ b/book/cli/reth/db.md @@ -0,0 +1,121 @@ +# reth db + +Database debugging utilities + +```bash +$ reth db --help +Usage: reth db [OPTIONS] + +Commands: + stats Lists all the tables, their entry count and their size + list Lists the contents of a table + diff Create a diff between two database tables or two entire databases + get Gets the content of a table for the given key + drop Deletes all database entries + clear Deletes all table entries + snapshot Snapshots tables from database + version Lists current and local database versions + path Returns the full database path + help Print this message or the help of the given subcommand(s) + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/clear.md b/book/cli/reth/db/clear.md new file mode 100644 index 000000000000..6015dc75173e --- /dev/null +++ b/book/cli/reth/db/clear.md @@ -0,0 +1,99 @@ +# reth db clear + +Deletes all table entries + +```bash +$ reth db clear --help +Usage: reth db clear [OPTIONS]
+ +Arguments: +
+ Table name + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/diff.md b/book/cli/reth/db/diff.md new file mode 100644 index 000000000000..6c03b8a9b70b --- /dev/null +++ b/book/cli/reth/db/diff.md @@ -0,0 +1,118 @@ +# reth db diff + +Create a diff between two database tables or two entire databases + +```bash +$ reth db diff --help +Usage: reth db diff [OPTIONS] --secondary-datadir --output + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --secondary-datadir + The path to the data dir for all reth files and subdirectories. + + --chain + 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 + 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') + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + + --table
+ The table name to diff. If not specified, all tables are diffed. + + --output + The output directory for the diff report. + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/drop.md b/book/cli/reth/db/drop.md new file mode 100644 index 000000000000..ab87c4d746b1 --- /dev/null +++ b/book/cli/reth/db/drop.md @@ -0,0 +1,98 @@ +# reth db drop + +Deletes all database entries + +```bash +$ reth db drop --help +Usage: reth db drop [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + -f, --force + Bypasses the interactive confirmation and drops the database directly + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/get.md b/book/cli/reth/db/get.md new file mode 100644 index 000000000000..e35b60345c01 --- /dev/null +++ b/book/cli/reth/db/get.md @@ -0,0 +1,107 @@ +# reth db get + +Gets the content of a table for the given key + +```bash +$ reth db get --help +Usage: reth db get [OPTIONS]
+ +Arguments: +
+ The table name + + NOTE: The dupsort tables are not supported now. + + + The key to get content for + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --raw + Output bytes instead of human-readable decoded value + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/list.md b/book/cli/reth/db/list.md new file mode 100644 index 000000000000..3f9ed77e0ac4 --- /dev/null +++ b/book/cli/reth/db/list.md @@ -0,0 +1,141 @@ +# reth db list + +Lists the contents of a table + +```bash +$ reth db list --help +Usage: reth db list [OPTIONS]
+ +Arguments: +
+ The table name + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + -s, --skip + Skip first N entries + + [default: 0] + + --chain + 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] + + -r, --reverse + Reverse the order of the entries. If enabled last table entries are read + + -l, --len + How many items to take from the walker + + [default: 5] + + --search + Search parameter for both keys and values. Prefix it with `0x` to search for binary data, and text otherwise. + + ATTENTION! For compressed tables (`Transactions` and `Receipts`), there might be missing results since the search uses the raw uncompressed value from the database. + + --min-row-size + Minimum size of row in bytes + + [default: 0] + + --min-key-size + Minimum size of key in bytes + + [default: 0] + + --min-value-size + Minimum size of value in bytes + + [default: 0] + + -c, --count + Returns the number of rows found + + -j, --json + Dump as JSON instead of using TUI + + --raw + Output bytes instead of human-readable decoded value + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/path.md b/book/cli/reth/db/path.md new file mode 100644 index 000000000000..6180bab9203d --- /dev/null +++ b/book/cli/reth/db/path.md @@ -0,0 +1,95 @@ +# reth db path + +Returns the full database path + +```bash +$ reth db path --help +Usage: reth db path [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/snapshot.md b/book/cli/reth/db/snapshot.md new file mode 100644 index 000000000000..2be9ce0f7adc --- /dev/null +++ b/book/cli/reth/db/snapshot.md @@ -0,0 +1,144 @@ +# reth db snapshot + +Snapshots tables from database + +```bash +$ reth db snapshot --help +Usage: reth db snapshot [OPTIONS] [SEGMENTS]... + +Arguments: + [SEGMENTS]... + Snapshot segments to generate + + Possible values: + - headers: Snapshot segment responsible for the `CanonicalHeaders`, `Headers`, `HeaderTD` tables + - transactions: Snapshot segment responsible for the `Transactions` table + - receipts: Snapshot segment responsible for the `Receipts` table + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + -f, --from + Starting block for the snapshot + + [default: 0] + + -b, --block-interval + Number of blocks in the snapshot + + [default: 500000] + + --chain + 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] + + -p, --parallel + Sets the number of snapshots built in parallel. Note: Each parallel build is memory-intensive + + [default: 1] + + --only-stats + Flag to skip snapshot creation and print snapshot files stats + + --bench + Flag to enable database-to-snapshot benchmarking + + --only-bench + Flag to skip snapshot creation and only run benchmarks on existing snapshots + + -c, --compression + Compression algorithms to use + + [default: lz4] + [possible values: lz4, zstd, zstd-with-dictionary, uncompressed] + + --with-filters + Flag to enable inclusion list filters and PHFs + + --phf + Specifies the perfect hashing function to use + + Possible values: + - fmph: Fingerprint-Based Minimal Perfect Hash Function + - go-fmph: Fingerprint-Based Minimal Perfect Hash Function with Group Optimization + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/stats.md b/book/cli/reth/db/stats.md new file mode 100644 index 000000000000..385935827869 --- /dev/null +++ b/book/cli/reth/db/stats.md @@ -0,0 +1,95 @@ +# reth db stats + +Lists all the tables, their entry count and their size + +```bash +$ reth db stats --help +Usage: reth db stats [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/db/version.md b/book/cli/reth/db/version.md new file mode 100644 index 000000000000..847dc0cb897c --- /dev/null +++ b/book/cli/reth/db/version.md @@ -0,0 +1,95 @@ +# reth db version + +Lists current and local database versions + +```bash +$ reth db version --help +Usage: reth db version [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/debug.md b/book/cli/reth/debug.md new file mode 100644 index 000000000000..f41966bebee6 --- /dev/null +++ b/book/cli/reth/debug.md @@ -0,0 +1,91 @@ +# reth debug + +Various debug routines + +```bash +$ reth debug --help +Usage: reth debug [OPTIONS] + +Commands: + execution Debug the roundtrip execution of blocks as well as the generated data + merkle Debug the clean & incremental state root calculations + in-memory-merkle Debug in-memory state root calculation + build-block Debug block building + help Print this message or the help of the given subcommand(s) + +Options: + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/import.md b/book/cli/reth/import.md similarity index 98% rename from book/cli/import.md rename to book/cli/reth/import.md index 08aadbfc7724..b92a0c9a18a3 100644 --- a/book/cli/import.md +++ b/book/cli/reth/import.md @@ -1,10 +1,9 @@ -# `reth import` +# reth import This syncs RLP encoded blocks from a file ```bash $ reth import --help - Usage: reth import [OPTIONS] Options: @@ -69,7 +68,7 @@ Logging: --log.file.directory The path to put log files in - [default: /reth/logs] + [default: /logs] --log.file.max-size The maximum size (in MB) of one log file @@ -116,4 +115,4 @@ Display: -q, --quiet Silence all log output -``` +``` \ No newline at end of file diff --git a/book/cli/init.md b/book/cli/reth/init.md similarity index 98% rename from book/cli/init.md rename to book/cli/reth/init.md index e824d8f5ec80..3f5353176002 100644 --- a/book/cli/init.md +++ b/book/cli/reth/init.md @@ -1,10 +1,9 @@ -# `reth init` +# reth init Initialize the database from a genesis file ```bash $ reth init --help - Usage: reth init [OPTIONS] Options: @@ -60,7 +59,7 @@ Logging: --log.file.directory The path to put log files in - [default: /reth/logs] + [default: /logs] --log.file.max-size The maximum size (in MB) of one log file @@ -107,4 +106,4 @@ Display: -q, --quiet Silence all log output -``` +``` \ No newline at end of file diff --git a/book/cli/node.md b/book/cli/reth/node.md similarity index 98% rename from book/cli/node.md rename to book/cli/reth/node.md index 7cc4dd027532..a3a990250ef7 100644 --- a/book/cli/node.md +++ b/book/cli/reth/node.md @@ -1,10 +1,9 @@ -# `reth node` +# reth node Start the node ```bash $ reth node --help - Usage: reth node [OPTIONS] Options: @@ -94,7 +93,7 @@ Networking: --identity Custom node identity - [default: reth/v0.1.0-alpha.13-10a83e594/aarch64-apple-darwin] + [default: reth/v0.1.0-alpha.13-/aarch64-apple-darwin] --p2p-secret-key Secret key to use for this node. @@ -174,7 +173,7 @@ RPC: --ipcpath Filename for IPC socket/pipe within the datadir - [default: /tmp/reth.ipc] + [default: .ipc] --authrpc.addr Auth server address to listen on @@ -426,7 +425,7 @@ Logging: --log.file.directory The path to put log files in - [default: /reth/logs] + [default: /logs] --log.file.max-size The maximum size (in MB) of one log file @@ -473,4 +472,4 @@ Display: -q, --quiet Silence all log output -``` +``` \ No newline at end of file diff --git a/book/cli/recover.md b/book/cli/reth/p2p.md similarity index 51% rename from book/cli/recover.md rename to book/cli/reth/p2p.md index 3f62c15de31f..835ac0a8d600 100644 --- a/book/cli/recover.md +++ b/book/cli/reth/p2p.md @@ -1,17 +1,20 @@ -# `reth recover` +# reth p2p -Scripts for node recovery +P2P Debugging utilities ```bash -$ reth recover --help - -Usage: reth recover [OPTIONS] +$ reth p2p --help +Usage: reth p2p [OPTIONS] Commands: - storage-tries Recover the node by deleting dangling storage tries - help Print this message or the help of the given subcommand(s) + header Download block header + body Download block body + help Print this message or the help of the given subcommand(s) Options: + --config + The path to the configuration file to use. + --chain The chain this node is running. Possible values are either a built-in chain or the path to a chain specification file. @@ -21,102 +24,46 @@ Options: [default: mainnet] - --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 + --datadir + The path to the data dir for all reth files and subdirectories. - [default: 1] - - -h, --help - Print help (see a summary with '-h') - -Logging: - --log.file.directory - The path to put log files in + Defaults to the OS-specific data directory: - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` - [default: 200] + [default: default] - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + --p2p-secret-key + Secret key to use for this node. - [default: 5] + This also will deterministically set the peer ID. - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] + -d, --disable-discovery + Disable the discovery service - --log.journald - Write logs to journald + --disable-dns-discovery + Disable the DNS discovery - --log.journald.filter - The filter to use for logs written to journald - - [default: error] + --disable-discv4-discovery + Disable Discv4 discovery - --color - Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting + --discovery.addr + The UDP address to use for P2P discovery/networking - [default: always] - - Possible values: - - always: Colors on - - auto: Colors on - - never: Colors off + [default: 0.0.0.0] -Display: - -v, --verbosity... - Set the minimum log level. + --discovery.port + The UDP port to use for P2P discovery/networking - -v Errors - -vv Warnings - -vvv Info - -vvvv Debug - -vvvvv Traces (warning: very verbose!) + [default: 30303] - -q, --quiet - Silence all log output -``` - -## `reth recover storage-tries` - -Recover the node by deleting dangling storage tries - -```bash -$ reth recover storage-tries --help - -Usage: reth recover storage-tries [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] + --trusted-peer + Target trusted peer - --chain - 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] + --trusted-only + Connect only to trusted peers --instance Add a new instance of a node. @@ -129,14 +76,36 @@ Options: [default: 1] + --retries + The number of retries per request + + [default: 5] + + --nat + [default: any] + -h, --help Print help (see a summary with '-h') +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + Logging: --log.file.directory The path to put log files in - [default: /reth/logs] + [default: /logs] --log.file.max-size The maximum size (in MB) of one log file @@ -183,4 +152,4 @@ Display: -q, --quiet Silence all log output -``` +``` \ No newline at end of file diff --git a/book/cli/reth/p2p/body.md b/book/cli/reth/p2p/body.md new file mode 100644 index 000000000000..a5c3189affb7 --- /dev/null +++ b/book/cli/reth/p2p/body.md @@ -0,0 +1,79 @@ +# reth p2p body + +Download block body + +```bash +$ reth p2p body --help +Usage: reth p2p body [OPTIONS] + +Arguments: + + The block number or hash + +Options: + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/p2p/header.md b/book/cli/reth/p2p/header.md new file mode 100644 index 000000000000..52d0630e6546 --- /dev/null +++ b/book/cli/reth/p2p/header.md @@ -0,0 +1,79 @@ +# reth p2p header + +Download block header + +```bash +$ reth p2p header --help +Usage: reth p2p header [OPTIONS] + +Arguments: + + The header number or hash + +Options: + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/recover.md b/book/cli/reth/recover.md new file mode 100644 index 000000000000..5f2b79d6dd2f --- /dev/null +++ b/book/cli/reth/recover.md @@ -0,0 +1,88 @@ +# reth recover + +Scripts for node recovery + +```bash +$ reth recover --help +Usage: reth recover [OPTIONS] + +Commands: + storage-tries Recover the node by deleting dangling storage tries + help Print this message or the help of the given subcommand(s) + +Options: + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/recover/storage-tries.md b/book/cli/reth/recover/storage-tries.md new file mode 100644 index 000000000000..f13cc9e31f18 --- /dev/null +++ b/book/cli/reth/recover/storage-tries.md @@ -0,0 +1,95 @@ +# reth recover storage-tries + +Recover the node by deleting dangling storage tries + +```bash +$ reth recover storage-tries --help +Usage: reth recover storage-tries [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage.md b/book/cli/reth/stage.md new file mode 100644 index 000000000000..a0365e98f2f7 --- /dev/null +++ b/book/cli/reth/stage.md @@ -0,0 +1,91 @@ +# reth stage + +Manipulate individual stages + +```bash +$ reth stage --help +Usage: reth stage [OPTIONS] + +Commands: + run Run a single stage + drop Drop a stage's tables from the database + dump Dumps a stage from a range into a new database + unwind Unwinds a certain block range, deleting it from the database + help Print this message or the help of the given subcommand(s) + +Options: + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/drop.md b/book/cli/reth/stage/drop.md new file mode 100644 index 000000000000..97e437d87891 --- /dev/null +++ b/book/cli/reth/stage/drop.md @@ -0,0 +1,112 @@ +# reth stage drop + +Drop a stage's tables from the database + +```bash +$ reth stage drop --help +Usage: reth stage drop [OPTIONS] + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + + + [possible values: headers, bodies, senders, execution, account-hashing, storage-hashing, hashing, merkle, tx-lookup, account-history, storage-history, total-difficulty] + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/dump.md b/book/cli/reth/stage/dump.md new file mode 100644 index 000000000000..c5f08bb2f5a3 --- /dev/null +++ b/book/cli/reth/stage/dump.md @@ -0,0 +1,116 @@ +# reth stage dump + +Dumps a stage from a range into a new database + +```bash +$ reth stage dump --help +Usage: reth stage dump [OPTIONS] + +Commands: + execution Execution stage + storage-hashing StorageHashing stage + account-hashing AccountHashing stage + merkle Merkle stage + help Print this message or the help of the given subcommand(s) + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/dump/account-hashing.md b/book/cli/reth/stage/dump/account-hashing.md new file mode 100644 index 000000000000..7524e4ac7360 --- /dev/null +++ b/book/cli/reth/stage/dump/account-hashing.md @@ -0,0 +1,87 @@ +# reth stage dump account-hashing + +AccountHashing stage + +```bash +$ reth stage dump account-hashing --help +Usage: reth stage dump account-hashing [OPTIONS] --output-db --from --to + +Options: + --output-db + The path to the new database folder. + + -f, --from + From which block + + -t, --to + To which block + + -d, --dry-run + If passed, it will dry-run a stage execution from the newly created database right after dumping + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/dump/execution.md b/book/cli/reth/stage/dump/execution.md new file mode 100644 index 000000000000..2025012ad3f3 --- /dev/null +++ b/book/cli/reth/stage/dump/execution.md @@ -0,0 +1,87 @@ +# reth stage dump execution + +Execution stage + +```bash +$ reth stage dump execution --help +Usage: reth stage dump execution [OPTIONS] --output-db --from --to + +Options: + --output-db + The path to the new database folder. + + -f, --from + From which block + + -t, --to + To which block + + -d, --dry-run + If passed, it will dry-run a stage execution from the newly created database right after dumping + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/dump/merkle.md b/book/cli/reth/stage/dump/merkle.md new file mode 100644 index 000000000000..e69b51cdde9b --- /dev/null +++ b/book/cli/reth/stage/dump/merkle.md @@ -0,0 +1,87 @@ +# reth stage dump merkle + +Merkle stage + +```bash +$ reth stage dump merkle --help +Usage: reth stage dump merkle [OPTIONS] --output-db --from --to + +Options: + --output-db + The path to the new database folder. + + -f, --from + From which block + + -t, --to + To which block + + -d, --dry-run + If passed, it will dry-run a stage execution from the newly created database right after dumping + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/dump/storage-hashing.md b/book/cli/reth/stage/dump/storage-hashing.md new file mode 100644 index 000000000000..7ef46bb5f3ef --- /dev/null +++ b/book/cli/reth/stage/dump/storage-hashing.md @@ -0,0 +1,87 @@ +# reth stage dump storage-hashing + +StorageHashing stage + +```bash +$ reth stage dump storage-hashing --help +Usage: reth stage dump storage-hashing [OPTIONS] --output-db --from --to + +Options: + --output-db + The path to the new database folder. + + -f, --from + From which block + + -t, --to + To which block + + -d, --dry-run + If passed, it will dry-run a stage execution from the newly created database right after dumping + + --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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/run.md b/book/cli/reth/stage/run.md new file mode 100644 index 000000000000..c7237cbb2332 --- /dev/null +++ b/book/cli/reth/stage/run.md @@ -0,0 +1,213 @@ +# reth stage run + +Run a single stage. + +```bash +$ reth stage run --help +Usage: reth stage run [OPTIONS] --from --to + +Arguments: + + The name of the stage to run + + [possible values: headers, bodies, senders, execution, account-hashing, storage-hashing, hashing, merkle, tx-lookup, account-history, storage-history, total-difficulty] + +Options: + --config + The path to the configuration file to use. + + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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] + + --metrics + Enable Prometheus metrics. + + The metrics will be served at the given interface and port. + + --from + The height to start at + + -t, --to + The end of the stage + + --batch-size + Batch size for stage execution and unwind + + -s, --skip-unwind + Normally, running the stage requires unwinding for stages that already have been run, in order to not rewrite to the same database slots. + + You can optionally skip the unwinding phase if you're syncing a block range that has not been synced before. + + --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') + +Networking: + -d, --disable-discovery + Disable the discovery service + + --disable-dns-discovery + Disable the DNS discovery + + --disable-discv4-discovery + Disable Discv4 discovery + + --discovery.addr + The UDP address to use for P2P discovery/networking + + [default: 0.0.0.0] + + --discovery.port + The UDP port to use for P2P discovery/networking + + [default: 30303] + + --trusted-peers + Comma separated enode URLs of trusted peers for P2P connections. + + --trusted-peers enode://abcd@192.168.0.1:30303 + + --trusted-only + Connect only to trusted peers + + --bootnodes + Comma separated enode URLs for P2P discovery bootstrap. + + Will fall back to a network-specific default if not specified. + + --peers-file + The path to the known peers file. Connected peers are dumped to this file on nodes + shutdown, and read on startup. Cannot be used with `--no-persist-peers`. + + --identity + Custom node identity + + [default: reth/v0.1.0-alpha.13-/aarch64-apple-darwin] + + --p2p-secret-key + Secret key to use for this node. + + This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used. + + --no-persist-peers + Do not persist peers. + + --nat + NAT resolution method (any|none|upnp|publicip|extip:) + + [default: any] + + --addr + Network listening address + + [default: 0.0.0.0] + + --port + Network listening port + + [default: 30303] + + --max-outbound-peers + Maximum number of outbound requests. default: 100 + + --max-inbound-peers + Maximum number of inbound requests. default: 30 + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + + -c, --commit + Commits the changes in the database. WARNING: potentially destructive. + + Useful when you want to run diagnostics on the database. + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/unwind.md b/book/cli/reth/stage/unwind.md new file mode 100644 index 000000000000..6e276803b548 --- /dev/null +++ b/book/cli/reth/stage/unwind.md @@ -0,0 +1,114 @@ +# reth stage unwind + +Unwinds a certain block range, deleting it from the database + +```bash +$ reth stage unwind --help +Usage: reth stage unwind [OPTIONS] + +Commands: + to-block Unwinds the database until the given block number (range is inclusive) + num-blocks Unwinds the given number of blocks from the database + help Print this message or the help of the given subcommand(s) + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Database: + --db.log-level + Database logging level. Levels higher than "notice" require a debug build + + Possible values: + - fatal: Enables logging for critical conditions, i.e. assertion failures + - error: Enables logging for error conditions + - warn: Enables logging for warning conditions + - notice: Enables logging for normal but significant condition + - verbose: Enables logging for verbose informational + - debug: Enables logging for debug-level messages + - trace: Enables logging for trace debug-level messages + - extra: Enables logging for extra debug-level messages + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/unwind/num-blocks.md b/book/cli/reth/stage/unwind/num-blocks.md new file mode 100644 index 000000000000..0a9bc15c2adf --- /dev/null +++ b/book/cli/reth/stage/unwind/num-blocks.md @@ -0,0 +1,99 @@ +# reth stage unwind num-blocks + +Unwinds the given number of blocks from the database + +```bash +$ reth stage unwind num-blocks --help +Usage: reth stage unwind num-blocks [OPTIONS] + +Arguments: + + + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/stage/unwind/to-block.md b/book/cli/reth/stage/unwind/to-block.md new file mode 100644 index 000000000000..d3a5cc712af7 --- /dev/null +++ b/book/cli/reth/stage/unwind/to-block.md @@ -0,0 +1,99 @@ +# reth stage unwind to-block + +Unwinds the database until the given block number (range is inclusive) + +```bash +$ reth stage unwind to-block --help +Usage: reth stage unwind to-block [OPTIONS] + +Arguments: + + + +Options: + --datadir + The path to the data dir for all reth files and subdirectories. + + Defaults to the OS-specific data directory: + + - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` + - Windows: `{FOLDERID_RoamingAppData}/reth/` + - macOS: `$HOME/Library/Application Support/reth/` + + [default: default] + + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/test-vectors.md b/book/cli/reth/test-vectors.md new file mode 100644 index 000000000000..b79b399dd7f3 --- /dev/null +++ b/book/cli/reth/test-vectors.md @@ -0,0 +1,88 @@ +# reth test-vectors + +Generate Test Vectors + +```bash +$ reth test-vectors --help +Usage: reth test-vectors [OPTIONS] + +Commands: + tables Generates test vectors for specified tables. If no table is specified, generate for all + help Print this message or the help of the given subcommand(s) + +Options: + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/reth/test-vectors/tables.md b/book/cli/reth/test-vectors/tables.md new file mode 100644 index 000000000000..f54af54b3acb --- /dev/null +++ b/book/cli/reth/test-vectors/tables.md @@ -0,0 +1,88 @@ +# reth test-vectors tables + +Generates test vectors for specified tables. If no table is specified, generate for all + +```bash +$ reth test-vectors tables --help +Usage: reth test-vectors tables [OPTIONS] [NAMES]... + +Arguments: + [NAMES]... + List of table names. Case-sensitive + +Options: + --chain + 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 + 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') + +Logging: + --log.file.directory + The path to put log files in + + [default: /logs] + + --log.file.max-size + The maximum size (in MB) of one log file + + [default: 200] + + --log.file.max-files + The maximum amount of log files that will be stored. If set to 0, background file logging is disabled + + [default: 5] + + --log.file.filter + The filter to use for logs written to the log file + + [default: debug] + + --log.journald + Write logs to journald + + --log.journald.filter + The filter to use for logs written to journald + + [default: error] + + --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 +``` \ No newline at end of file diff --git a/book/cli/stage.md b/book/cli/stage.md deleted file mode 100644 index 057267624a32..000000000000 --- a/book/cli/stage.md +++ /dev/null @@ -1,1215 +0,0 @@ -# `reth stage` - -Manipulate individual stages - -```bash -$ reth stage --help - -Usage: reth stage [OPTIONS] - -Commands: - run Run a single stage - drop Drop a stage's tables from the database - dump Dumps a stage from a range into a new database - unwind Unwinds a certain block range, deleting it from the database - help Print this message or the help of the given subcommand(s) - -Options: - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth stage drop` - -Drop a stage's tables from the database - -```bash -$ reth stage drop --help - -Usage: reth stage drop [OPTIONS] - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - - - [possible values: headers, bodies, senders, execution, account-hashing, storage-hashing, hashing, merkle, tx-lookup, account-history, storage-history, total-difficulty] - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth stage dump` - -Dumps a stage from a range into a new database - -```bash -$ reth stage dump --help - -Usage: reth stage dump [OPTIONS] - -Commands: - execution Execution stage - storage-hashing StorageHashing stage - account-hashing AccountHashing stage - merkle Merkle stage - help Print this message or the help of the given subcommand(s) - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage dump execution` - -Execution stage - -```bash -$ reth stage dump execution --help - -Usage: reth stage dump execution [OPTIONS] --output-db --from --to - -Options: - --output-db - The path to the new database folder. - - -f, --from - From which block - - -t, --to - To which block - - -d, --dry-run - If passed, it will dry-run a stage execution from the newly created database right after dumping - - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage dump storage-hashing` - -StorageHashing stage - -```bash -$ reth stage dump storage-hashing --help - -Usage: reth stage dump storage-hashing [OPTIONS] --output-db --from --to - -Options: - --output-db - The path to the new database folder. - - -f, --from - From which block - - -t, --to - To which block - - -d, --dry-run - If passed, it will dry-run a stage execution from the newly created database right after dumping - - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage dump account-hashing` - -AccountHashing stage - -```bash -$ reth stage dump account-hashing --help - -Usage: reth stage dump account-hashing [OPTIONS] --output-db --from --to - -Options: - --output-db - The path to the new database folder. - - -f, --from - From which block - - -t, --to - To which block - - -d, --dry-run - If passed, it will dry-run a stage execution from the newly created database right after dumping - - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage dump merkle` - -Merkle stage - -```bash -$ reth stage dump merkle --help - -Usage: reth stage dump merkle [OPTIONS] --output-db --from --to - -Options: - --output-db - The path to the new database folder. - - -f, --from - From which block - - -t, --to - To which block - - -d, --dry-run - If passed, it will dry-run a stage execution from the newly created database right after dumping - - --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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth stage run` - -Run a single stage. - -```bash -$ reth stage run --help - -Note that this won't use the Pipeline and as a result runs stages assuming that all the data can be held in memory. It is not recommended to run a stage for really large block ranges if your computer does not have a lot of memory to store all the data. - -Usage: reth stage run [OPTIONS] --from --to - -Arguments: - - The name of the stage to run - - [possible values: headers, bodies, senders, execution, account-hashing, storage-hashing, hashing, merkle, tx-lookup, account-history, storage-history, total-difficulty] - -Options: - --config - The path to the configuration file to use. - - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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] - - --metrics - Enable Prometheus metrics. - - The metrics will be served at the given interface and port. - - --from - The height to start at - - -t, --to - The end of the stage - - --batch-size - Batch size for stage execution and unwind - - -s, --skip-unwind - Normally, running the stage requires unwinding for stages that already have been run, in order to not rewrite to the same database slots. - - You can optionally skip the unwinding phase if you're syncing a block range that has not been synced before. - - --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') - -Networking: - -d, --disable-discovery - Disable the discovery service - - --disable-dns-discovery - Disable the DNS discovery - - --disable-discv4-discovery - Disable Discv4 discovery - - --discovery.addr - The UDP address to use for P2P discovery/networking - - [default: 0.0.0.0] - - --discovery.port - The UDP port to use for P2P discovery/networking - - [default: 30303] - - --trusted-peers - Comma separated enode URLs of trusted peers for P2P connections. - - --trusted-peers enode://abcd@192.168.0.1:30303 - - --trusted-only - Connect only to trusted peers - - --bootnodes - Comma separated enode URLs for P2P discovery bootstrap. - - Will fall back to a network-specific default if not specified. - - --peers-file - The path to the known peers file. Connected peers are dumped to this file on nodes - shutdown, and read on startup. Cannot be used with `--no-persist-peers`. - - --identity - Custom node identity - - [default: reth/v0.1.0-alpha.13-10a83e594/aarch64-apple-darwin] - - --p2p-secret-key - Secret key to use for this node. - - This will also deterministically set the peer ID. If not specified, it will be set in the data dir for the chain being used. - - --no-persist-peers - Do not persist peers. - - --nat - NAT resolution method (any|none|upnp|publicip|extip:) - - [default: any] - - --addr - Network listening address - - [default: 0.0.0.0] - - --port - Network listening port - - [default: 30303] - - --max-outbound-peers - Maximum number of outbound requests. default: 100 - - --max-inbound-peers - Maximum number of inbound requests. default: 30 - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - - -c, --commit - Commits the changes in the database. WARNING: potentially destructive. - - Useful when you want to run diagnostics on the database. - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth stage unwind` - -Unwinds a certain block range, deleting it from the database - -```bash -$ reth stage unwind --help - -Usage: reth stage unwind [OPTIONS] - -Commands: - to-block Unwinds the database until the given block number (range is inclusive) - num-blocks Unwinds the given number of blocks from the database - help Print this message or the help of the given subcommand(s) - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Database: - --db.log-level - Database logging level. Levels higher than "notice" require a debug build - - Possible values: - - fatal: Enables logging for critical conditions, i.e. assertion failures - - error: Enables logging for error conditions - - warn: Enables logging for warning conditions - - notice: Enables logging for normal but significant condition - - verbose: Enables logging for verbose informational - - debug: Enables logging for debug-level messages - - trace: Enables logging for trace debug-level messages - - extra: Enables logging for extra debug-level messages - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage unwind to-block` - -Unwinds the database until the given block number (range is inclusive) - -```bash -$ reth stage unwind to-block --help - -Usage: reth stage unwind to-block [OPTIONS] - -Arguments: - - - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -### `reth stage unwind num-blocks` - -Unwinds the given number of blocks from the database - -```bash -$ reth stage unwind num-blocks --help - -Usage: reth stage unwind num-blocks [OPTIONS] - -Arguments: - - - -Options: - --datadir - The path to the data dir for all reth files and subdirectories. - - Defaults to the OS-specific data directory: - - - Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/` - - Windows: `{FOLDERID_RoamingAppData}/reth/` - - macOS: `$HOME/Library/Application Support/reth/` - - [default: default] - - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` diff --git a/book/cli/test-vectors.md b/book/cli/test-vectors.md deleted file mode 100644 index 13dfd0e79319..000000000000 --- a/book/cli/test-vectors.md +++ /dev/null @@ -1,179 +0,0 @@ -# `reth test-vectors` - -Generate Test Vectors - -```bash -$ reth test-vectors --help - -Usage: reth test-vectors [OPTIONS] - -Commands: - tables Generates test vectors for specified tables. If no table is specified, generate for all - help Print this message or the help of the given subcommand(s) - -Options: - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` - -## `reth test-vectors tables` - -Generates test vectors for specified tables. If no table is specified, generate for all - -```bash -$ reth test-vectors tables --help - -Usage: reth test-vectors tables [OPTIONS] [NAMES]... - -Arguments: - [NAMES]... - List of table names. Case-sensitive - -Options: - --chain - 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 - 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') - -Logging: - --log.file.directory - The path to put log files in - - [default: /reth/logs] - - --log.file.max-size - The maximum size (in MB) of one log file - - [default: 200] - - --log.file.max-files - The maximum amount of log files that will be stored. If set to 0, background file logging is disabled - - [default: 5] - - --log.file.filter - The filter to use for logs written to the log file - - [default: debug] - - --log.journald - Write logs to journald - - --log.journald.filter - The filter to use for logs written to journald - - [default: error] - - --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 -``` diff --git a/book/cli/update.sh b/book/cli/update.sh index ca7722e3f337..bffacf287760 100755 --- a/book/cli/update.sh +++ b/book/cli/update.sh @@ -1,128 +1,16 @@ -#!/bin/bash - -# Define the build path. -build_path=$1 -if [ -z "$build_path" ]; then - echo "Build path variable is not defined. Exiting..." - exit 1 -fi -reth_path=./$build_path/debug/reth -echo "Using reth path: $reth_path (build path: $build_path)" - -# Define the path to the JSON configuration file. -json_file="./book/cli/config.json" -echo "Using config file: $json_file" - -# Read commands from JSON configuration file. -read_cmds_from_json() { - local json_file="$1" - jq -r '.commands | keys[]' "$json_file" -} - -# Read subcommands for a given command from JSON configuration file. -read_subcmds_from_json() { - local json_file="$1" - local cmd="$2" - jq -r ".commands[\"$cmd\"] | if type == \"object\" then keys[] else .[] end" "$json_file" -} - -# Read subsubcommands for a given command and subcommand from JSON configuration file. -read_subsubcmds_from_json() { - local json_file="$1" - local cmd="$2" - local subcmd="$3" - jq -r ".commands[\"$cmd\"][\"$subcmd\"][]" "$json_file" -} - -# Update the main documentation. -update_main_doc() { - local file_path="./book/cli/cli.md" - local cmd_help_output=$($reth_path --help) - sed -i -e '/## Commands/,$d' "$file_path" - cat >> "$file_path" << EOF -## Commands - -\`\`\`bash -$ reth --help -$cmd_help_output -\`\`\` -EOF -} - -# Update any `reth` command documentation. -update_cli_cmd() { - local cmd="$1" - local subcmds=("${@:2}") - echo "reth $cmd" - - local cmd_help_output=$($reth_path "$cmd" --help) - local description=$(echo "$cmd_help_output" | head -n 1) - cat > "./book/cli/$cmd.md" << EOF -# \`reth $cmd\` - -$(if [[ -n "$description" ]]; then echo "$description"; fi) - -\`\`\`bash -$ reth $cmd --help -$(echo "$cmd_help_output" | sed '1d') -\`\`\` -EOF - - for subcmd in "${subcmds[@]}"; do - echo " ├── $subcmd" - - local subcmd_help_output=$($reth_path "$cmd" "$subcmd" --help) - local subcmd_description=$(echo "$subcmd_help_output" | head -n 1) - cat >> "book/cli/$cmd.md" << EOF - -## \`reth $cmd $subcmd\` - -$(if [[ -n "$subcmd_description" ]]; then echo "$subcmd_description"; fi) - -\`\`\`bash -$ reth $cmd $subcmd --help -$(echo "$subcmd_help_output" | sed '1d') -\`\`\` -EOF - - # Read subsubcommands and update documentation - subsubcmds=($(read_subsubcmds_from_json "$json_file" "$cmd" "$subcmd")) - for subsubcmd in "${subsubcmds[@]}"; do - echo " ├── $subsubcmd" - - local subsubcmd_help_output=$($reth_path "$cmd" "$subcmd" "$subsubcmd" --help) - local subsubcmd_description=$(echo "$subsubcmd_help_output" | head -n 1) - cat >> "book/cli/$cmd.md" << EOF - -### \`reth $cmd $subcmd $subsubcmd\` - -$(if [[ -n "$subsubcmd_description" ]]; then echo "$subsubcmd_description"; fi) - -\`\`\`bash -$ reth $cmd $subcmd $subsubcmd --help -$(echo "$subsubcmd_help_output" | sed '1d') -\`\`\` -EOF - done - done -} - -# Update the book CLI documentation. -main() { - update_main_doc - - # Update commands doc. - cmds=($(read_cmds_from_json "$json_file")) - for cmd in "${cmds[@]}"; do - subcmds=($(read_subcmds_from_json "$json_file" "$cmd")) - update_cli_cmd "$cmd" "${subcmds[@]}" - done - - # Update default paths on both Linux and macOS to avoid triggering the CI. - sed -i -e 's/default: \/.*\/reth\//default: \/reth\//g' ./book/cli/*.md - rm ./book/cli/*.md-e - - echo "Book updated successfully." -} - -main +#!/usr/bin/env bash +set -eo pipefail + +BOOK_ROOT="$(dirname "$(dirname "$0")")" +RETH=${1:-"$(dirname "$BOOK_ROOT")/target/debug/reth"} + +cmd=( + "$(dirname "$0")/help.py" + --root-dir "$BOOK_ROOT/" + --root-indentation 2 + --root-summary + --out-dir "$BOOK_ROOT/cli/" + "$RETH" +) +echo "Running: $" "${cmd[*]}" +"${cmd[@]}" diff --git a/book/run/mainnet.md b/book/run/mainnet.md index e2f1c07e42a6..67e70b9dbf20 100644 --- a/book/run/mainnet.md +++ b/book/run/mainnet.md @@ -30,7 +30,7 @@ RUST_LOG=info reth node --full On differences between archive and full nodes, see [Pruning & Full Node](./pruning.md#basic-concepts) section. -> Note that these commands will not open any HTTP/WS ports by default. You can change this by adding the `--http`, `--ws` flags, respectively and using the `--http.api` and `--ws.api` flags to enable various [JSON-RPC APIs](../jsonrpc/intro.md). For more commands, see the [`reth node` CLI reference](../cli/node.md). +> Note that these commands will not open any HTTP/WS ports by default. You can change this by adding the `--http`, `--ws` flags, respectively and using the `--http.api` and `--ws.api` flags to enable various [JSON-RPC APIs](../jsonrpc/intro.md). For more commands, see the [`reth node` CLI reference](../cli/reth/node.md). The EL <> CL communication happens over the [Engine API](https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md), which is by default exposed at `http://localhost:8551`. The connection is authenticated over JWT using a JWT secret which is auto-generated by Reth and placed in a file called `jwt.hex` in the data directory, which on Linux by default is `$HOME/.local/share/reth/` (`/Users//Library/Application Support/reth/mainnet/jwt.hex` in Mac). diff --git a/book/run/troubleshooting.md b/book/run/troubleshooting.md index f9a6bd25c8a3..fa888139f539 100644 --- a/book/run/troubleshooting.md +++ b/book/run/troubleshooting.md @@ -61,7 +61,7 @@ is less than 1 second. It will take the same time as initial sync. 1. Stop Reth -2. Drop the database using [`reth db drop`](../cli/db.md#reth-db-drop) +2. Drop the database using [`reth db drop`](../cli/reth/db/drop.md) 3. Start reth ### Database write error @@ -110,4 +110,4 @@ pthread_mutex_lock.c:438: __pthread_mutex_lock_full: Assertion `e != ESRCH || !r If you are using Docker, a possible solution is to run all database-accessing containers with `--pid=host` flag. -For more information, check out the `Containers` section in the [libmdbx README](https://github.com/erthink/libmdbx#containers). \ No newline at end of file +For more information, check out the `Containers` section in the [libmdbx README](https://github.com/erthink/libmdbx#containers).