Skip to content

Conversation

lightclient
Copy link
Member

This PR is an alternative to #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?

--

$ 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 and modify one of the BPO timestamps to simulate a shadow fork.

@lightclient lightclient force-pushed the cmd-geth-genesis-flag branch from 9dcc734 to b02b46d Compare October 8, 2025 14:28
if err := json.NewDecoder(f).Decode(genesis); err != nil {
Fatalf("Invalid genesis file: %v", err)
}
cfg.Genesis = genesis
Copy link
Member

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

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.

2 participants