How to compile and install Bitcoin Core on Debian Wheezy
Do you want to use Bitcoin on Linux? This tutorial explains how to install and use Bitcoin Core on Debian Linux. Bitcoin Core is the official Bitcoin Wallet from bitcoin.org. I will use the latest version from the GIT repository at bitcoin.org.
In order to compile and run, Bitcoin Core depends on some other tools which must be installed prior to compiling :
Install some dependencies:
For bitcoin-core
sudo apt-get install build-essential autoconf libssl-dev libboost-dev libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev
For bitcoin-qt (graphical interface)
If you want the graphical frontend, also install the following dependencies. If you just want bitcoind, you can skip this step.
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler libqrencode-dev
Installing Berkeley DB 4.8
Compiling Bitcoin Core requires the Berkeley DB version 4.8 which is not available in the wheezy repositories, so we must use squeeze repositories. Note that if you don't need a wallet (i.e. if you want to run a headless Bitcoin node and keep your wallet elsewhere) you can completely skip this section and jump directly to downloading and compiling Bitcoin Core.
1.Change the sources.list to use squeeze repositories
Edit /etc/apt/sources.list :
vi /etc/apt/sources.list
Add the following lines in the head of file :
deb http://[your favorite repository]/debian/ squeeze main contrib non-free deb-src http://[your favorite repository]/debian/ squeeze main contrib non-free
2.Now you can install Berkeley DB version 4.8 (libdb4.8)
apt-get install libdb4.8++-dev libdb4.8-dev
Downloading and Compiling Bitcoin Core
Go to the branches list on the Bitcoin Core project site (https://github.com/bitcoin/bitcoin/branches), locate the latest version number, and substitute "0.11" in the command below with that.
cd /root git clone -b 0.11 https://github.com/bitcoin/bitcoin.git cd bitcoin/
Configure the system for compilation
./autogen.sh
if you dont need bitcon GUI, use this command :
./configure --without-gui
else use this :
./configure
Note: If you skipped the Berkeley DB 4.8 dependency above because you don't need a wallet, you must add "--disable-wallet" (without the quotation marks) to the end of the line that starts with ./configure above.
Compile
make
Installing and Running Bitcoin Core
make install
After that, you will be able to run Bitcoin Core by typing:
bitcoind (the text based backend)
bitcoin-qt (the graphical frontend)
bitcoin-cli (the command-line client)
Extra
Some useful command lines :
To start bitcoin server as daemon :
bitcoind -daemon
To get a list of accounts on the system :
bitcoin-cli listreceivedbyaddress 0 true
To associate an existing address (here : 1GBykdD628RbYPr3MUhANiWchoCcE52eW2) to an account name :
bitcoin-cli setaccount 1GBykdD628RbYPr3MUhANiWchoCcE52eW2 myfirstaccount
To send bitcoins (here : 0.15) to an address (here : 1AYJyqQHCixxxxxxffevxxxxQosCWqn1bT) :
bitcoin-cli sendfrom myfirstaccount 1AYJyqQHCixxxxxxffevxxxxQosCWqn1bT 0.15
To know if your server is up to date (synchronised) :
echo `bitcoin-cli getblockcount 2>&1`/`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`