I am using geth 1.6.7 stable release. During initialization of genesis block for priavte network it throws an error which is

Fatal: invalid genesis file: invalid character '"' after object key:value pair

My genesis.json

 "nonce": "0x0000000000000042",
 "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
 "difficulty": "0x400",
 "alloc": {},
 "coinbase": "0x0000000000000000000000000000000000000000",
 "timestamp": "0x00",
 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
 "extraData": "ChainSkills Genesis Block",
 "gasLimit": "0xffffffff"
 "config": {
    "chainId": 59,
    "homesteadBlock": 0,
    "eip155Block": 0,
    "eip158Block": 0
  • Have you tried leaving out alloc ? Aug 20 '17 at 19:39
  • @NikitaFuchs i removed the alloc but still it did not work Aug 20 '17 at 19:41

You forgot the comma after the gas limit line. ;)

  • I did that before I got this error " Fatal: invalid genesis file: json: cannot unmarshal hex string of odd length into Go struct field Genesis.extraData of type hexutil.Bytes " although I change extraData field value to "0x0" Aug 20 '17 at 19:53
  • Altough this is another question, I remember having to remove 0x here and there, as they are only data type indicators. Aug 20 '17 at 20:19
  • Thanks Nikita Fauchs , i solved it by removing the zero after x in the extraData value Aug 20 '17 at 20:55

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.