Get the source first
git clone https://github.com/bitcoin/bitcoin.git cd bitcoin
You can read doc/build-unix.md, or follow along.
This step should be no problem.
./autogen.sh
This step may give you some issues…
./configure
If you encounter configure: error: libdb_cxx headers missing
sudo apt-get install libdb5.1++-dev
If you encounter configure: error: Found Berkeley DB other than 4.8, required for portable wallets (–with-incompatible-bdb to ignore), run the following command instead. You can always send your bitcoins to another wallet.
./configure --with-incompatible-bdb
If you encounter checking for boostlib >= 1.20.0… configure: We could not detect the boost libraries (version 1.20 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to –with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.
sudo apt-get install libboost-all-dev
This time you may have a clean run. However, if you scroll up to check the output lines, you may see this line: configure: WARNING: MOC not found; bitcoin-qt frontend will not be built. If you want the frontend, run:
sudo apt-get install libqt4-core libqt4-gui libqt4-dev
Then when you run configure again, you should see checking for moc-qt4… /usr/bin/moc-qt4.
Now, everything is ready.
make
The compilation took like 5 min.
Then install the compiled binary.
make install
Now just run the following to bring up the bitcoin frontend, yeah~~~
bitcoin-qt
To start mining, go to Help > Debug Window > Console and type in setgenerate true to turn it on. Type setgenerate false to stop. My machine became really hot after a while, probably coz my CPU was struggling with all the complex computations. I read that some people bought a separate GPU card for better performance, something to consider.
It’s worth noting that nowadays it’s very hard to efficiently mine bitcoins alone without dedicated software and hardware. Often miners form a pool (or a group) to speed up the process and share the profit. Read more at:
https://en.bitcoin.it/wiki/Pooled_mining
https://en.bitcoin.it/wiki/Comparison_of_mining_pools
Hi Brian,
I’ve been trying to optimize a source build for bitcoins – but I keep running into issues with the Berkeley db 4.8 install. I’ve included the –enable-cxx flag on the /dist/configure call, but when I try to configure bitcoin-master I still get the libdb_cxx header error. When I try the sudo apt-get install libdb_cxx command I get no package errors (even suffixing with 4.8).
I can get it working with the latest version of Berkeley, but then I have to select the incompatible bdb option. I’m using Ubuntu 12.04.3.
Have you any suggestions?
Many Thanks
Jim
LikeLike
Hey Jim, for the libdb_cxx error, could you try this command instead? See if it works?
sudo apt-get install libdb5.1++-dev
LikeLike
Thanks – that works – but won’t my build have an incompatible wallet?
LikeLike
The flag “–with-incompatible-bdb” will give you an incompatible BerkeleyDB, making your wallet unportable to other bitcoin versions. But as long as you are using the same bitcoin versions in different machines, you will be fine.
Ref: https://bitcointalk.org/index.php?topic=353613.0
Also you can export your wallet with Bitcoin-Qt and import it to other wallets.
Ref:
http://bitcoin.stackexchange.com/questions/13687/which-bitcoin-wallets-let-you-export-to-a-universal-wallet-format
https://blockchain.info/wallet/import-wallet
LikeLike
hello brian chan: it although help me compile, but when I execute your last command, bitcoin-qt,
——————————
bitcon-qt: command not found
—————————————-
mine is 13.10 upgrade to 14.04, linux kernel 3.13.0-24-generic
at make install stage,
nothing to be done for ‘install-exec-am’
or
‘install-data-am’.
is that right? (that looks is something wrong or culprit)
LikeLike
this helped me on compiling berkley 4.8 db so you don’t have to worry about incompatible wallets
http://bitzuma.com/posts/compile-bitcoin-core-from-source-on-ubuntu/
LikeLike
Good post. I will be going through some of these issues aas well..
LikeLike