Compile BitcoinQt from sources

Building Bitcoin client from sources is a good way to protect yourself from visiting and downloading malicious binary file from the official website. Imagine a group of hackes attacks DNS server so bitcoin.org redirects you to their website, it looks the same, it acts the same, but it contains backdoored Bitcoin-Qt wallet.

You can be smarter and download and compile the client from sources. To do so, just follow some simple steps:

Make sure you have git installed on your Linux distro:

Ubuntu/Debian: sudo apt-get install git make autoconf autogen gcc g++ libdb++-dev libboost-all-devel libssl-devel openssl -y
Fedora: sudo yum install install git make autoconf autogen gcc g++ libdb++-devel libboost-all-devel libssl-devel openssl libqt4-dev libprotobuf-dev
openSUSE: zypper install git make autoconf autogen gcc g++ libdb++-devel libboost-all-devel libssl-devel openssl

Now you must download the sources from the official repository at github.com, generate some files and compile the application:

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
./autogen.sh
./configure --with-gui --with-incompatible-bdb
make -j3 # first time, this will take a while

On my computers I keep bitcoin-qt executable files in the same directory where the wallet downloads blockchain, it’s just easier to backup and manage in the future.
If you this will be the first time you run Bitcoin-Qt, run this command:

mkdir ~/.bitcoin

After you compiled the client, you have three important binary files to copy to the ~/.bitcoin directory

cp ./src/qt/bitcoin-qt ~/.bitcoin/
cp ./src/bitcoin-cli ~/.bitcoin/
cp ./src/bitcoind ~/.bitcoin/

Yup, it’s done.

Now just run Bitcoin-Qt with:

~/.bitcoin/bitcoin-qt

OK. Let’s say it’s been some time since you compiled the wallet and now you want to update it.
Go to the directory where you downloaded Bitcoin-Qt before, like:

cd bitcoin
git pull  #download changes
make      #build binary files

Finished compilation?
You must copy those three files again:

cp ./src/qt/bitcoin-qt ~/.bitcoin/
cp ./src/bitcoin-cli ~/.bitcoin/
cp ./src/bitcoind ~/.bitcoin/
[Total: 0    Average: 0/5]