Ethereum 以太坊专用链在重新启动时重置回块0

Ethereum 以太坊专用链在重新启动时重置回块0,ethereum,go-ethereum,geth,Ethereum,Go Ethereum,Geth,我目前正在运行最新的Geth 1.8.1 Iceburg版本。我根据教程设置了一个以太坊专用网络,包括挖掘在内的一切工作正常,但每次我重新启动Geth时,链都会重置回块号0。所有挖掘事务都已丢失,没有ETH余额,但事务都记录在日志中 使用的命令: geth --datadir "$ethereum_home/EthMasterChain" console 2>console.log geth --datadir "$ethereum_home/EthMasterChain" init "

我目前正在运行最新的Geth 1.8.1 Iceburg版本。我根据教程设置了一个以太坊专用网络,包括挖掘在内的一切工作正常,但每次我重新启动Geth时,链都会重置回块号0。所有挖掘事务都已丢失,没有ETH余额,但事务都记录在日志中

使用的命令:

geth --datadir "$ethereum_home/EthMasterChain" console 2>console.log

geth --datadir "$ethereum_home/EthMasterChain" init "$ethereum_home/genesis.json"
{
    "config": {
    "chainId": 1234,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "nonce": "0x0000000000000045",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gasLimit": "0x8900000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138",
    "alloc": {
        "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138" : {"balance" : "10000000000000000000"}
    }

}
使用的json文件:

geth --datadir "$ethereum_home/EthMasterChain" console 2>console.log

geth --datadir "$ethereum_home/EthMasterChain" init "$ethereum_home/genesis.json"
{
    "config": {
    "chainId": 1234,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "nonce": "0x0000000000000045",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gasLimit": "0x8900000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138",
    "alloc": {
        "0xbe8d5fce9f60ab06b527dd177eed96eb95ee4138" : {"balance" : "10000000000000000000"}
    }

}

编辑您的帖子以包含脚本。我假设(希望)您不是每次都在运行
init
,对吗?顾名思义,
init
初始化区块链(创建块0)。如果您多次运行它,它将覆盖您以前的区块链(除非您指定不同的datadir)。不,我不会多次运行init命令,只是在您启动
geth console
时需要包含
--networkid 1234
。否则,您将连接到mainnet。然而,我不确定这是否是你重设区块链的原因。试试看是否有帮助。谢谢大家刚刚解决了这个问题。问题在于geth 1.8 Iceberg版本,每当你关闭我降级到1.7.3稳定的控制台并解决问题时,它都会重置区块链:)不要使用1.8 geth版本