当前位置:   article > 正文

Fatal: invalid genesis file: invalid character ‘ï‘ after object key:value pair_invalid character 'l' after object key:value pair

invalid character 'l' after object key:value pair

解决初始化创世块json文件出错的问题


在进行以太坊创世区块文件的初始化过程中,报错:Fatal: invalid genesis file: invalid character ‘ï’ after object key:value pair
下面这是我未改动的json文件

{
  "config": {
     "chainId": 10,
     "homesteadBlock": 0,
     "eip155Block": 0,
     "eip158Block": 0
  },
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x2000",
  "extraData"  : "",
  "gasLimit"   : "0xffffffff",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00",
  "alloc": {
     "08a58f09194e403d02a1928a7bf78646cfc260b0": {
         "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
     },
     "87366ef81db496edd0ea2055ca605e8686eec1e6": {
         "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
     }
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

经过了百般尝试,因为我这个代码直接拷贝过来的,有些漏掉了,可能是有些格式不对,后面自己重新拷贝尝试了,发现最后成功初始化了

INFO [10-23|16:11:14.842] Maximum peer count                       ETH=25 LES=0 total=25
INFO [10-23|16:11:14.844] Allocated cache and file handles         database=/root/privatechain/data/geth/chaindata cache=16 handles=16
INFO [10-23|16:11:14.890] Writing custom genesis block 
INFO [10-23|16:11:14.890] Persisted trie from memory database      nodes=3 size=457.00B time=88.532µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [10-23|16:11:14.890] Successfully wrote genesis state         database=chaindata                              hash=09deb3…c2afda
INFO [10-23|16:11:14.890] Allocated cache and file handles         database=/root/privatechain/data/geth/lightchaindata cache=16 handles=16
INFO [10-23|16:11:14.892] Writing custom genesis block 
INFO [10-23|16:11:14.892] Persisted trie from memory database      nodes=3 size=457.00B time=66.012µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [10-23|16:11:14.893] Successfully wrote genesis state         database=lightchaindata                              hash=09deb3…c2afda
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

建议大家重新拷贝或者是检查格式像是不是少了标点符号之类的,实在不行可以手敲一遍。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/461181
推荐阅读
相关标签
  

闽ICP备14008679号