原始文献 / 论坛帖 / Re: RFC: ship block chain 1-74000 with release tarballs?
Re: RFC: ship block chain 1-74000 with release tarballs?
Bitcointalk · 2010-11-25 17:51:39 UTC
费时间的不是下载,是验证和建索引。
从带宽上看,它比你下载一个归档包更高效。比特币只下载 blk0001.dat 里的数据,目前是 55MB,自己构建 47MB 的 blkindex.dat。构建 blkindex.dat 才是所有磁盘活动的原因。
区块下载期间,每 500 个区块才把数据库刷到磁盘一次。你可能会看到区块数在 ??499 和 ??999 处停住。那就是在刷盘。
自己做验证和建索引,是确保索引数据可信的唯一办法。如果从不可信的来源拷贝 blk0001.dat 和 blkindex.dat,你没法知道里面的内容是否都可信。
也许 Berkeley DB 有些可调参数,能启用或增大缓存。
英文原文
It's not the downloading that takes the time, it's verifying and indexing it.
Bandwidthwise, it's more efficient than if you downloaded an archive. Bitcoin only downloads the data in blk0001.dat, which is currently 55MB, and builds blkindex.dat itself, which is 47MB. Building blkindex.dat is what causes all the disk activity.
During the block download, it only flushes the database to disk every 500 blocks. You may see the block count pause at ??499 and ??999. That's when it's flushing.
Doing your own verifying and indexing is the only way to be sure your index data is secure. If you copy blk0001.dat and blkindex.dat from an untrusted source, there's no way to know if you can trust all the contents in them.
Maybe Berkeley DB has some tweaks we can make to enable or increase cache memory.
