reth icon indicating copy to clipboard operation
reth copied to clipboard

Add an example how to use `EthFilter` with just the database

Open mattsse opened this issue 1 year ago • 3 comments

Describe the feature

the endpoint impls can be useful on its own, for example user opens database and wants to fetch logs directly.

however this requires a bit more setup due to some API constraints, so we should add a new example for this that

the setup would be similar to this

https://github.com/paradigmxyz/reth/blob/bf44c9724f68d4aabc9ff1e27d278f36328b8d8f/examples/rpc-db/src/main.rs#L44-L44

but use the EthFilter::new directly with all the necessary components and setup, like spawn the cache. the ideal example should consist of

  1. open db
  2. create provider
  3. create necessary setup (EthStateCache)
  4. get filter EthFilter::new

https://github.com/paradigmxyz/reth/blob/bf44c9724f68d4aabc9ff1e27d278f36328b8d8f/crates/rpc/rpc/src/eth/filter.rs#L73-L80

Additional context

No response

mattsse avatar Nov 13 '24 10:11 mattsse