Files
reth/examples
Matthias Seitz 4b3f53915a docs: apply spelling and grammar fixes from unmerged PRs
Apply spelling, grammar, and documentation fixes from 20 unmerged PRs
with the spelling label. Changes include:

- Fix documentation typos and grammar issues across codebase
- Update broken links to use new reth.rs domain
- Correct RPC method names in trace API documentation
- Fix technical terminology (NVMe, Rlpx, etc.)
- Improve code comments for clarity
- Fix assertion error messages to reference correct variables
- Update era1 block index documentation

Co-Authored-By: Jennifer Paffrath <jennifer@paffrath.io>
Co-Authored-By: Max <max@digi.net>
2025-10-02 12:43:28 +02:00
..
2025-05-03 13:44:52 +02:00
2025-04-24 08:06:06 +00:00

Examples

These examples demonstrate the main features of some of Reth's crates and how to use them.

To run an example, use the command cargo run -p <example>.

If you've got an example you'd like to see here, please feel free to open an issue. Otherwise if you've got an example you'd like to add, please feel free to make a PR!

Node Builder

Example Description
Additional RPC namespace Illustrates how to add custom CLI parameters and set up a custom RPC namespace
Custom event hooks Illustrates how to hook to various node lifecycle events
Custom dev node Illustrates how to run a custom dev node programmatically and submit a transaction to it via RPC
Custom EVM Illustrates how to implement a node with a custom EVM
Custom Precompile Cache Illustrates how to implement a node with a stateful precompile cache
Custom inspector Illustrates how to use a custom EVM inspector to trace new transactions
Custom engine types Illustrates how to create a node with custom engine types
Custom node components Illustrates how to configure custom node components
Custom payload builder Illustrates how to use a custom payload builder

ExEx

See examples in a dedicated repository.

RPC

Example Description
DB over RPC Illustrates how to run a standalone RPC server over a Reth database instance

Database

Example Description
DB access Illustrates how to access Reth's database in a separate process

Network

Example Description
Standalone network Illustrates how to use the network as a standalone component

Mempool

Example Description
Trace pending transactions Illustrates how to trace pending transactions as they arrive in the mempool
Standalone txpool Illustrates how to use the network as a standalone component together with a transaction pool with a custom pool validator

P2P

Example Description
Manual P2P Illustrates how to connect and communicate with a peer
Polygon P2P Illustrates how to connect and communicate with a peer on Polygon
BSC P2P Illustrates how to connect and communicate with a peer on Binance Smart Chain

Misc

Example Description
Beacon API SSE Illustrates how to subscribe to beacon chain events via SSE