6

I am attempting to launch a private geth chain with the following command:

geth --datadir=./test-private-blockchain/ init genesis.json

I am receiving the following error:

Fatal: Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0 genesis block

{
  "config": {
        "chainId": 4777,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
  "alloc"      : {},
  "difficulty" : "0x400",
  "extraData"  : "",
  "gasLimit"   : "0x7A1200",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}
12

Answer is to update genesis.json to include eip150Block:

{
  "config": {
        "chainId": 4777,
        "homesteadBlock": 0,
        "eip150Block": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
  "alloc"      : {},
  "difficulty" : "0x400",
  "extraData"  : "",
  "gasLimit"   : "0x7A1200",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

delete the data dir :

rm -rf "your data dir"

Then reinitialize.

geth --datadir=./test-private-blockchain/ init genesis.json
| improve this answer | |
0

I would like to add that, when reinitializing, if you only delete the chainData folder inside the geth folder of your datadir, you will retain any previous accounts, although they lose all their ether. For me that is a convenience because I store the account numbers in a param file for my Dapps. And of course the Dapps folder is inside your datadir too, so if you want to keep that, but still reinitialize the blockchain itself, this has worked for me.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.