【问题标题】:JSON failed to write genesis block: invalid character '\\' looking for beginning of object key stringJSON 无法写入创世块:无效字符 '\\' 正在寻找对象键字符串的开头
【发布时间】:2017-02-23 11:15:01
【问题描述】:

我正在尝试建立起源,并且在这样做时遇到了很多错误。在同一目录的终端上输入 geth init genesis.json 后,我得到了这个:

Caros-MacBook-Pro:testcmy caro$ geth init genesis.json
I0223 18:52:32.817358 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /Users/caro/Library/Ethereum/geth/chaindata
I0223 18:52:32.976868 ethdb/database.go:176] closed db:/Users/caro/Library/Ethereum/geth/chaindata
I0223 18:52:32.976933 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /Users/caro/Library/Ethereum/geth/chaindata
Fatal: failed to write genesis block: invalid character '\\' looking for beginning of object key string

我参考了这个网站:http://hypernephelist.com/2016/05/30/deploying-a-private-Ethereum-blockchain.html 并按照步骤操作。

.json如下:

{
    "nonce": "0x0000000000000042",

"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x4000",

 "alloc": {},

"coinbase": "0x0000000000000000000000000000000000000000",

"timestamp": "0x00",

 "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",

 "extraData": "Custom Ethereum Genesis Block",

 "gasLimit": "0xffffffff"
}

那么,神秘的无效\在哪里? json中没有\!它有什么问题?

【问题讨论】:

  • 我会检查你的假设。我能够用上面的 json 初始化就好了。您确定您实际上是针对上述 json 运行 init 吗?
  • 我很确定~结果我很困惑

标签: json go blockchain truffle


【解决方案1】:

您可能正在使用添加了一些额外字符的文本编辑器。尝试使用 nano 或类似的东西

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-01-08
  • 2022-07-20
  • 1970-01-01
  • 2015-06-12
  • 1970-01-01
  • 2018-10-11
  • 1970-01-01
相关资源
最近更新 更多