-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples: add examples of using reth-provider and instantiating an RPC on top of the DB #3533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we instead have a single examples/Cargo.toml and then all the examples are:
[[example]]
name = "<>"
path = "<>.rs"
ref: https://github.com/tokio-rs/tokio/tree/master/examples
examples/rpc-db/src/main.rs
Outdated
// 2. Setup blcokchain tree to be able to receive live notifs | ||
// TODO: Make this easier to configure | ||
let provider = { | ||
let consensus = Arc::new(BeaconConsensus::new(spec.clone())); | ||
let exec_factory = ExecutionFactory::new(spec.clone()); | ||
|
||
let externals = TreeExternals::new(db.clone(), consensus, exec_factory, spec.clone()); | ||
let tree_config = BlockchainTreeConfig::default(); | ||
let (canon_state_notification_sender, _receiver) = | ||
tokio::sync::broadcast::channel(tree_config.max_reorg_depth() as usize * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems not necessary at all, we shouldn't be needing this here and instead should be able to use the db as provider,
perhaps there are a few things missing, but all of this should not be needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's what i thought was just not sure how to set up the DB for the RPC Module w/o a tree for the pending queries - seems like the abstraction did not support it
I guess yeah, altho it does require writing everything included. I'm fine with it. |
Codecov Report
see 8 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
will be added in followup
As title, adds 2 examples:
reth-provider
. Pretty neat / powerful. cc @joshstevens19 for this to improve your abstractions' usagecc @onbjerg I am not 100% sure if this is the best way to do examples/ in the current repository structure, opening this as-is, and we can either merge it or defer to you on best integration path
ref #3533