reth
reth copied to clipboard
Add support for mock network testing
Provide some utils to spawn geth/erigon instance(s) to interact with, ref #113 .
Intended to check compatibility with network related implementations.
So we could use GethInstance from ethers, but that currently uses --dev which disables p2p. That part would need to be configurable. We would also need to create a genesis.json for a private network. Then we could initialize geth like this:
geth init --datadir <data directory> genesis.json
Geth would then be run like this:
geth --datadir <data directory> --networkid <chainid> --port <p2p-port> --netrestrict <network-allowlist>
We would need to first support some admin namespace endpoints, so we can get the ENR and attempt to connect. For testing discovery in an isolated way we could spawn a bootnode tool instance as well.
Admin namespace and some of the required GethInstance modifications are in ethers#1880
closing since we now have better geth bindings and the Testnet type