5

I'm trying to setup my own Bitcoin node on Ubuntu 16.04.1 LTS.

Right now, I've stuck with blockchain synchronization. I'm letting bitcoind to run every day for at least 10-12 hours while I work and it already takes three days to download 83% of the entire data.

I have very good Internet connection, it should take no more than two hours to download 80 GB of data, however, it's taking at least 30 hours already. My connection is practically free from other downloads most of the time.

I've googled this problem: some people say that current version of the bitcoind is so fast that it doesn't matter how blockchain is downloaded throught the Bitcoin network or by torrent. Other people say, that it takes a week to download the entire blockchain.

  1. Is there a way to optimize my setup to make it download blockchain much-much faster?

  2. Or do I better download it via some torrent and then synchronize the differences from the network? What is the best place to find such torrent file or magnet link? Also, is it safe to download blockchain from some third-party, will bitcoind validate it?

SO, generally speaking, what is the best way to download the blockchain in order to setup a working up-to-date Bitcoin node?

$ cat /etc/issue
Ubuntu 16.04.1 LTS \n \l

$ uname -a
Linux destiny 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ bitcoind -version
Bitcoin Core Daemon version v0.13.1.0-g03422e5
13

What usually takes time is the validation of the transactions in the blockchain, not downloading it. Bitcoin Core implements a fully validating node, which does not trust any of the information other peers give it. The only way to accomplish that is by validating everything itself.

30 hours sounds painfully long though. If you have memory to spare on your system, you absolutely should increase the database cache size. The default in 0.13 is 300 MB, but you'll see very significant speedups from using a higher value, up to 4000 or so (which would require an extra 4GB of memory).

12
  • Thanks Pieter, that makes perfect sense. I will try to increase the cache size then and will see if it helps! Nov 11 '16 at 19:08
  • By the way, is it safe to download blockchain from some third-party, will bitcoind validate it? Nov 11 '16 at 19:16
  • You can download a bootstrap.dat file (which contains just blocks to process at startup, as if they were received from network). Do not download a full database copy, bitcoind does not and cannot know you copied from a potentially untrustworthy party. Nov 11 '16 at 20:35
  • Thanks! Please consider adding this info to the answer, so other users could also easily find it. Nov 11 '16 at 20:55
  • 1
    @Jure1873 Do you have pruning enabled? There is currently a bug that makes pruning effectively reduce the dbcache effectiveness. Dec 4 '17 at 18:42
0

downloading 150 Gigabyte will always be very slow. Some suggest to set "listen" to "off" but this has no effect on speed. You might, at intervals, ban the slowest 3 nodes, so you get pretty fast nodes after a while.

1
  • The problem was not with network bandwidth, but with the fact that Bitcoin verifies all the blocks and it takes a lot of CPU resources. The 150 GB could be downloaded within 2 hours on my network, but it will take much more time to verify all those blocks. And the good CPU will really help in speeding up this process. Dec 25 '18 at 9:13
0

I didn't have enough reputation to add a comment to the accepted answer. But here's what I have learned:
I'm running Bitcoin Core Version v0.20.1 and Linux Mint 18.3 on pretty old hardware. Pruning blockchain to 2 GB and setting dbcache to 2048 MiB didn't actually help.

Moving the datadir to a USB-Stick did the job for me. Which is weird since my disk is connected too via USB. Maybe there is an issue with how bitcoin-qt is handling its cache? An in-memory cache shouldn't behave like that. At least I wouldn't expect it to.

Note: Using a USB-Stick is not recommended! It can cause bitcoin-qt shutting down due to database errors.

So, if it's neither CPU nor bandwidth check your disk I/O.

On Linux you might want to try:

iostat -x 5

To figure out which device is what disk, you can use

cat /proc/mounts
4
  • 1
    Hi pisjatblin, in case you didn't see, this question was resolved four years ago. However, if you see the comments on Pieter's answer, some users have found that disk I/O was indeed their bottleneck. It would be great if you could extend your answer a bit in that direction.
    – Murch
    Oct 29 '20 at 13:45
  • Hi Murch, thanks for pointing out. I was too noob to add a comment to the answer (lack of reputation). So I did my best to put here what I have learned. I'm running Bitcoin Core Version v0.20.1 and Linux Mint 18.3 on a pretty old hardware. Pruning blockchain to 2 G and setting dbcache to 2048 MiB didn't actually help. Moving datadir to a USB-Stick did the job for me. Which is weird since my disk is connected too via USB. Maybe there is an issue with how bitcoin-qt is handling its cache? An in-memory cache shouldn't behave like that. At least I wouldn't expect it to.
    – pisjatblin
    Oct 30 '20 at 17:06
  • Hi pisjatblin, thanks for the explanation! I wasn't sure whether you had meant to comment. I've copied your explanation into the answer. Maybe you could take another look and edit it further to round it out!
    – Murch
    Oct 30 '20 at 17:19
  • Hi Murch, thanks for your kind help converting my input in a readable output! :)
    – pisjatblin
    Oct 30 '20 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.