我尝试将geth成因文件转换为奇偶校验格式,以便使奇偶校验节点加入已有的geth支持的私有块链,但我得到了一个“创世纪块不匹配”错误:
New peer 0 (protocol: 63, network: 42424242, difficulty: Some(11315973291), latest:4a8e…fcf2, genesis:96d0…b2e1, snapshot:None)
Peer 0 genesis hash mismatch (ours: 31cf…08ea, theirs: 96d0…b2e1)而在另一边:
Adding p2p peer id=1e6033fe00282624 name=Parity/v1.6.8-beta-c... addr=10.0.0.4:43516 peers=3
Ethereum peer connected id=1e6033fe00282624 conn=inbound name=Parity/v1.6.8-beta-c396229-20170608/x86_64-linux-gnu/rustc1.17.0
Ethereum handshake failed id=1e6033fe00282624 conn=inbound err="Genesis block mismatch - 31cf7371d7c8d8ca (!= 96d001c8c6564893)"
Removing p2p peer id=1e6033fe00282624 conn=inbound duration=60.389ms peers=2 req=true err="disconnect requested"原始geth成因文件是:
{
"alloc": {
"ad94486b5005418dbb46a77eb2fd0c8046bfb858": {
"balance": "1000000000000000000000000000000"
}
},
"config": {
"homesteadBlock": 0,
"chainId": 42424242,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000042",
"difficulty": "0x6666",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x4c4b40"
}我手动将该文件转换为奇偶校验格式(基于这些示例https://github.com/5chdn/crossclient-chainspec):
{
"name": "CrossClient",
"dataDir": "CrossClient",
"engine": {
"Ethash": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
"blockReward": "0x4563918244F40000",
"registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
"homesteadTransition": 0,
"eip150Transition": 0,
"eip155Transition": 10,
"eip160Transition": 10,
"eip161abcTransition": 10,
"eip161dTransition": 10
}
}
},
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x28757B2"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000042",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x6666",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x4c4b40"
},
"accounts": {
"ad94486b5005418dbb46a77eb2fd0c8046bfb858": { "balance": "1", "nonce": "0", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }
}
}有人能看到我做错了什么吗?
另外,有人能确切地告诉我成因散列是如何计算的吗?
我忘记提到我已经尝试过https://github.com/keorn/parity-spec/在这两种格式之间进行转换,但是它要求geth为"eip150Block“有一个uint值,而在geth中,我没有它的值,因此假定为null (无叉)。
发布于 2017-07-21 14:04:34
最后,我成功地编写了一个工作奇偶链规范:
{
"name": "GethTranslation",
"engine": {
"Ethash": {
"params": {
"gasLimitBoundDivisor": "0x400",
"minimumDifficulty": "0x20000",
"difficultyBoundDivisor": "0x800",
"durationLimit": "0xd",
"blockReward": "0x4563918244F40000",
"registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
"homesteadTransition": 0,
"eip150Transition": 0,
"eip155Transition": 0,
"eip160Transition": 0,
"eip161abcTransition": 0,
"eip161dTransition": 0
}
}
},
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": 42424242,
"eip98Transition": 9223372036854775807
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000042",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x6666",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x4c4b40"
},
"accounts": {
"ad94486b5005418dbb46a77eb2fd0c8046bfb858": {
"balance": "1000000000000000000000000000000"
}
}
}不同之处在于“*转换”元素,这些元素指定分叉何时(如果有的话)会引入某个区块链更改。这些需要在Geth和奇偶之间同步,它们都有不同的缺省值。
https://ethereum.stackexchange.com/questions/21687
复制相似问题