go-ethereum/cmd/utils
lightclient 827a60e9f8 cmd/geth: add flag to set genesis (#32844)
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`?

--

```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>
2025-12-10 16:33:08 +00:00
..
cmd.go cmd, tests: fix snapshot dump and export-preimages (#32650) 2025-09-22 14:48:18 +08:00
diskusage.go all: add build tags for wasip1 (#31090) 2025-01-30 16:58:53 +01:00
diskusage_openbsd.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
diskusage_windows.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
export_test.go all: use fmt.Appendf instead of fmt.Sprintf where possible (#31301) 2025-03-25 14:53:02 +01:00
flags.go cmd/geth: add flag to set genesis (#32844) 2025-12-10 16:33:08 +00:00
flags_legacy.go cmd/utils: show full deprecated flags (#32141) 2025-07-04 09:40:16 +08:00
flags_test.go build: update to golangci-lint 1.61.0 (#30587) 2024-10-14 19:25:22 +02:00
history_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
prompt.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00