Skip to content
← Browse all courses
Reth topic

Reth NodeBuilder

NodeBuilder is how a Reth-based chain becomes a binary. It takes a NodeConfig (which includes the ChainSpec), a database and a task executor, then the node's types and components (pool, network, payload builder, EVM, consensus) and add-ons such as RPC, and launches the node.

Each component slot is where a custom chain differs: swap the consensus, the EVM config or the payload builder and keep the rest of Reth.

API at a glance

NodeConfig::new(chain) / NodeConfig::test().dev().with_chain(spec)
The node's configuration: chain spec, datadir, RPC, network, dev mode. with_chain, with_rpc and with_datadir_args set the parts.
NodeBuilder::new(config).with_database(db).with_launch_context(executor)
Supplies the database and the task executor. testing_node(executor) (feature test-utils) does both with a temporary database for tests.
.node(EthereumNode::default())
Takes types, components and add-ons from a preset node in one call.
.with_types::<N>().with_components(…).with_add_ons(…)
The same steps one at a time, so a single component (consensus, EVM, payload builder) can be replaced.
.install_exex(id, f) / .extend_rpc_modules(f) / .on_node_started(f)
Hooks before launch: an Execution Extension, extra RPC namespaces, a callback once the node runs.
.launch().await → NodeHandle { node, node_exit_future }
Starts the node. node gives the provider, pool, network and, through the add-ons handle, the RPC registry; await node_exit_future to run until shutdown.

Checked against paradigmxyz/reth at eb4c15e (2026-04-07): crates/node/builder/src/builder/mod.rs, crates/node/builder/src/handle.rs, crates/node/builder/src/node.rs, crates/node/core/src/node_config.rs

Lessons on this topic