Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: non destructive prune switch #10217

Closed
pscTheOne opened this issue Apr 15, 2017 · 1 comment
Closed

feature request: non destructive prune switch #10217

pscTheOne opened this issue Apr 15, 2017 · 1 comment

Comments

@pscTheOne
Copy link

-prune option deletes blockchain files irreversibly.
A switch (like -prune-keep-files for renaming the files instead of deleting would enable someone with a fully downloaded blockchain to create a trusted pruned node to copy onto other computers and thereafter revert to a full blockchain without first having to backup .bitcoin/blocks

@pscTheOne pscTheOne changed the title non destructive prune switch feature request: non destructive prune switch Apr 15, 2017
@laanwj
Copy link
Member

laanwj commented Apr 17, 2017

There is a fastcopy_chainstate script here that helps with doing that conveniently: https://gist.github.com/laanwj/3c4614a23e072cbb3d39090da1834a68
I use this for testing pruning.
It uses hard links to quickly make a "copy" of the chain state + utxo set. The files that are not changed by bitcoind are linked, the rest is copied. Files not necessary for this (such as the wallet, debug log, etc) are not copied.
This copy of the data directory can be pruned at will, then copied, or simply deleted without adverse effect on the original datadir.

@maflcko maflcko closed this as completed Apr 26, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants