Sunday, September 21, 2014

Setting up a Ruby Bitcoin Machine, part 1

The next few posts are a record for myself, on how to install and set up a Linux machine to allow me to write programs that do bitcoin related things in Ruby, using the bitcoin-ruby system.

Step 1: Install Ubuntu 14.04 on a spare laptop. Make sure it's a 64 bit AMD machine, and that you install the right version. The required file can be obtained from http://www.ubuntu.com/download/desktop

It's free if you select the "No, take me to the download" link at the bottom right. An iso file called ubuntu-14.04.1-desktop-amd64.iso will appear in your download folder. Burn it to a DVD as an image.

Reboot the machine you want to install on, and boot from the DVD. Choose to install it, and don't select home folder encryption because it will slow down your programs.

Step 2: Boot up and get all the updates for Ubuntu (in the top left swirl icon, type updater and click on "Software Updater"). Then download the bootstrap.dat bitcoin blockchain by selecting the torrent bootstrap.dat.torrent from the page http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/

This is a multi-gigabyte file so the torrent downloaded will take a while.

In the meantime install the Bitcoin-qt client. Open a terminal (Ctrl+Alt+T) and type:

$ sudo apt-add-repository ppa:bitcoin/bitcoin
$ sudo apt-get update
$ sudo apt-get install bitcoin-qt

Click on the swirl icon and type bitcoin. The Bitcoin program with the orange logo should appear. Run it, but stop it after about 5 minutes.

When bootstrap.dat has downloaded copy it from the Downloads folder to the .bitcoin folder (you need to select Show Hidden Files from the View menu in the file explorer, or  user Ctrl+H).

Now you can run the Bitcoin client, and it will load the blocks off disk (this took about 4 hours for my laptop), and will then catch up with the remaining blocks from the network (another 16 hours or so). Now there is a complete copy of the blockchain in ~/.bitcoin/blocks/





No comments:

Post a Comment