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 --mainnet no-op flag for easier tooling #21795

Closed
yorickdowne opened this issue Nov 7, 2020 · 1 comment · Fixed by #21932
Closed

Add --mainnet no-op flag for easier tooling #21795

yorickdowne opened this issue Nov 7, 2020 · 1 comment · Fixed by #21932

Comments

@yorickdowne
Copy link

yorickdowne commented Nov 7, 2020

System information

Geth version: 1.9.23
OS & Version: Linux

Suggested change

I'd like to offer a PR to add a --mainnet no-op flag to geth, similar to Nethermind and Besu options. This would be a true no-op boolean, specifying it or leaving it out would have the same effect. To be clear, running geth without that parameter will still start it on main net.

My main ask is for geth; I am happy to add this to other tools in the same PR if desired.

Rationale

I have created docker tooling for eth2. The same tooling handles testnet and main net. Currently, I need to special case geth in .env like this:

# Network to use for eth1. If using Nethermind or Besu and main net, set to mainnet.
ETH1_NETWORK=goerli
# If using Geth as the eth1 node and main net, comment out.
GETH1_NETWORK=--goerli

With a --mainnet no-op flag, I can remove GETH1_NETWORK, instruct users to set ETH1_NETWORK to mainnet when on main, and it will work for Geth as well as other clients. The Geth docker-compose entrypoint could then simply use --${ETH1_NETWORK} for both test and main net.

Impact

Low for either project.

On the Geth side, having the no-op will not be a change that needs a lot of maintenance. If there's code that currently checks that only one network flag has been specified, please point me at where that is, and I can adjust it as part of the proposed PR.

On the eth2-docker side, not having the no-op is slightly inconvenient for the user, but not breaking by any means.

@yorickdowne yorickdowne changed the title Add --ethereum no-op flag for easier tooling Add --mainnet no-op flag for easier tooling Nov 17, 2020
@ligi
Copy link
Member

ligi commented Nov 19, 2020

This is a good idea. But it should not just be a no-op flag. It should behave the same as the testnet flags. E.g. detecting if you have both --goerli and --mainnet and error then. And refuse to start when you did not init with a non mainnet genesis.
Would you still be willing to do the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants