-
Notifications
You must be signed in to change notification settings - Fork 21.5k
cmd/geth: add flag to set genesis #32844
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: add flag to set genesis #32844
Conversation
9dcc734 to
b02b46d
Compare
| if err := json.NewDecoder(f).Decode(genesis); err != nil { | ||
| Fatalf("Invalid genesis file: %v", err) | ||
| } | ||
| cfg.Genesis = genesis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to highlight that, in this case, the ChainID will be used as the NetworkID.
I guess it's expected behavior
|
LGTM |
Removed the period at the end of the usage description for the GenesisFlag.
f9cc307 to
caf1b2a
Compare
|
Reverting last commit as it causes an issue with automatically upgrading the mainnet config since no network flag is typically passed. |
|
Renamed flag to |
following: ethereum/go-ethereum#32844 --------- Signed-off-by: Barnabas Busa <busa.barnabas@gmail.com>
This PR is an alternative to ethereum#32556. Instead of trying to be smart and reuse `geth init`, we can introduce a new flag `--genesis` that loads the `genesis.json` from file into the `Genesis` object in the same path that the other network flags currently work in. Question: is something like `--genesis` enough to start deprecating `geth init`? -- ```console $ geth --datadir data --hoodi .. INFO [10-06|22:37:11.202] - BPO2: @1762955544 .. $ geth --datadir data --genesis genesis.json .. INFO [10-06|22:37:27.988] - BPO2: @1862955544 .. ``` Pull the genesis [from the specs](https://raw.githubusercontent.com/eth-clients/hoodi/refs/heads/main/metadata/genesis.json) and modify one of the BPO timestamps to simulate a shadow fork. --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This PR is an alternative to #32556.
Instead of trying to be smart and reuse
geth init, we can introduce a new flag--genesisthat loads thegenesis.jsonfrom file into theGenesisobject in the same path that the other network flags currently work in.Question: is something like
--genesisenough to start deprecatinggeth init?--
Pull the genesis from the specs and modify one of the BPO timestamps to simulate a shadow fork.