Suppose I have an archiving full node (i.e. a full node where all blocks are saved to disk forever) running on one of my computers.
Now suppose I have another computer where I'd like to run a separate full node, but where I need to prune blocks instead of archiving them because the disk of this computer doesn't have enough space to store every block.
Obviously, I could begin running the new pruned node from scratch as normal and have it download and validate every block from the Bitcoin Network. But this would be quite wasteful in terms of network bandwidth and CPU cycles, as I already have an archiving full node that I fully trust with the UTXO set and all of the blocks available.
How exactly could I copy (using standard tools like
rsync) only the data I absolutely need from the archiving node to this new pruned node that will store, say, 2 GiB worth of blocks (
Without a doubt, we'll want to copy the
chainstate folder over in full for the UTXO set. I assume we'll also want the
blocks/index folder for the block metadata in LevelDB as well (plus, it's only 112MiB at time-of-writing). So, the trick will be to copy only the
blocks/rev*.dat files that are absolutely necessary.
Copying everything over and then running with pruning enabled isn't an option as the disk isn't big enough.
Is it possible to, say, copy just the last 2 GiB worth of blocks from the
blocks/rev*.dat files to get the pruned node up and running?