How does pruning work?

Hyena

Member
Feb 27, 2017
42
60
So there's an option to only keep say 600 MiB of block chain data on disk. I just used it for the first time and indeed the directory did not grow larger than 700 something MiB. However, the device is actually limited by bandwidth not disk space and that's the reason why I enabled pruning. So the question is --- does pruning mode still make the node download the whole block chain or does it download just the set of most recent blocks until disk space usage cap is met? I really hope it does not download all the blocks consuming all my bandwidth.
 

freetrader

Moderator
Staff member
Dec 16, 2015
2,806
6,088
If you're syncing a new node from scratch, it will download the whole chain, verifying everything and only keep as much on-disk as you've told it to keep.

To understand the details, read the pruning section in the 0.11 release notes:
https://bitcoin.org/en/release/v0.11.0#block-file-pruning

To have pruning work as intended during initial sync on BU, you need to be running 1.0.1.1 or later. There's a pruning bug in earlier versions which would cause them to keep more data than configured.
 
  • Like
Reactions: Wildfire.ca

Hyena

Member
Feb 27, 2017
42
60
@freetrader
Ok thanks, I took that node offline then, can't afford to have it consume 100 GiB of downloading traffic. My ISP has capped it to 25 GiB per month. It would be really awesome if pruning didn't download all the blocks though.
 

freetrader

Moderator
Staff member
Dec 16, 2015
2,806
6,088
@Hyena : it's a pity with the ISP bandwidth limitation.

Running a pruned node would probably work fine, if it weren't for the size of the initial download.

The only way around that which I know of at the moment (perhaps some others know different ways) is to download the blockchain over some other uncapped connection (or get it from a trusted friend) and then copy it to the disk. I'm pretty sure this work for an already-pruned blockchain datadir too.
 
  • Like
Reactions: Hyena

Hyena

Member
Feb 27, 2017
42
60
thanks @freetrader this is an excellent idea. I will download a 600 MiB pruned block chain on a device that does not have bandwidth limitation. Then I will copy the datadir to USB memory stick. Finally I will copy it from the USB stick to the Raspberry Pi.
 

Members online