I am trying to initializing geth node with the following Gensis file content
{
"nonce": "0x00000000000000042",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x400",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": { }
}
and I get error
"Fatal: invalid genesis file: json: cannot unmarshal hex string of odd length into Go struct field Genesis.extraData of type hexutil.Bytes"
But then I understood from this discussion that format of the genesis block has changed to the following
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "200000000",
"gasLimit": "2100000",
"alloc": {
"7df9a875a174b3bc565e6424a0050ebc1b2d1d82": { "balance": "300000" },
"f41c74c9ae680c1aa78f42e5647a62f353b7bdde": { "balance": "400000" }
}
}
and this works.
But what I am failing to get are
- Why the need of such a change?
- How is issue related to unmarshalling of hex strings is solved by the new config?
- Now that I am not setting the many of the default values how are they getting set and with what values ?
- Also it would be great if you could point me to a link which explains the config params in detail.