reth icon indicating copy to clipboard operation
reth copied to clipboard

Add support for mock network testing

Open mattsse opened this issue 3 years ago • 2 comments

Provide some utils to spawn geth/erigon instance(s) to interact with, ref #113 .

Intended to check compatibility with network related implementations.

mattsse avatar Oct 25 '22 11:10 mattsse

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.

Rjected avatar Nov 06 '22 18:11 Rjected

Admin namespace and some of the required GethInstance modifications are in ethers#1880

Rjected avatar Nov 22 '22 05:11 Rjected

closing since we now have better geth bindings and the Testnet type

mattsse avatar Dec 21 '22 16:12 mattsse