Skip to content
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

Add support for mock network testing #137

Closed
mattsse opened this issue Oct 25, 2022 · 3 comments
Closed

Add support for mock network testing #137

mattsse opened this issue Oct 25, 2022 · 3 comments
Assignees
Labels
A-devp2p Related to the Ethereum P2P protocol C-test A change that impacts how or what we test

Comments

@mattsse
Copy link
Collaborator

mattsse commented Oct 25, 2022

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

Intended to check compatibility with network related implementations.

@onbjerg onbjerg added A-devp2p Related to the Ethereum P2P protocol C-test A change that impacts how or what we test labels Oct 28, 2022
@Rjected
Copy link
Member

Rjected commented Nov 6, 2022

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 Rjected self-assigned this Nov 13, 2022
@Rjected
Copy link
Member

Rjected commented Nov 22, 2022

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

@mattsse
Copy link
Collaborator Author

mattsse commented Dec 21, 2022

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

@mattsse mattsse closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devp2p Related to the Ethereum P2P protocol C-test A change that impacts how or what we test
Projects
None yet
Development

No branches or pull requests

3 participants