当currentBlock接近最高块时,它会停止增长,并且最高块开始增长。过了一会儿,currentBlock再次开始增长。
我使用命令geth --rinkeby --fast
运行geth。
我的geth上的highestBlock非常接近https://www.rinkeby.io/#faucet上的实际数字。
> eth.syncing
{
currentBlock: 2401750,
highestBlock: 2401826,
knownStates: 14219701,
pulledStates: 14205841,
startingBlock: 2401554
}
> eth.blockNumber
0
下面的日志,似乎很正常:
INFO [06-04|15:34:52] Imported new state entries count=621 elapsed=4.093ms processed=14288823 pending=12362 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:34:56] Imported new block headers count=1 elapsed=713.868µs number=2401841 hash=db818c…70c969 ignored=0
INFO [06-04|15:34:57] Imported new state entries count=1388 elapsed=9.091ms processed=14290211 pending=12354 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:00] Imported new state entries count=768 elapsed=9.649ms processed=14290979 pending=11944 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:02] Imported new state entries count=607 elapsed=4.707ms processed=14291586 pending=11757 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:05] Imported new state entries count=768 elapsed=5.867ms processed=14292354 pending=11629 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:07] Imported new state entries count=601 elapsed=4.242ms processed=14292955 pending=11759 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:09] Imported new state entries count=601 elapsed=4.924ms processed=14293556 pending=11479 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:09] Imported new block headers count=1 elapsed=711.566µs number=2401842 hash=39a2d8…5318ec ignored=0
INFO [06-04|15:35:10] Imported new state entries count=384 elapsed=3.093ms processed=14293940 pending=11375 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:11] Imported new state entries count=384 elapsed=2.660ms processed=14294324 pending=11365 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:13] Imported new state entries count=601 elapsed=5.337ms processed=14294925 pending=11094 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:17] Imported new state entries count=985 elapsed=6.948ms processed=14295910 pending=11024 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:20] Imported new state entries count=602 elapsed=4.317ms processed=14296512 pending=10940 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:25] Imported new state entries count=602 elapsed=4.380ms processed=14297114 pending=10973 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:25] Imported new block headers count=1 elapsed=469.834µs number=2401843 hash=e8d3a7…152487 ignored=0
INFO [06-04|15:35:25] Imported new state entries count=384 elapsed=2.758ms processed=14297498 pending=11062 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:28] Imported new state entries count=592 elapsed=5.524ms processed=14298090 pending=11015 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:31] Imported new state entries count=1210 elapsed=203.329ms processed=14299300 pending=10477 retry=0 duplicate=6543 unexpected=9538
INFO [06-04|15:35:37] Imported new state entries count=1033 elapsed=1.656ms processed=14300333 pending=10590 retry=0 duplicate=6543 unexpected=9538
我想我已经等了足够长的时间,但是现在的布洛克无法达到最高的阻止,即使他们非常接近。
这是常见的吗?
同步完成。这些数字并不意味着一切,只是等待。
答案 0 :(得分:0)
即使块同步完成之后(即currentBlock
几乎达到highestBlock
时),仍然有很多状态需要处理。
没有明确的方法来知道状态总数:
pulledStates
是已经下载的状态Trie条目的数量,并且
knownStates
是已知的状态Trie条目的总数。
当节点下载(拉出)所有状态(已知和未知)后,才认为同步完成,然后节点将0
返回到eth.blockNumber
和eth.getBalance
。
答案 1 :(得分:0)
Geth需要同步状态和阻止。 大约有8100万个状态条目atm。 完全同步后,文件夹大小为28GB。
答案 2 :(得分:0)
您必须耐心同步节点。
我花了60个小时在快速模式下同步Rinkeby。同步后,有 1.25M个状态条目,并且文件夹大小为 38GB 。随着时间的流逝,这两个数字都会增长。
您可以在Geth控制台中键入eth.syncing
。如果输出为“ False”,则表明同步已完成。否则,您将获得有关块和状态的各种详细信息。
通过键入eth.blockNumber
,您将获得当前的块号。如果输出为0,则说明同步尚未完成。
这是同步完成时的图像(所有状态均已拉出),我开始下载链段。 Synchronized Rinkeby
答案 3 :(得分:-1)
我写了一个很小的python脚本来概述该过程。在这里https://github.com/hayorov/ethereum-sync-mertics
我的输出:
2019-05-06 01:00:32 avg: 1827 max: 1938 min: 1378 states/s remain: 136604075 states 4 peers eta@ 20:46:28.165828
2019-05-06 01:00:37 avg: 1864 max: 1938 min: 1378 states/s remain: 136595500 states 3 peers eta@ 20:21:14.951050
2019-05-06 01:00:42 avg: 1791 max: 1938 min: 1378 states/s remain: 136583359 states 3 peers eta@ 21:11:16.481006
2019-05-06 01:00:48 avg: 1742 max: 1938 min: 1378 states/s remain: 136580287 states 3 peers eta@ 21:46:35.797305
2019-05-06 01:00:53 avg: 1721 max: 1938 min: 1378 states/s remain: 136575694 states 3 peers eta@ 22:03:01.154434
2019-05-06 01:00:58 avg: 1682 max: 1938 min: 1378 states/s remain: 136569043 states 4 peers eta@ 22:33:15.402442
2019-05-06 01:01:03 avg: 1698 max: 1938 min: 1378 states/s remain: 136564293 states 3 peers eta@ 22:20:27.458747