-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
./geth --datadir data dumpgenesis #21881
Comments
Have you tried clearing your datadir (or making a new one that starts empty) and running the init command from the first line of your post? |
@wbt, yes, I did try to run # remove database in dir
./geth --datadir="pathway_to_data" removedb
# initialize with new genesis.json
./geth --datadir="pathway_to_data" init "pathway_to_genesis.json"
# but after
./geth --datadir="pathway_to_data" dumpgenesis
# I see the same result. I see default genesis in console. Moreover, I did try to run: # remove database directory with all the files:
rm -rf "pathway_to_data"
# and create this directory again:
mkdir "pathway_to_data"
# and init geth with genesis again:
./geth --datadir="pathway_to_data" init "pathway_to_genesis.json"
# but after dumpgenesis:
./geth --datadir="pathway_to_data" dumpgenesis
# I see the same result too. Old, default genesis, in console stdout. I see default genesis in console: Lines 335 to 345 in 23524f8
with ethereum pre-mine: go-ethereum/core/genesis_alloc.go Line 24 in 23524f8
Also, I did try to change #networkid changed in config
./geth --datadir="pathway_to_data" --networkid=2020 dumpconfig
# but old default genesis for networkid=1
./geth --datadir="pathway_to_data" removedb
./geth --datadir="pathway_to_data" --networkid=2020 init "pathway_to_2020-genesis.json"
./geth --datadir="pathway_to_data" --networkid=2020 dumpgenesis |
A few questions that may or may not help: |
@wbt
No, networkid param. This param, I set, using command-line argument Seems, like |
As some guideposts for others trying to debug this: That PR had a post-merge comment "Question: shouldn't this function also dump a custom genesis?" which never got a response. Maybe the correct response is "it should but it currently doesn't." Though I haven't tested it in any detail, I suspect this line ( The code does not make me think this would be likely to work as OP expects, though the documentation does. Thanks for reporting! |
I should also note that I don't think all developer chains should be considered ephemeral. There might be some non-ephemeral private ETH chains out there serving a useful purpose; part of the value of open-source software is the possibility of using it outside of its original context/chain. |
Ok, no problem. Maybe your developers, can fix it, in new releases,
Yes, I know, but the main think, that I wanted to check, is the following thing: |
This comment was intended for other geth developers, based on a comment in the code stating the opposite.
In general, you should not be using a custom/private genesis/network with chainId/networkId = 1. That id is for mainnet, and it's reasonable to expect the mainnet genesis coming back from that. |
Try to do this: https://geth.ethereum.org/docs/interface/private-network
After
./geth --datadir data init genesis.json
,the command
./geth --datadir data dumpgenesis
return previous genesis.How to sucessfully re-initialize the old genesis.json?
The text was updated successfully, but these errors were encountered: