How can I prune my Bitcoin Core correctly? The other way did not work for me. Have I done any unnoticed mistake?

0

1

Saving the entire blockchain in my computer is taking mi a lot of space. I looked in this forum for a solution and I saw that there was an option to prune the node and save a lot of space. I followed the instructions, I went to the Bitcoin data directory, I created a file there and called it "bitcoin.conf" and I wrote "-prune=1100" in it. Nothing I expected happened, the space it took remained the same, it only started downloading a new blockchain called "testnet". Have I done something wrong? And how can I fix it in order to save space? My version of Bitcoin Core is v0.14..2

PS: Latter, I have discovered that, in fact, I have three Bitcoin data directories, and suddenly I have doubts about in which of them shall I place my "bitcoin.conf". Is having three directory data how it shall be? And in which of them shall I place my "bitcoin.conf".

enter image description here

enter image description here

Ander Aristondo

Posted 2017-08-27T16:21:48.067

Reputation: 100

Can you post exactly the contents of your bitcoin.conf file? Can you also post the command that you are using to start Bitcoin Core with (if you are on windows, right click the shortcut you are using and copy the contents of the Target box).Andrew Chow 2017-08-27T16:44:20.603

Can you post exactly the contents of your bitcoin.conf file? prune=1100 And I am using Windows 10. I am not a computer expert so I do not understand the rest of the question.Ander Aristondo 2017-08-27T16:54:31.693

In the config file you need to use "prune=1100", not "-prune=1100". Is that the problem?Pieter Wuille 2017-08-27T16:58:16.033

I have tried both ways and it hasn´t work in any of both. Just now I have "prune=1100"Ander Aristondo 2017-08-27T17:00:48.470

Some questions have multiple answers. Since my answer is no longer identified as being correct, it will not be subject to mistake by others in thinking that I have answered your question. In the mean time, I am trying to see if I just need to add one more step to mine to make it work or not.Mine 2017-08-27T18:24:17.660

1

Possible duplicate of Can Bitcoin-Qt be configured to trim the blockchain?

MCCCS 2017-08-28T08:11:55.387

Have you restarted Bitcoin Core after adding the line to config? It is a startup parameter.Murch 2017-09-03T20:56:13.703

Answers

4

From your description it sounds to me that you may have edited your configuration file while Bitcoin Core was already running.

prune=1100 is a startup parameter. It will take effect once you restart the program.

  1. If you add a parameter to the startup instructions, parameters start with a dash (-prune=1100), e.g.:

    "C:\Users\<username>\AppData\Roaming\Bitcoin\bitcoin-qt.exe" -prune=1100
    

    Please make sure you use the correct path for the actual directory you installed Bitcoin to.

  2. If you add it to the configuration, the parameter must be listed without a dash in the bitcoin.conf:

    prune=1100
    

    If you're unsure how to locate your Bitcoin data directory, please see: Where is the configuration file of Bitcoin-Qt kept?

There is no need to manually delete any files from your Bitcoin directory, or to start over the initial blockchain download to enable pruning. You merely need to restart Bitcoin Core after you've edited the bitcoin.conf. If you don't know how to restart a program, you may find it simpler to shut down and restart your computer.

Murch

Posted 2017-08-27T16:21:48.067

Reputation: 41 609

How do I access to the startup instructions? And, is restarting the program, only, to close and open the program again (becouse I have already tried that)? Or, do I have to do something more?Ander Aristondo 2017-09-05T17:20:46.540

Yes, go to the menu, quit the program, start it again. At this point the bitcoin.conf gets used to initialize the program. Note that the standard "close window" operation is probably just hiding the program. You have to quit it, not hide it.Murch 2017-09-05T17:21:29.680

I have tried in different ways, I am sure I have restarted Bicoin Core, but it did not work. Now, I have discovered a new things that I will edit in the question.Ander Aristondo 2017-09-07T19:10:07.160

@AnderAristondo Use the folder from the first picture. Put the bitcoin.conf file there.Nick ODell 2017-09-07T19:12:01.827

-2

I have previously done this.

Go to your blockchain folder. Delete all blockchain files (blk***.dat and rev***.dat) except the two most recent ones for each file set (blk and rev). I've done that with no problems in the past.

****WARNING**** Your results may vary! ****WARNING****

The only risk is that you might have to re-download the whole blockchain again. Always have a backup of your wallet.dat file too!

The "most recent" files I'm referring to are the ones with the highest numbers. Mine currently go up to "rev00973.dat". If I were trying to manually prune my files, I'd delete "blk00000.dat" through "blk00971.dat" and "rev00000.dat" through "rev00971.dat".

NOTE: At least as of 8/27/2017 this method no longer works. I will update this if I am able to find a virtually similar method that does work.

Mine

Posted 2017-08-27T16:21:48.067

Reputation: 1 142

That should have been enough. You could always undelete the files instead of re-downloading. I will try it on mine right now to see if it still works. Did you delete the "index" subfolder by accident?Mine 2017-08-27T17:17:36.410

Okay, disregard my answer, I just tried it myself and it wanted to re-download the blockchain too. If it wants to re-download the blockchain, then that means my method no longer functions as I have described it. And of course, I can't undelete all the files, lol, now I have to download the whole blockchain again. Well, hopefully someone else will have a better answer or I will figure out a better answer. one or the other...Mine 2017-08-27T17:23:35.733

Ok. Thank your for your efford Mine.Ander Aristondo 2017-08-27T17:41:12.973

I clearly left it as "no longer works" and I get a negative vote? really? God forbid I leave it as a reference. Not to mention I want to double check and see if I need to tweak my instructions slightly. After all, its taking me about 2 days to re-download the blockchain....Mine 2017-08-28T16:57:11.860

The negative vote was not from meAnder Aristondo 2017-08-29T07:56:15.990

I've downvoted this answer, because manually deleting files is completely unnecessary and causes an unwanted new synchronization cycle. Suggesting that new users manually delete files from their bitcoin directory is potentially harmful as it may cause a loss of funds if a new user accidentally deletes their wallet.dat. Especially, you didn't tell them to shut down Bitcoin Core before mucking about in the directory, which could lead to corruption in other files if their deleting happens to coincide with read/write operations of the wallet.Murch 2017-09-03T21:18:52.247

Even if you add that your answer is wrong, it's not a useful answer. I've downvoted.Pieter Wuille 2017-09-07T19:12:12.187

Whatever guys, Its worked in the past, so notating that it has worked in the past enables it to be information available for those who are comparing versions etc. which, I would argue, falls within the boundaries of the purpose of keeping answers available online. Shall we down-vote all answers to all questions that are outdated by claiming they're "not useful" or shall we keep them there as sources of information?Mine 2017-09-07T21:33:03.400

3What you're suggesting was never a supported configuration, and likely only worked as long as nobody tried to download any of those blocks from you. I'm not downvoting because it's outdated - I'm downvoting because suggesting to randomly delete files is terrible advice regardless.Pieter Wuille 2017-09-09T00:29:50.447