reth icon indicating copy to clipboard operation
reth copied to clipboard

Expose helpers for obtaining an alloy provider from RpcHandle

Open mattsse opened this issue 11 months ago • 2 comments
trafficstars

Thoughts on exposing a method in the NodeBuilder API that produces an Alloy Provider? One use case is making contract calls directly from an in-process context (see darkforestry/amms-rs#239).

If there's already a solution for this then obviously disregard this note - but I must've missed it if it exists.

Originally posted by @jmcph4 in #12576

we currently have a way to create jsonrpsee clients via the RpcServerHandle

https://github.com/paradigmxyz/reth/blob/025885f2ad3fb881b1d2180e1998797f0b968b88/crates/rpc/rpc-builder/src/lib.rs#L2378-L2393

and would be nice to have a way to easily obtain various alloy providers in a similar way, like

ProviderBuilder::new().on_http(rpc_url) for example

ref

https://github.com/paradigmxyz/reth/blob/025885f2ad3fb881b1d2180e1998797f0b968b88/crates/node/builder/src/rpc.rs#L307-L311

mattsse avatar Dec 04 '24 13:12 mattsse