遇到以太坊缪尔冰川硬分叉,报错如下,需要升级geth版本到最新1.9.9
ERROR[01-11|16:05:18.296]
########## BAD BLOCK #########
Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000 Engine: ethash}
Number: 9200000
Hash: 0x6ba9486095de7d96a75b67954cfe2581234eae1ef2a92ab03b84fc2eae2deb8a
Error: invalid difficulty: have 2458589766091800, want 2459689277719575
##############################
WARN [01-11|16:05:18.298] Synchronisation failed, dropping peer peer=1ae58a69aae79bd2 err="retrieved hash chain is invalid"
升级geth版本
1、官网下载地址
https://geth.ethereum.org/downloads/
2、geth下载
https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.9-01744997.tar.gz
3、校验md5一致
root@ip-172-31-30-55:/data/chainup/coin# md5sum geth-linux-amd64-1.9.9-01744997.tar.gz
de1b31439dc6697fcbe2d729d2080d22 geth-linux-amd64-1.9.9-01744997.tar.gz
4、升级版本
tar xvf geth-linux-amd64-1.9.9-01744997.tar.gz
mv geth-linux-amd64-1.9.9-01744997 geth1.9.9
cp run.sh test.sh ../geth1.9.9/
run.sh文件如下,更改启动程序的版本文件为/data/chainup/coin/geth1.9.9/geth,配置datadir文件目录不变,否则又要重新同步区块
nohup /data/chainup/coin/geth1.9.9/geth --rpc --rpcport 8545 --rpcaddr=ip --rpcapi "eth,net,web3,rpc,admin,personal,clique,debug,miner,shh,txpool" --datadir /data/coin/geth --maxpeers 100 &
现在又重新在同步区块,会回退到一定区块高度再重新同步
INFO [01-11|17:04:06.221] Bumping default cache on mainnet provided=1024 updated=4096
INFO [01-11|17:04:06.222] Maximum peer count ETH=100 LES=0 total=100
INFO [01-11|17:04:06.222] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=ledger vendor=11415 failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=trezor vendor=21324 failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=trezor vendor=4617 failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=ledger vendor=11415 failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=trezor vendor=21324 failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:06.236] Failed to enumerate USB devices hub=trezor vendor=4617 failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
INFO [01-11|17:04:06.237] Starting peer-to-peer node instance=Geth/v1.9.9-stable-01744997/linux-amd64/go1.13.5
INFO [01-11|17:04:06.237] Allocated trie memory caches clean=1024.00MiB dirty=1024.00MiB
INFO [01-11|17:04:06.237] Allocated cache and file handles database=/data/coin/geth/geth/chaindata cache=2.00GiB handles=524288
ERROR[01-11|17:04:07.237] Failed to enumerate USB devices hub=ledger vendor=11415 failcount=3 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:07.237] Failed to enumerate USB devices hub=trezor vendor=21324 failcount=3 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[01-11|17:04:07.237] Failed to enumerate USB devices hub=trezor vendor=4617 failcount=3 err="failed to initialize libusb: libusb: unknown error [code -99]"
INFO [01-11|17:04:09.099] Opened ancient database database=/data/coin/geth/geth/chaindata/ancient
INFO [01-11|17:04:09.140] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Engine: ethash}"
INFO [01-11|17:04:09.140] Disk storage enabled for ethash caches dir=/data/coin/geth/geth/ethash count=3
INFO [01-11|17:04:09.140] Disk storage enabled for ethash DAGs dir=/root/.ethash count=2
INFO [01-11|17:04:09.148] Initialising Ethereum protocol versions="[64 63]" network=1 dbversion=7
WARN [01-11|17:04:09.156] Head state missing, repairing chain number=9199999 hash=e21d53…d6fcc8
INFO [01-11|17:04:15.932] Rewound blockchain to past state number=9198367 hash=772b46…26b488
INFO [01-11|17:04:15.932] Loaded most recent local header number=9199999 hash=e21d53…d6fcc8 td=13525745195338389842839 age=1w2d34m
INFO [01-11|17:04:15.932] Loaded most recent local full block number=9198367 hash=772b46…26b488 td=13521704591151910642361 age=1w2d8h
INFO [01-11|17:04:15.933] Loaded most recent local fast block number=9199999 hash=e21d53…d6fcc8 td=13525745195338389842839 age=1w2d34m
INFO [01-11|17:04:15.943] Loaded local transaction journal transactions=0 dropped=0
再看已经不会停留在9200000区块高度报错了,再等段时间就可以同步到最新区块高度了,区块高度去
官网查看,这个是中国的不需要科学上网https://cn.etherscan.com/blocks
INFO [01-11|17:13:41.516] Imported new chain segment blocks=4 txs=469 mgas=33.568 elapsed=1.004s mgasps=33.406 number=9200003 hash=bfe503…47669f age=1w2d42m dirty=388.02MiB
INFO [01-11|17:13:41.822] New local node record seq=19 id=c1c649ca2365d49d ip=13.251.46.63 udp=30303 tcp=30303
网友评论