我已经诊断出的一个问题是创世文件没有在我的专用网络上正确生成,因此默认为默认创世块。
运行以下命令查看创世块
eth.getBlock(0)
如果该块看起来与下面的相同,则您的自定义创世块尚未成功创建。
{
difficulty: 17179869184,
extraData: "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
gasLimit: 5000,
gasUsed: 0,
hash: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
miner: "0x0000000000000000000000000000000000000000",
mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
nonce: "0x0000000000000042",
number: 0,
parentHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
size: 540,
stateRoot: "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
timestamp: 0,
totalDifficulty: 17179869184,
transactions: [],
transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
uncles: []
}
删除您的数据目录并重新初始化
geth --datadir=./eth/data init genesis.json
一些有用的命令可以帮助人们进一步调试
debug.verbosity(6)
-- 启用详细的错误消息
miner.start(1)
-- 总是用这个代替miner.start()
eth.syncing
-- 该节点是否与网络上的任何其他节点同步?(并不总是可靠的)
参考
https://github.com/ethereum/go-ethereum/issues/15087