Files
nanoreth/examples
arb00r 28f6c1e6be Local block sync (#7)
* update: logs

* update: more logging

* update: rename local ingest dir args

* update: fix build

* update: directory path

* update: logs

* update: log ts

* update: fetch last block

* update: time formatting

* update: handle seconds

* update: lmore logs

* fix: provided args

* update: logs

* fix: build

* update: indefinite wiat

* update: run the right loop

* update: remove offset

* update: scan impl

* update: log exists

* update: collect s3 blocks

* update: change the file

* update: logs

* fix: deserialization

* fix: build

* update: remove block

* update: add logs

* update: logs

* update: logs

* update: dates

* update: ignore older blocks

* update: hook up to sync

* fix: build

* fix: build

* update: logs

* update: logs

* update: start height cond

* update: height

* update: loggy

* update: cond

* update: cond

* update: cond

* update: logs

* update: fix height issues

* update: logs

* only collect s3

* update: log block

* update: log both blocks

* update; return s3 block

* update: use local block

* update: blocks

* update: remove logs

* update: logs

* update: remove warns and logs

* update: collection log

* update: logs

* update: logs

* update: scan through heights when registering evm

* update: add local ingest dir to other evm factory

* fix: build

* update: add cli cmd

* update: remove additional arg

* update: change where local ingest dir comes from

* fix: receipts

* update: deser format

* update: fix build

* update: logs

* update: logs

* update: logs

* update: logs

* update: share precompiles with engine

* update: insert compiles

* update: change sync dir

* update: logs

* update: logs

* update: logs

* update: fix build

* update: pipe builder context through

* update: untracked

* update: pass through context

* fix: build

* fix: build

* update: logs

* update: logs

* update: logs

* update: fix cache passthrough

* update: remove logs

* update: logs

* update: hour rollover

* update: zero out hour

* update: hour sync

* update: cleanup code and speedup sync

* update: speedup sync

* update: remove logs

* update: speed up sync

* update: speed up sync

* update: ingest in reverse

* fix: iter rev

* update: break line loop early

* update: remove break

* update: iteration speed

* update: fix build

* update: slow down tail ival

* update: logs

* update: skip last line

* update: remove log

* update: height

* update: logs

* update: return logs

* update: disable attempt logs

* update: tail interval

* update: cleanup logs

* update: add iter skip

* update: fix build

* update: skip -1

* fix: skip

* fix: build

* update: build

* fix: build

* update: logs

* update: log idx

* update: skip after enumerate

* update: cleanup

* update: more cleanup

* update: refactor BuilderSharedState to HyperliquidSharedState

* update: more cleanup

* update: cleanup and refactor collect_local_block

* update: error msg

* update: readme

* update: typo

* update: file log

* fix: typo build

* update: debug log
2025-06-25 14:15:58 -04:00
..
2025-06-25 14:15:58 -04:00
2025-02-13 13:30:56 +00:00
2024-12-04 14:45:51 +01: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 Stateful Precompile Illustrates how to implement a node with a stateful precompile
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