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

cmd/geth: added --mainnet flag #21932

Merged
merged 3 commits into from
Jan 5, 2021
Merged

Conversation

MariusVanDerWijden
Copy link
Member

closes #21795

TODO:

  • check that genesis is okay

@MariusVanDerWijden
Copy link
Member Author

@holiman I remembered in the discussion you said something about checking that the genesis is okay.
But I don't know how to do it, any hints?

@holiman
Copy link
Contributor

holiman commented Dec 12, 2020

Sorry, I missed that you had asked me something. So, I'm not 100% sure you need to do anything in particular. But check that "odd stuff" doesn't happen e.g when you do

geth --goerli --datadir /tmp/foo init
geth --mainnet --datadir /tmp/foo 

or

geth --goerli
ctrl-c
geth --mainnet --datadir=~/.ethereum/geth/goerli

Also, maybe we should check the result of doing:

geth --mainnet --networkid=1337

not sure what I would prefer, probably that the networkid=1337 "wins", but maybe it's better to exit with an error.

@MariusVanDerWijden
Copy link
Member Author

MariusVanDerWijden commented Dec 14, 2020

So mainnet -> rinkeby produces an error. However init with rinkeby then mainnet does not error (which it should)

  • edit works now

cmd/utils/flags.go Outdated Show resolved Hide resolved
cmd/utils/flags.go Outdated Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman merged commit 4714ce9 into ethereum:master Jan 5, 2021
@holiman holiman added this to the 1.10.0 milestone Jan 5, 2021
AusIV pushed a commit to NoteGio/go-ethereum that referenced this pull request Jul 12, 2021
* cmd/geth: added --mainnet flag

* cmd/utils: set default genesis if --mainnet is specified

* cmd/utils: addressed comments
@MariusVanDerWijden MariusVanDerWijden deleted the mainnetflag branch November 30, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --mainnet no-op flag for easier tooling
2 participants