I am working on a bitcoin development environment in a box, and I've got the bitcoin reference implementation compiling and running so far in this vagrant environment: https://github.com/tlehman/bitcoin-vagrant
Another feature I would like to add is an optional script in /home/vagrant that can download the bootstrap.dat file to speed up downloading the blockchain. My first stab at this problem was to use transmission-cli to download https://bitcoin.org/bin/blockchain/bootstrap.dat.torrent, and then copy it to ~/.bitcoin/, and then fire up
bitcoind for the first time. This works, but it fills up the virtual machine, and it still takes a long time to get imported. On top of that, a
vagrant destroy command would blow away all the blockchain data, which is not desirable, I'd like to decouple the data from the program and it's dependencies.
The way I tried to solve this was to mount ~/.bitcoin/ as /vagrant/data/ (which is mounted to a folder in the host filesystem). The problem I am having is that when I run
bitcoind -daemon, I get an error saying
Bitcoin server starting vagrant@precise64:~$ : Error opening block database. Do you want to rebuild the block database now?
My first guess was that the ~/.bitcoin/bootstrap.dat file was corrupted, but the SHA256 of the file is
d05062052be4dd6fbaeac5f17598e52f7ad545f9f938acefaf7067ecce1d7b5a, which matches the SHA256 in the torrent's readme.
My second guess was that LevelDB needs some filesystem feature that isn't present in VirtualBox's synced directories, but I am not sure what that would be.
What can I do to fix this or work around it?