alloy-rs / examples

Example code for using alloy and alloy-core
Apache License 2.0
136 stars 34 forks source link

add example for comparing subscriptions from different providers #148

Closed 0xlosh closed 1 month ago

0xlosh commented 1 month ago

Closes: https://github.com/alloy-rs/examples/issues/146

added new_heads to compare, simply run cargo run --example new_heads -- -r reth:ws://localhost:8546 -r alchemy:xxx -r other_provider:other_url -r ... to start

0xlosh commented 1 month ago

tysm, this looks pretty good, only have some nits

will edit tmw and add pending_txs too, im not sure what gakonst meant when he mentioned to test eth_getBlock against other providers too, what exactly is there to compare?

0xlosh commented 1 month ago

cargo run --example new_heads -- -r reth:ws://localhost:8546 -r alchemy:wss://eth-mainnet.g.alchemy.com/v2/<api_key> Screenshot 2024-10-05 at 20 01 05

cargo run --example pending_txs -- -r reth:ws://localhost:8546 -r alchemy:wss://eth-mainnet.g.alchemy.com/v2/<api_key> Screenshot 2024-10-05 at 20 01 23

unfortunately i dont have a local geth node running along to test that too, feel free to edit the code

0xlosh commented 1 month ago

@mattsse thanks got it, but im running my own reth node actually