How to reintialize genesis block in geth ethereum

0 votes

I initialized genesis block with wrong address. So I made changes to the genesis block and trying to initialize again but I am getting error:

geth --datadir ./data init ./custom_genesis.json

INFO [12-05|12:49:19.240] Maximum peer count                       ETH=25 LES=0 total=25

INFO [12-05|12:49:19.241] Allocated cache and file handles         database=/home/edureka/privatechain/data/geth/chaindata cache=16 handles=16

INFO [12-05|12:49:19.295] Persisted trie from memory database      nodes=1 size=150.00B time=156.955µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B

Fatal: Failed to write genesis block: database already contains an incompatible genesis block (have 9f6ec9be0aafd8b0, new 9279b016a010f22d)
Dec 6, 2018 in Blockchain by slayer
• 29,360 points

1 answer to this question.

0 votes

You are getting this error because you have already initialized genesis block once and re-initializing the genesis block. To solve this error, delete the folder ./data/geth and then initialize:

rm -rf /home/user/privatechain/data/geth

geth --datadir ./data init ./custom_genesis.json 

Hope this helps!

To know more, Enroll with Blockchain training online today.

Thank You!!

answered Dec 6, 2018 by Omkar
• 69,230 points

Related Questions In Blockchain

0 votes
1 answer

How to create a Genesis Block in a Private Network?

{     "nonce": "0x0000000000000042",     "difficulty": "0x000000100",     "alloc": {     },     "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",     "coinbase": "0x0000000000000000000000000000000000000000",     "timestamp": "0x00",     "parentHash": ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,740 points
0 votes
1 answer

How to make sure transactions take no fee in a private Ethereum blockchain?

In a private ethereum network you have ...READ MORE

answered Mar 26, 2018 in Blockchain by Christine
• 15,790 points

edited Mar 26, 2018 by Christine 1,428 views
+1 vote
3 answers

How efficient is Ethereum in regard to its TPS??

TPS means transactions processing at any given ...READ MORE

answered Apr 16, 2018 in Blockchain by Shashank
• 10,400 points
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
0 votes
0 answers

Error: Unexpected token o in JSON at position 1

I have been working with Interacting a ...READ MORE

Mar 6, 2019 in Blockchain by saeedi
• 120 points

edited Mar 6, 2019 by Omkar 2,286 views
0 votes
1 answer
0 votes
1 answer

How to set the hex-encoded data field in a Web3j Ethereum transaction?

You can use the "data" field of ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 69,230 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP