Skip to content

Commit

Permalink
Merge branch 'paradigmxyz:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
joroshiba committed Sep 20, 2023
2 parents 02e3d08 + a29f102 commit 747dbc7
Show file tree
Hide file tree
Showing 84 changed files with 1,626 additions and 2,210 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions bin/reth/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use reth_db::{
tables,
transaction::{DbTx, DbTxMut},
};
use reth_interfaces::{db::DatabaseError, RethError};
use reth_primitives::{stage::StageId, Account, Bytecode, ChainSpec, StorageEntry, H256, U256};
use reth_provider::{
bundle_state::{BundleStateInit, RevertsInit},
Expand Down Expand Up @@ -32,11 +33,11 @@ pub enum InitDatabaseError {

/// Low-level database error.
#[error(transparent)]
DBError(#[from] reth_db::DatabaseError),
DBError(#[from] DatabaseError),

/// Internal error.
#[error(transparent)]
InternalError(#[from] reth_interfaces::Error),
InternalError(#[from] RethError),
}

/// Write the genesis block if it has not already been written
Expand Down
7 changes: 4 additions & 3 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use reth_interfaces::{
either::EitherDownloader,
headers::{client::HeadersClient, downloader::HeaderDownloader},
},
RethResult,
};
use reth_network::{error::NetworkError, NetworkConfig, NetworkHandle, NetworkManager};
use reth_network_api::NetworkInfo;
Expand Down Expand Up @@ -664,7 +665,7 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
Ok(handle)
}

fn lookup_head(&self, db: Arc<DatabaseEnv>) -> Result<Head, reth_interfaces::Error> {
fn lookup_head(&self, db: Arc<DatabaseEnv>) -> RethResult<Head> {
let factory = ProviderFactory::new(db, self.chain.clone());
let provider = factory.provider()?;

Expand Down Expand Up @@ -700,7 +701,7 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
db: DB,
client: Client,
tip: H256,
) -> Result<u64, reth_interfaces::Error>
) -> RethResult<u64>
where
DB: Database,
Client: HeadersClient,
Expand All @@ -716,7 +717,7 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
db: DB,
client: Client,
tip: BlockHashOrNumber,
) -> Result<SealedHeader, reth_interfaces::Error>
) -> RethResult<SealedHeader>
where
DB: Database,
Client: HeadersClient,
Expand Down
1 change: 1 addition & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
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)
77 changes: 54 additions & 23 deletions book/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,64 @@ Reth
Usage: reth [OPTIONS] <COMMAND>

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

Options:
--chain <CHAIN_OR_PATH>
The chain this node is running.

Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
- mainnet
- goerli
- sepolia

[default: mainnet]

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

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

Max number of instances is 200. It is chosen in a way so that it's not possible to have port numbers that conflict with each other.
Changes to the following port numbers: - DISCOVERY_PORT: default + `instance` - 1 - AUTH_PORT: default + `instance` * 100 - 100 - HTTP_RPC_PORT: default - `instance` + 1 - WS_RPC_PORT: default + `instance` * 2 - 2
[default: 1]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Logging:
--log.persistent
The flag to enable persistent logs

--log.directory <PATH>
The path to put log files in
[default: /reth/logs]
--log.max-size <SIZE>
The maximum size (in MB) of log files
[default: 200]
--log.max-files <COUNT>
The maximum amount of log files that will be stored. If set to 0, background file logging is disabled
[default: 5]
--log.journald
Log events to journald
Expand All @@ -75,6 +96,16 @@ Logging:
[default: error]
--color <COLOR>
Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting
[default: always]
Possible values:
- always: Colors on
- auto: Colors on
- never: Colors off
Display:
-v, --verbosity...
Set the minimum log level.
Expand Down
8 changes: 7 additions & 1 deletion book/cli/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
"db": {
"stats": [],
"list": [],
"diff": [],
"get": [],
"drop": [],
"clear": [],
"version": [],
"path": []
},
"debug": {
"execution": [],
"merkle": []
"merkle": [],
"in-memory-merkle": []
},
"import": [],
"init": [],
Expand All @@ -20,6 +23,9 @@
"header": [],
"body": []
},
"recover": {
"storage-tries": []
},
"stage": {
"run": [],
"drop": [],
Expand Down
46 changes: 43 additions & 3 deletions book/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,48 @@ Options:
--default
Show the default config

--chain <CHAIN_OR_PATH>
The chain this node is running.

Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
- mainnet
- goerli
- sepolia

[default: mainnet]

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

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

Max number of instances is 200. It is chosen in a way so that it's not possible to have port numbers that conflict with each other.
Changes to the following port numbers: - DISCOVERY_PORT: default + `instance` - 1 - AUTH_PORT: default + `instance` * 100 - 100 - HTTP_RPC_PORT: default - `instance` + 1 - WS_RPC_PORT: default + `instance` * 2 - 2
[default: 1]
-h, --help
Print help (see a summary with '-h')
Logging:
--log.persistent
The flag to enable persistent logs

--log.directory <PATH>
The path to put log files in
[default: /reth/logs]
--log.max-size <SIZE>
The maximum size (in MB) of log files
[default: 200]
--log.max-files <COUNT>
The maximum amount of log files that will be stored. If set to 0, background file logging is disabled
[default: 5]
--log.journald
Log events to journald
Expand All @@ -34,6 +64,16 @@ Logging:
[default: error]
--color <COLOR>
Sets whether or not the formatter emits ANSI terminal escape codes for colors and other text formatting
[default: always]
Possible values:
- always: Colors on
- auto: Colors on
- never: Colors off
Display:
-v, --verbosity...
Set the minimum log level.
Expand Down
Loading

0 comments on commit 747dbc7

Please sign in to comment.