I'm looking to run bitcoind on a virtual machine.
However the main nets Blockchain size is over 21GB, and growing.
Is there a way to compress this down or lower the amount of disk-space needed for the full Blockchain?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
No, there isn't any straightforward way to reduce the disk space requirement. The block chain is the size that it is.
There are various ways proposed for bitcoind to use less disk space (see diskspace), but as far as I know, none of them have yet been added to the standard distribution.
What you can in your very specific case do is include a symlink to a folder that resides outside of your virtual machine (i.e., a shared folder with the host machine). Then the blockchain can fit in there with plenty of space.
Note, however, that people have sent virus signatures to the blockchain, so if your host is running windows, you'll have to deal with that and not quarentine specific folders.
There's currently no solution built into Bitcoin Core. I think that it would be possible to write a script that periodically moves the blkxxxx.dat files into a compressed filesystem and replaces the original files with symlinks. These files are large and reasonably compressible, so you might save a few GBs this way. The other database files are not very compressible, though.
The large blkxxxx.dat files are actually unused by Bitcoin Core except to transmit old blocks to peers, rescan the block chain for wallet transactions, handle reorgs, and fetch arbitrary blocks/transactions via JSON-RPC. Changing Bitcoin Core to discard this data would be fairly easy, but if everyone did this then the network would collapse, so it's not supported currently. In the future, nodes will probably only store a random subset of this data (maybe a few GBs) and discard the rest.