reth/
lib.rs

1//! Rust Ethereum (reth) binary executable.
2//!
3//! ## Feature Flags
4//!
5//! - `jemalloc`: Uses [jemallocator](https://github.com/tikv/jemallocator) as the global allocator.
6//!   This is **not recommended on Windows**. See [here](https://rust-lang.github.io/rfcs/1974-global-allocators.html#jemalloc)
7//!   for more info.
8//! - `jemalloc-prof`: Enables [jemallocator's](https://github.com/tikv/jemallocator) heap profiling
9//!   and leak detection functionality. See [jemalloc's opt.prof](https://jemalloc.net/jemalloc.3.html#opt.prof)
10//!   documentation for usage details. This is **not recommended on Windows**. See [here](https://rust-lang.github.io/rfcs/1974-global-allocators.html#jemalloc)
11//!   for more info.
12//! - `asm-keccak`: replaces the default, pure-Rust implementation of Keccak256 with one implemented
13//!   in assembly; see [the `keccak-asm` crate](https://github.com/DaniPopes/keccak-asm) for more
14//!   details and supported targets
15//! - `min-error-logs`: Disables all logs below `error` level.
16//! - `min-warn-logs`: Disables all logs below `warn` level.
17//! - `min-info-logs`: Disables all logs below `info` level. This can speed up the node, since fewer
18//!   calls to the logging component are made.
19//! - `min-debug-logs`: Disables all logs below `debug` level.
20//! - `min-trace-logs`: Disables all logs below `trace` level.
21
22#![doc(
23    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
24    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
25    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
26)]
27#![cfg_attr(not(test), warn(unused_crate_dependencies))]
28#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
29
30pub mod cli;
31
32/// Re-exported utils.
33pub mod utils {
34    pub use reth_db::open_db_read_only;
35
36    /// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment
37    /// on the `reth_node_core::args` re-export for more details.
38    pub use reth_node_core::utils::*;
39}
40
41/// Re-exported payload related types
42pub mod payload {
43    pub use reth_ethereum_payload_builder::EthereumExecutionPayloadValidator;
44    pub use reth_payload_builder::*;
45    pub use reth_payload_primitives::*;
46}
47
48/// Re-exported from `reth_node_api`.
49pub mod api {
50    pub use reth_node_api::*;
51}
52
53/// Re-exported from `reth_node_core`.
54pub mod core {
55    pub use reth_node_core::*;
56}
57
58/// Re-exported from `reth_node_metrics`.
59pub mod prometheus_exporter {
60    pub use reth_node_metrics::recorder::*;
61}
62
63/// Re-export of the `reth_node_core` types specifically in the `args` module.
64///
65/// This is re-exported because the types in `reth_node_core::args` originally existed in
66/// `reth::args` but were moved to the `reth_node_core` crate. This re-export avoids a breaking
67/// change.
68pub mod args {
69    pub use reth_node_core::args::*;
70}
71
72/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
73/// the `reth_node_core::args` re-export for more details.
74pub mod version {
75    pub use reth_node_core::version::*;
76}
77
78/// Re-exported from `reth_node_builder`
79pub mod builder {
80    pub use reth_node_builder::*;
81}
82
83/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
84/// the `reth_node_core::args` re-export for more details.
85pub mod dirs {
86    pub use reth_node_core::dirs::*;
87}
88
89/// Re-exported from `reth_chainspec`
90pub mod chainspec {
91    pub use reth_chainspec::*;
92    pub use reth_ethereum_cli::chainspec::*;
93}
94
95/// Re-exported from `reth_provider`.
96pub mod providers {
97    pub use reth_provider::*;
98}
99
100/// Re-exported from `reth_primitives`.
101pub mod primitives {
102    pub use reth_primitives::*;
103}
104
105/// Re-exported from `reth_ethereum_consensus`.
106pub mod beacon_consensus {
107    pub use reth_node_ethereum::consensus::*;
108}
109
110/// Re-exported from `reth_consensus`.
111pub mod consensus {
112    pub use reth_consensus::*;
113}
114
115/// Re-exported from `reth_consensus_common`.
116pub mod consensus_common {
117    pub use reth_consensus_common::*;
118}
119
120/// Re-exported from `reth_revm`.
121pub mod revm {
122    pub use reth_revm::*;
123}
124
125/// Re-exported from `reth_tasks`.
126pub mod tasks {
127    pub use reth_tasks::*;
128}
129
130/// Re-exported from `reth_network`.
131pub mod network {
132    pub use reth_network::*;
133    pub use reth_network_api::{
134        noop, test_utils::PeersHandleProvider, NetworkInfo, Peers, PeersInfo,
135    };
136}
137
138/// Re-exported from `reth_transaction_pool`.
139pub mod transaction_pool {
140    pub use reth_transaction_pool::*;
141}
142
143/// Re-export of `reth_rpc_*` crates.
144pub mod rpc {
145    /// Re-exported from `reth_rpc_builder`.
146    pub mod builder {
147        pub use reth_rpc_builder::*;
148    }
149
150    /// Re-exported from `alloy_rpc_types`.
151    pub mod types {
152        pub use alloy_rpc_types::*;
153    }
154
155    /// Re-exported from `reth_rpc_server_types`.
156    pub mod server_types {
157        pub use reth_rpc_server_types::*;
158        /// Re-exported from `reth_rpc_eth_types`.
159        pub mod eth {
160            pub use reth_rpc_eth_types::*;
161        }
162    }
163
164    /// Re-exported from `reth_rpc_api`.
165    pub mod api {
166        pub use reth_rpc_api::*;
167    }
168    /// Re-exported from `reth_rpc::eth`.
169    pub mod eth {
170        pub use reth_rpc::eth::*;
171    }
172
173    /// Re-exported from `reth_rpc::rpc`.
174    pub mod result {
175        pub use reth_rpc_server_types::result::*;
176    }
177
178    /// Re-exported from `reth_rpc_types_compat`.
179    pub mod compat {
180        pub use reth_rpc_types_compat::*;
181    }
182}
183
184/// Ress subprotocol installation.
185pub mod ress;
186
187// re-export for convenience
188#[doc(inline)]
189pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner};
190
191// for rendering diagrams
192use aquamarine as _;
193
194// used in main
195use clap as _;
196use reth_cli_util as _;