15

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"
}
iamdefinitelyahuman
  • 2,876
  • 1
  • 12
  • 32
Leon Africa
  • 634
  • 1
  • 5
  • 17

3 Answers3

23

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
Leon Africa
  • 634
  • 1
  • 5
  • 17
0

You would need to add one more configuration field in genesis.json

    "eip150Block": 0,
Dave Lee
  • 101
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.

islandBilly
  • 21
  • 1
  • 3