因业务需要搭建Binance全节点,过程颇为坎坷,记录一下,以防后人爬不上来,
搭建过程参照https://docs.binance.org/fullnode.html#state-sync,具体步骤不一一解释,这里只说明几个出现问题的地方
git lfs
,使用git
拉取二进制的节点文件会不存在/config/config.toml
这个文件中的state_sync_height
需要改为1,其他的不做修改ulimit -n 设置一下就好了
panic: Failed to process committed block (1082014:39C2F09916BD3415C40BD825406C09A022C98FFCDBDFFFC7DADA0E822F60F6B9): Wrong Block.Header.AppHash. Expected AC9FAC16513AF96A38822F2DF9276131D6ABDCD9EF47A6EEDACF5CA3E54883C0, got 92EB0FF45ED3F1EDD8A30829C2712EF5DFA7F09A2F83B24AC330A2BF5B14BE9E
goroutine 3946 [running]:
github.com/tendermint/tendermint/blockchain/v0.(*BlockchainReactor).poolRoutine(0xc000965d40)
/home/suyu/go/pkg/mod/github.com/binance-chain/bnc-tendermint@v0.32.3-binance.1/blockchain/v0/reactor.go:399 +0x1bf0
created by github.com/tendermint/tendermint/blockchain/v0.(*BlockchainReactor).SwitchToBlockchain
/home/suyu/go/pkg/mod/github.com/binance-chain/bnc-tendermint@v0.32.3-binance.1/blockchain/v0/reactor.go:153 +0x326
root:/data04/bnb/node-binary/fullnode/prod/0.6.3-hotfix/linux# pwd
/bnb/node-binary/fullnode/prod/0.6.3-hotfix/linux
需使用官方提供的工具进行回滚,首先记录出现异常的区块,本次异常是第1082014块,官方工具使用方法参考https://github.com/binance-chain/node-binary/tree/master/tools/recover,即找到state_recover
文件,执行 ./state_recover 1082013 <your_home_path>
,然后再次启动节点即可