Bitcoin Forum
November 27, 2026, 03:45:44 PM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: Pruned Node - Decrease size  (Read 389 times)
dkbit98
Legendary
*
Offline

Activity: 3164
Merit: 9017


AntiSwap.io - NO AML/KYC EXCHANGER MONITORING


View Profile WWW
December 05, 2024, 01:54:25 PM
 #21

I do already run a full monero node and full bitcoin node on my raspberry pi.
I ve done a tutorial for the forum as well in case anybody is interested. [1]
I have experienced long delays and also some bandwidth issues with the monero node so I know!
When is the last time you checked you drive health status?
I don't know what type of drive you are using, but having data written all the time on it is seriously reducing it's life.
SSD drives are probably going to be affected more by this, so it's better to have something with larger TBW (Total Bytes Written).

SSD needs free space for TRIM and wear-leveling algorithms to work better. Having little free space left on SSD means all writes and wear leveling is going to mostly happen in that free space. So it is either full node or pruned node to like 2GB.
This is correct, free space is very important and I would enable additional free space with Over Provisioning in settings if that is possible.

Here's an alternative: use Feather with Monero, and use an instant exchanger each time you need to make a small Bitcoin payment.
I never tried instant exchanger in Feather.
Are they charging any additional fee for this?

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 05, 2024, 01:58:46 PM
 #22

having data written all the time on it is seriously reducing it's life.
When I did an IBD (for Bitcoin) on a system with 8 GB RAM, it wrote about 4 TB (if I remember correctly) to disk. It takes a chunk out of the SSD's life, but you can do it many times before reaching the disk's limit.

Quote
I never tried instant exchanger in Feather.
Are they charging any additional fee for this?
I meant an external exchanger, I never use anything in-wallet.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 05, 2024, 09:09:00 PM
 #23

I 've taken all your helpful posts into consideration.

I 'll use different wallets in my 2 laptops. The wallets will live in the laptops' disks and I will not use an external SSD.

I know, it's a big difference from the current setup but I 've considered my needs and it looks like it can work this way.

Finally, I 'll change the pruned size to the minimum, since I don't need to restore old wallets. I 'll just make sure to examine what NotATether said about not being able to re-increase the pruning size afterwards.

apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 28, 2024, 05:04:29 PM
 #24

Update:

1. I 've followed the idea that I posted in the exact previous post and everything works flawlessly.
2. For the record, I tried decreasing my pruned size on my ex-node and it worked as everyone suggested.
3. Also NotATether was right, if you wanna increase the size, it's impossible. It will need to re-download the whole blockchain again.

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 28, 2024, 05:47:02 PM
 #25

3. Also NotATether was right, if you wanna increase the size, it's impossible. It will need to re-download the whole blockchain again.
You can increase the size, but not "backwards", only forward. So if you use -prune=550, you can change to -prune=55000, and in the future it will only prune when your blocks directory is a lot larger.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 28, 2024, 07:03:02 PM
 #26

You can increase the size, but not "backwards", only forward. So if you use -prune=550, you can change to -prune=55000, and in the future it will only prune when your blocks directory is a lot larger.

Sorry I didn't catch that.
If I use -prune=550 and change it to -prune=55000, won't it need to re-download the chain? I am almost sure it will.

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 28, 2024, 07:11:02 PM
Merited by nc50lc (1)
 #27

If I use -prune=550 and change it to -prune=55000, won't it need to re-download the chain? I am almost sure it will.
Nope, "prune" only means it deletes blocks once the data directory is too large. If you increase the prune-amount, there's nothing to delete for a couple of weeks (or months). I tested it before posting, no complaints from Bitcoin Core Smiley

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 28, 2024, 07:13:10 PM
 #28

Nope, "prune" only means it deletes blocks once the data directory is too large. If you increase the prune-amount, there's nothing to delete for a couple of weeks (or months). I tested it before posting, no complaints from Bitcoin Core Smiley

Well since you 've tested, I can't argue against it. It's good to know that!
When I "tried" it, the blocks directory wasn't getting bigger.
I only left it on for a day or so, though.

nc50lc
Legendary
*
Offline

Activity: 3346
Merit: 9390


Self-proclaimed Genius


View Profile
December 29, 2024, 05:57:56 AM
Merited by LoyceV (6), ABCbits (3), apogio (1)
 #29

To clear your doubts, here an actual testing, in mainnet even;
I fired-up an "instant pruned node" in Windows for this (copied a fully synced pruned Bitcoin Core node's bitcoin data directory):

The initial prune setting was 7GB:
The size of blocks directory was about 6,913,200,128 Bytes:
I changed the prune value to 5GB (Decrease):
The size of blocks directory dropped down to 5,059,657,728 Bytes:
I changed the prune value to 6GB (Increase):
The size of blocks directory after a little while increased by a few MB, 5,062,705,152 Bytes:

Nothing triggered the node to redo IBD.

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 29, 2024, 10:07:32 AM
 #30

The size of blocks directory after a little while increased by a few MB
To add more confusion: even without changing anything, the size of a pruned node's blocks directory increases by a few MB all the time Tongue Pruning isn't instant, it takes a while, then it deletes several old blocks at once.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
NotATether
Legendary
*
Offline

Activity: 2534
Merit: 10763


┻┻ ︵㇏(°□°㇏)


View Profile WWW
December 29, 2024, 10:57:00 AM
 #31

The size of blocks directory after a little while increased by a few MB
To add more confusion: even without changing anything, the size of a pruned node's blocks directory increases by a few MB all the time Tongue Pruning isn't instant, it takes a while, then it deletes several old blocks at once.

Well hopefully the increase is not too significant. Because I imagine if it takes 10 GB more of space before it gets cleaned up then it could cause an out-of-disk-space error in Core (I believe the threshold is 500MB free or something close to that).

▄▄████████████████████▄▄
▄███████▀▀██████▀▀███████▄
█████▀██████████████▀█████
████████▄▄██████▄▄████▀███

██████████████████████████
██▄▄██████████████▄▄██████
██▀▀██████████████████▄▄██
██████▀▀██████████████▀▀██
██████████████████████████
███▄████▀▀██████▀▀████████
█████▄██████████████▄█████
▀███████▄▄██████▄▄███████▀
▀▀████████████████████▀▀
 
 DΞX.fo 
▄▄██████
█████████
██████████
██████████
██████████
█████████
▀▀██████

▄███████
▄██████████
████████████
█████████████
█████████████
|
▄▄█
▄████▀
▄███▀█▄
▄██▀█▄██
█████▀▀█
████████
████████
▀██▄████
▄████▄▄█
▄█████▀███
▄█████▀████▀
█████▀███████
▀██▀█████████
|..BTC......XMR...
..USDT.....LTC...
....Fees  0.8%.....
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 29, 2024, 05:04:01 PM
 #32

To clear your doubts, here an actual testing, in mainnet even;
I fired-up an "instant pruned node" in Windows for this (copied a fully synced pruned Bitcoin Core node's bitcoin data directory):

Thanks a lot for the info mate.

So, I guess if you change the pruning size to 7GB (the initial one) and leave the node run long enough it should re-occupy approximately 6,913,200,128 Bytes (the initial size).

nc50lc
Legendary
*
Offline

Activity: 3346
Merit: 9390


Self-proclaimed Genius


View Profile
December 30, 2024, 03:42:06 AM
Merited by apogio (1)
 #33

To clear your doubts, here an actual testing, in mainnet even;
I fired-up an "instant pruned node" in Windows for this (copied a fully synced pruned Bitcoin Core node's bitcoin data directory):
Thanks a lot for the info mate.

So, I guess if you change the pruning size to 7GB (the initial one) and leave the node run long enough it should re-occupy approximately 6,913,200,128 Bytes (the initial size).
Yes, in fact, I've kept the datadir and after a day the blocks directory's size grew to 5,312,544 Bytes since a day worth of blocks aren't enough to reach the last size that I've set.


As expected, the "pruneheight" result in getblockchaininfo command stayed the same as when it's set to 5GB.
Code:
...
  "initialblockdownload": false,
  "chainwork": "0000000000000000000000000000000000000000a3e08f9ef58fd82c4c944c98",
  "size_on_disk": 5174275967,
  "pruned": true,
  "pruneheight": 874176,
  "automatic_pruning": true,
  "prune_target_size": 5999951872,
...

apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 30, 2024, 10:46:14 AM
 #34

So, final question.

Let's say I have a node with the minimum pruning size.

One day, I find a USB stick, where I have a wallet.dat file that I had generated 2 years ago.

Could I just:
1. import the wallet.dat file
2. increase the pruning size to something that includes blocks from 2 years ago
3. once imported, decrease the pruning size again

?

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 30, 2024, 10:59:26 AM
 #35

One day, I find a USB stick, where I have a wallet.dat file that I had generated 2 years ago.

Could I just:
1. import the wallet.dat file
2. increase the pruning size to something that includes blocks from 2 years ago
Nope, this won't work:
You can increase the size, but not "backwards", only forward.
The blockchain can only be verified in one direction: from start to end. Each block needs the previous blocks to verify it.

However, if you think there's any chance this might happen, you could create a few "annual snapshots" during IBD. If you have a 2021-snapshot, you could load your 2022 wallet into that one and let it sync the rest. I wouldn't bother though: if ever needed, just restart from scratch.

Stats: on my new server, in the past 14 days, bitcoind (with -maxuploadtarget=400000) (400 GB/day) has uploaded 3.77 TB. That's one full blockchain every 2.5 days. That's more than my previous server used to do, while it had a 25% higher upload target.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 30, 2024, 11:13:25 AM
 #36

Nope, this won't work:
You can increase the size, but not "backwards", only forward.
The blockchain can only be verified in one direction: from start to end. Each block needs the previous blocks to verify it.

However, if you think there's any chance this might happen, you could create a few "annual snapshots" during IBD. If you have a 2021-snapshot, you could load your 2022 wallet into that one and let it sync the rest. I wouldn't bother though: if ever needed, just restart from scratch.

Well since my internet speed is good and my hardware is good, I won't do the snapshots thing.
But the info is useful.
If I wanted to do it, what would I need to do? It's not very easy for me to grasp what this "2021-snapshot" is.

LoyceV
Legendary
*
Offline

Activity: 4242
Merit: 23251


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 30, 2024, 02:54:35 PM
 #37

If I wanted to do it, what would I need to do? It's not very easy for me to grasp what this "2021-snapshot" is.
Start syncing a pruned blockchain from scratch. By the time you've reached 2021, stop Bitcoin Core, and copy it's data directory (~/.bitcoin on Linux) to a new directory named "2021_snapshot". If you ever need it, you can use it to restart syncing from 2021.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 30, 2024, 11:35:15 PM
 #38

Start syncing a pruned blockchain from scratch. By the time you've reached 2021, stop Bitcoin Core, and copy it's data directory (~/.bitcoin on Linux) to a new directory named "2021_snapshot". If you ever need it, you can use it to restart syncing from 2021.

Aaah I see. It's a manual (kinda hacky) process. I thought there was a feature for it on bitcoin core. Sounds good anyway. Thanks.

nc50lc
Legendary
*
Offline

Activity: 3346
Merit: 9390


Self-proclaimed Genius


View Profile
December 31, 2024, 03:45:34 AM
Merited by ABCbits (2)
 #39

Could I just:
1. import the wallet.dat file
This is a no-go on pruned mode.
You can only either keep your wallets loaded (you can close Bitcoin Core for a long time without unloading wallet files) or create a new wallet file.
If you ever need to unload a wallet for some reason, make sure to load it before its last synced block gets pruned by your node.
Else, since Bitcoin Core will have to do a rescan and it can't be done if the block where it should start is already pruned, it will have to redo IBD.

AFAIK, the workaround here is to import the wallet's "descriptors" to a blank wallet without rescanning via importdescriptors with "timestamp": "now",
Then manually import all the associated UTXO(s) from the pruned blocks via importprunedfunds command.
However, that requires "txoutproof" which can be requested from another person's node.

apogio (OP)
Legendary
*
Offline

Activity: 1106
Merit: 2400


View Profile
December 31, 2024, 09:04:44 AM
 #40

AFAIK, the workaround here is to import the wallet's "descriptors" to a blank wallet without rescanning via importdescriptors with "timestamp": "now",
Then manually import all the associated UTXO(s) from the pruned blocks via importprunedfunds command.
However, that requires "txoutproof" which can be requested from another person's node.

Sounds to me like if I ever unload a wallet, I 'll just load it again and rescan the blockchain.
Normally, this won't happen often, but all the workarounds are either too manual or scary, so for me it's a no brainer to re-download the chain.

Pages: « 1 [2] 3 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!