Compile Bitcoin Core from Source on Ubuntu
2015-11-07 00:11
465 查看
Ubuntu is often recommended as an operating system on which to runBitcoin Core. Although Bitcoin Core can be installed
as a precompiled binary, this method won't work in every case. This guide shows how to compile Bitcoin Core from scratch on a clean Ubuntu 14.04.2 system.
Why Compile?
The main reason to compile Bitcoin Core yourself is that it ensures you'll always have access to the latest release. For example, the binary Bitcoin Core package for Ubuntu 14.04 32-bit currently fails to install, giving the error message "E: Unable to locatepackage bitcoin-qt" (the 64-bit versioninstalls without a problem). Compiling and installing from source eliminates the need to rely on precompiled
binaries when updating.
A secondary reason to compile from source is that it requires less trust. Although the maintainers of the Bitcoin Core binary package do a fine job, binaries are a few steps removed from raw source code. With each step comes to potential for unexpected issues
that can't be easily detected. Source code, in contrast, can be inspected before compilation and installation.
Yet another reason to compile from source is to enable custom behavior. For example, the Bitcoin Core GUI and wallet can be disabled if you plan to use the software without those features.
Prerequisites
Searching for the Terminal application.
The method for installing Bitcoin Core described here requires that you enter text-based commands. The preferred way to do this is through the Terminal application. To access it, click the swirl button in the upper left of the desktop and type "terminal". Click
the leftmost button labeled "Terminal" to launch the application.
Running the Terminal application. Commands are entered after the dollar sign.
The Terminal application can alternatively be accessed through the keyboard shortcut Ctrl+Alt+T.
Update
Ubuntu uses a package manager to simplify the downloading and installation of software components. Over time, the configuration of these packages becomes outdated. Ensure that your version of Ubuntu has the latestpackage information with the following command. Enter your login password when prompted.
$ sudo apt-get update |
Download the Source
We'll use Git to access the Bitcoin Core source code. In addition to providing the current version of Bitcoin Core, Git gives ready access to all past and future versions. Enter yourlogin password when prompted.
$ sudo apt-get install git |
$ mkdir -p src && cd src $ git clone https://github.com/bitcoin/bitcoin.git |
lscommand.
$ ls bitcoin |
Install Dependencies
Bitcoin core requires many software libraries that don't come packaged by default with the Ubuntu distribution. The first one, build-essential,
enables software to be compiled from source.
$ sudo apt-get install build-essential |
Begin by downloading and verifying the BerkeleyDB source package.
$ wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz $ echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c |
db-4.8.30.NC.tar.gz: OK.
Next, unpack the BerkeleyDB source and compile.
$ tar -xvf db-4.8.30.NC.tar.gz $ cd db-4.8.30.NC/build_unix $ mkdir -p build $ BDB_PREFIX=$(pwd)/build $ ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX $ make install $ cd ../.. |
$ sudo apt-get install autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libtool |
Compile Bitcoin Core
To compile Bitcoin Core, move back into the previously-cloned git repository and checkout the current release tag. At the time of the last update to this article, that version is 0.10.0. Tags can be listed with the command git tag.
For now, ignore the warning about "'detached HEAD' state". Next, configure build, and install the binaries.
$ cd bitcoin $ git checkout v0.10.0 $ ./autogen.sh $ ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --with-gui $ make $ sudo make install |
bitcoin/docdirectory is a file called
build-unix.mdcontaining
more Linux build instructions and options.
Run Bitcoin Core
Bitcoin Core can now be run from the command line.$ bitcoin-qt |
The Bitcoin Core welcome screen.
Running this command should bring up the Bitcoin Core welcome screen.
from: http://bitzuma.com/posts/compile-bitcoin-core-from-source-on-ubuntu/
相关文章推荐
- android sqlite datetime demo
- sipXecs安装时配置DNS
- 求组合数(模板)
- Populating Next Right Pointers in Each Node II 解答
- Ubuntu14.10配置gedit
- Codeforces Round #329 (Div. 2)A. 2Char
- eclipse for android安装过程
- Application_Start和Application_End事件执行时间
- Android Studio导入Library
- 如何写工作总结中学德育工作计划
- 天津摄影工作室民政工作个人总结
- NFC的PN532读写命令格式
- NOIP2013花匠
- Arrays数组工具类
- poj 1426(同余模&&bfs)
- ACM常见组合博弈游戏
- spring集成jedis支持redis3.0集群
- navicat 创建存储过程
- HDU 2896 病毒侵袭(AC自动机)
- Codeforces Round #328 (Div. 2)C. The Big Race