Why it's not possible to prune block storage data in specific date range?
Let's say I need 2years worth back of block storage data, since I'm downloading the block storage why it's not possible to keep a specific time range block storage data on my Bitcoin core directory.
Could not find any way to make this happen.
Since you asked why, I'll answer with: because it's not yet implemented to prune option or as a new "
prune by timestamp" option.
But it's not impossible to implement if it's necessary.
For the current version of the reference client, the closest feature that you can utilize is "
manual pruning".
Setting "
prune=1" in your config or adding
--prune as a command line arg will enable that.
With that enabled, you can use
pruneblockchain command which supports epoch timestamp as arg. (
set it to a date 2 years ago)
But you'll have to do it periodically since it's manual.
Here's the documentation of that command:
bitcoincore.org/en/doc/30.0.0/rpc/blockchain/pruneblockchain