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 "rpcpassword=pw" >> ~/.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):
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:
Then when you run bitcoind-daemon it will also be computing bitcoins.