2
1
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?
Can you create/edit files in that directory from the guest system? My hunch is that it doesn't have write permission. – Nick ODell – 2015-01-05T15:55:19.380
@NickODell Yes, I can create and delete files as vagrant user. – tlehman – 2015-01-05T17:22:26.727
are you running the vagrant box on a Windows machine or Linux? I've encountered strange problems before due to the difference in file-structures on the mounted directories – OACDesigns – 2015-01-06T09:48:44.227
@OACDesigns I'm running vagrant on Mac OS X, using HFS (case sensitive). – tlehman – 2015-01-06T17:12:34.653