Christopher J. MacLellan
Research Scientist
Soar Technology, Inc.
chris.maclellan@soartech.com

Find me online at:

I have been hearing about bit coins a lot lately (here and here) and so I decided to check them out and give a basic overview of how to get a bit coin system running on Ubuntu. It was much more confusing then I thought it would be but I eventually got it working. Of course I immediately saw a number of interesting possibilities, which I will discuss at the end.

First, the easiest way to get started is to download the pre-compiled binary files for linux (available here). The gui for linux isn't working at this time because ubuntu doesn't have wxwidgets2.9 yet but the command line works great. Once you have the binary files downloaded extract them:

tar -zxvf bitcoin-0.3.22.tar.gz


Then make a bitcoin directory and bitcoin.conf file:

mkdir ~/.bitcoin
echo "rpcuser=un" > ~/.bitcoin/bitcoin.conf
echo "gen=0" >> ~/.bitcoin/bitcoin.conf
echo "rpcallowip=127.0.0.1" >> ~/.bitcoin/bitcoin.conf
echo "paytxfee=0.00" >> ~/.bitcoin/bitcoin.conf


With the directory created and the configuration file made go ahead and start the bitcoin server:

~/src/bitcoin-0.3.22/bin/64/bitcoind -daemon
bitcoin server starting


Once the server starts it will take quite a while to download the chain of blocks from the other bitcoin peers (for info on what this means check out this). It took my computer about 2-3 hours.

Once the server has finished loading the blocks you can download a client and have it request work from the server and start computing.

To check the status of your server you can run the following commands (list of commands here):

./bitcoind getinfo


This gives you information about how many blocks you've downloaded etc... I checked bitcoin block exploror to see how many blocks there were (129,000+ when I did this). I used this a lot because bitcoind never seemed to give me any output so I never knew what it was doing.

As far as the actual bitcoin calculation there are a couple of ways to do it:

I used pyminer because it is simple, the code is human readable, and it works with little to no hassle.

You could also have bitcoind compute directly by editing ~/.bitcoin/bitcoin.conf and replacing:

gen=0


with

gen=1


Then when you run bitcoind -daemon it will also be computing bitcoins.

The added benefit of doing things this way is you could edit the bitcoin.conf file to allow other ip addresses. Then you could have all of your clients connect to the single server to request and process work (essentially creating a local pool) with all of your bitcoins being stored in one place (this may or may not be a bad thing). You could also use this server to feed bitcoins up other ways since the bitcoind server handles json-rpc requests. I was even thinking it would be quite easy to make a javascript file that you could include in your website that could connect to your bitcoind server. Then you could harvest cpu power from your web traffic, an interesting idea that others have experimented with (http://www.bitcoinplus.com/generate). I found a general lack of the absolute basics on how to get the bitcoind running on linux/ubuntu (mac and windows have gui's) and I hope this clears up some of those basics.