Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: doof on February 11, 2016, 10:35:51 AM



Title: Pruning questions
Post by: doof on February 11, 2016, 10:35:51 AM
On my bit nodes hardware, I only have a 64gb card.  I upgraded the client to 0.11.2

Ive set prune 50gb via prune=50000

However, seems to be more like 5gb.  Anyone else seen this?


Title: Re: Pruning questions
Post by: watashi-kokoto on February 11, 2016, 12:07:43 PM
Ive set prune 50gb via prune=50000


set prune=45000

problem solved


Title: Re: Pruning questions
Post by: belcher on February 11, 2016, 12:52:51 PM
Read this: https://bitcoin.org/en/release/v0.11.0#block-file-pruning

Quote
To recap, there are four types of data related to the blockchain in the bitcoin system: the raw blocks as received over the network (blk???.dat), the undo data (rev???.dat), the block index and the UTXO set (both LevelDB databases). The databases are built from the raw data.

Block pruning allows Bitcoin Core to delete the raw block and undo data once it’s been validated and used to build the databases. At that point, the raw data is used only to relay blocks to other nodes, to handle reorganizations, to look up old transactions (if -txindex is enabled or via the RPC/REST interfaces), or for rescanning the wallet. The block index continues to hold the metadata about all blocks in the blockchain.

The user specifies how much space to allot for block & undo files. The minimum allowed is 550MB. Note that this is in addition to whatever is required for the block index and UTXO databases.

My bold.

The solution is as watashi-kokoto writes, set a lower pruning threshold.


Title: Re: Pruning questions
Post by: doof on February 12, 2016, 11:08:18 AM
Ive set prune 50gb via prune=50000


set prune=45000

problem solved
lol, let me try again.  Ive attempted to set my block size limits to 50GB via the command prune=50000.   However, after letting the node run for a week, It has only consumed 5GB, not 50GB.

Is it out by a magnitude?  Has anyone else seen this?


Title: Re: Pruning questions
Post by: 7788bitcoin on February 12, 2016, 11:15:08 AM
By the way, are we expecting wallet support soon for the pruning mode?


Title: Re: Pruning questions
Post by: Jet Cash on February 12, 2016, 11:21:56 AM
I assume that in order to prune, core needs to start with the full blockchain. How does it prune? Does it delete records from the reference blockchain, or does it build a new pruned blockchain?


Title: Re: Pruning questions
Post by: TierNolan on February 12, 2016, 01:55:46 PM
I assume that in order to prune, core needs to start with the full blockchain. How does it prune? Does it delete records from the reference blockchain, or does it build a new pruned blockchain?

It deletes as it goes.  It downloads the headers first to find the longest chain and then downloads the blocks.  As each block is received, it is added to the block database.  While it is doing this, it is checking the blocks to see if there are any transactions for the wallet and storing them separately.  Once the block database goes over 10GB (or whatever your threshold), it deletes the oldest blocks first and will never delete a block that was received less than 2 days ago.  As the validation progresses, it always has around 10GBs worth of newest blocks. 


Title: Re: Pruning questions
Post by: Jet Cash on February 12, 2016, 02:21:39 PM
Thanks for that explanation. Does this mean that I have to download the entire blockchain again if I want to use pruning, or can I use a blockchain stored on (say) a USB stick?


Title: Re: Pruning questions
Post by: TierNolan on February 12, 2016, 02:29:33 PM
Thanks for that explanation. Does this mean that I have to download the entire blockchain again if I want to use pruning, or can I use a blockchain stored on (say) a USB stick?

You can bootstrap the blockchain from an external file.  You have to get it one way or another if you want to scan for transactions.  The pruning flag keep the block database at the limit (though the UTXO set and wallet data is separate).


Title: Re: Pruning questions
Post by: doof on February 17, 2016, 06:30:55 AM
I assume that in order to prune, core needs to start with the full blockchain. How does it prune? Does it delete records from the reference blockchain, or does it build a new pruned blockchain?

It deletes as it goes.  It downloads the headers first to find the longest chain and then downloads the blocks.  As each block is received, it is added to the block database.  While it is doing this, it is checking the blocks to see if there are any transactions for the wallet and storing them separately.  Once the block database goes over 10GB (or whatever your threshold), it deletes the oldest blocks first and will never delete a block that was received less than 2 days ago.  As the validation progresses, it always has around 10GBs worth of newest blocks. 

Heres my node running 0.11.2 and prune.  http://101.165.103.43:1008

Just seems to be stuck on that block number, and only 5gb not 50gb.


Title: Re: Pruning questions
Post by: Dagwanoenyent on February 18, 2016, 12:17:17 AM
So using this prooning you can reduce size of synchronized folder?
Youtube video about this will be very helpful.


Title: Re: Pruning questions
Post by: Moloch on February 18, 2016, 06:56:40 AM
So using this pruning you can reduce size of synchronized folder?
Youtube video about this will be very helpful.

Yes, it reduces the data stored... I set it to 550MB (the minimum), which ends up taking ~2GB of disk space instead of 60GB

Keep in mind, you lose a bit of functionality... If you ever need to rescan the blockchain, it will need to download the entire 60GB again


Title: Re: Pruning questions
Post by: Jackling on February 19, 2016, 06:43:34 PM
So using this pruning you can reduce size of synchronized folder?
Youtube video about this will be very helpful.

Yes, it reduces the data stored... I set it to 550MB (the minimum), which ends up taking ~2GB of disk space instead of 60GB

Keep in mind, you lose a bit of functionality... If you ever need to rescan the blockchain, it will need to download the entire 60GB again

I have several wallet, they are created at different times. So it is very inconvenient if I have to download the whole blockchain again and again.


Title: Re: Pruning questions
Post by: Moloch on February 20, 2016, 09:34:01 AM
So using this pruning you can reduce size of synchronized folder?
Youtube video about this will be very helpful.

Yes, it reduces the data stored... I set it to 550MB (the minimum), which ends up taking ~2GB of disk space instead of 60GB

Keep in mind, you lose a bit of functionality... If you ever need to rescan the blockchain, it will need to download the entire 60GB again

I have several wallet, they are created at different times. So it is very inconvenient if I have to download the whole blockchain again and again.

If that is the case, don't run it in pruned mode... 60GB isn't that much space


Title: Re: Pruning questions
Post by: Dagwanoenyent on February 20, 2016, 09:26:39 PM
I'm only need pruned blockchain - wallet for sending and receiving coins.
This will work without problems?


Title: Re: Pruning questions
Post by: ranochigo on February 21, 2016, 02:37:10 AM
I'm only need pruned blockchain - wallet for sending and receiving coins.
This will work without problems?
Currently, as of 0.11.2, wallet support and new block relaying are disabled. They should be enabled in 0.12. However, if you have to add a new address using a private key, you need to redownload and verify the blockchain to scan for older transactions.


Title: Re: Pruning questions
Post by: Dagwanoenyent on February 22, 2016, 08:55:33 PM
I'm only need pruned blockchain - wallet for sending and receiving coins.
This will work without problems?
Currently, as of 0.11.2, wallet support and new block relaying are disabled. They should be enabled in 0.12. However, if you have to add a new address using a private key, you need to redownload and verify the blockchain to scan for older transactions.
This sound complicated..I hope this new version will be stable.
I saw beta version ready for downloading..
Thanks.