Changeset View
Changeset View
Standalone View
Standalone View
doc/build-unix.md
Show All 36 Lines | |||||
libboost | Utility | Library for threading, data structures, etc | libboost | Utility | Library for threading, data structures, etc | ||||
libevent | Networking | OS independent asynchronous networking | libevent | Networking | OS independent asynchronous networking | ||||
Optional dependencies: | Optional dependencies: | ||||
Library | Purpose | Description | Library | Purpose | Description | ||||
------------|------------------|---------------------- | ------------|------------------|---------------------- | ||||
miniupnpc | UPnP Support | Firewall-jumping support | miniupnpc | UPnP Support | Firewall-jumping support | ||||
libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled) | libdb | Berkeley DB | Wallet storage (only needed when wallet enabled) | ||||
qt | GUI | GUI toolkit (only needed when GUI enabled) | qt | GUI | GUI toolkit (only needed when GUI enabled) | ||||
protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled) | protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled) | ||||
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled) | libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled) | ||||
univalue | Utility | JSON parsing and encoding (bundled version will be used unless --with-system-univalue passed to configure) | univalue | Utility | JSON parsing and encoding (bundled version will be used unless --with-system-univalue passed to configure) | ||||
libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.x) | libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.x) | ||||
For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*. | For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*. | ||||
Show All 20 Lines | |||||
install necessary parts of boost: | install necessary parts of boost: | ||||
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev | sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev | ||||
2. If that doesn't work, you can install all boost development packages with: | 2. If that doesn't work, you can install all boost development packages with: | ||||
sudo apt-get install libboost-all-dev | sudo apt-get install libboost-all-dev | ||||
BerkeleyDB is required for the wallet. | BerkeleyDB 5.3 or later is required for the wallet. This can be installed with: | ||||
**For Ubuntu only:** db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin). | sudo apt-get install libdb-dev | ||||
You can add the repository and install using the following commands: | sudo apt-get install libdb++-dev | ||||
sudo apt-get install software-properties-common | |||||
sudo add-apt-repository ppa:bitcoin/bitcoin | |||||
sudo apt-get update | |||||
sudo apt-get install libdb4.8-dev libdb4.8++-dev | |||||
For Debian, BerkeleyDB 4.8 can be installed by following the instructions in the “Berkeley DB” section below. | |||||
Ubuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install | |||||
BerkeleyDB 5.1 or later, which break binary wallet compatibility with the distributed executables which | |||||
are based on BerkeleyDB 4.8. If you do not care about wallet compatibility, | |||||
pass `--with-incompatible-bdb` to configure. | |||||
See the section "Disable-wallet mode" to build Bitcoin ABC without wallet. | See the section "Disable-wallet mode" to build Bitcoin ABC without wallet. | ||||
Optional (see --with-miniupnpc and --enable-upnp-default): | Optional (see --with-miniupnpc and --enable-upnp-default): | ||||
sudo apt-get install libminiupnpc-dev | sudo apt-get install libminiupnpc-dev | ||||
ZMQ dependencies (provides ZMQ API 4.x): | ZMQ dependencies (provides ZMQ API 4.x): | ||||
Show All 22 Lines | |||||
Once these are installed, they will be found by configure and a bitcoin-qt executable will be | Once these are installed, they will be found by configure and a bitcoin-qt executable will be | ||||
built by default. | built by default. | ||||
Dependency Build Instructions: Fedora | Dependency Build Instructions: Fedora | ||||
------------------------------------- | ------------------------------------- | ||||
Build requirements: | Build requirements: | ||||
sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel | sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb-devel libdb-cxx-devel | ||||
Optional: | Optional: | ||||
sudo dnf install miniupnpc-devel | sudo dnf install miniupnpc-devel | ||||
To build with Qt 5 (recommended) you need the following: | To build with Qt 5 (recommended) you need the following: | ||||
sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel | sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel | ||||
Show All 14 Lines | |||||
[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( | [miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( | ||||
http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and | http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and | ||||
turned off by default. See the configure options for upnp behavior desired: | turned off by default. See the configure options for upnp behavior desired: | ||||
--without-miniupnpc No UPnP support miniupnp not required | --without-miniupnpc No UPnP support miniupnp not required | ||||
--disable-upnp-default (the default) UPnP support turned off by default at runtime | --disable-upnp-default (the default) UPnP support turned off by default at runtime | ||||
--enable-upnp-default UPnP support turned on by default at runtime | --enable-upnp-default UPnP support turned on by default at runtime | ||||
Berkeley DB | |||||
----------- | |||||
It is recommended to use Berkeley DB 4.8. If you have to build it yourself: | |||||
```bash | |||||
BITCOIN_ROOT=$(pwd) | |||||
# Pick some path to install BDB to, here we install in /usr/local/db4 | |||||
BDB_PREFIX="/usr/local/db4" | |||||
sudo mkdir -p $BDB_PREFIX | |||||
cd $BDB_PREFIX/.. | |||||
# Fetch the source and verify that it is not tampered with | |||||
sudo 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 | |||||
sudo tar -xzvf db-4.8.30.NC.tar.gz | |||||
# Build the library and install to our prefix | |||||
cd db-4.8.30.NC/build_unix/ | |||||
# Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime | |||||
sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX | |||||
sudo make install | |||||
# Configure Bitcoin ABC to use our own-built instance of BDB | |||||
cd $BITCOIN_ROOT | |||||
./autogen.sh | |||||
./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" # (other args...) | |||||
``` | |||||
**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below). | |||||
Boost | Boost | ||||
----- | ----- | ||||
For documentation on building Boost look at their official documentation: http://www.boost.org/build/doc/html/bbv2/installation.html | For documentation on building Boost look at their official documentation: http://www.boost.org/build/doc/html/bbv2/installation.html | ||||
Security | Security | ||||
-------- | -------- | ||||
To help make your bitcoin installation more secure by making certain attacks impossible to | To help make your bitcoin installation more secure by making certain attacks impossible to | ||||
exploit even if a vulnerability is found, binaries are hardened by default. | exploit even if a vulnerability is found, binaries are hardened by default. | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
Disable-wallet mode | Disable-wallet mode | ||||
-------------------- | -------------------- | ||||
When the intention is to run only a P2P node without a wallet, bitcoin may be compiled in | When the intention is to run only a P2P node without a wallet, bitcoin may be compiled in | ||||
disable-wallet mode with: | disable-wallet mode with: | ||||
./configure --disable-wallet | ./configure --disable-wallet | ||||
In this case there is no dependency on Berkeley DB 4.8. | |||||
Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC | Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC | ||||
call not `getwork`. | call not `getwork`. | ||||
Additional Configure Flags | Additional Configure Flags | ||||
-------------------------- | -------------------------- | ||||
A list of additional configure flags can be displayed with: | A list of additional configure flags can be displayed with: | ||||
./configure --help | ./configure --help | ||||
Setup and Build Example: Arch Linux | Setup and Build Example: Arch Linux | ||||
----------------------------------- | ----------------------------------- | ||||
This example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux: | This example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux: | ||||
pacman -S git base-devel boost libevent python | pacman -S git base-devel boost libevent python | ||||
git clone https://github.com/Bitcoin-ABC/bitcoin-abc | git clone https://github.com/Bitcoin-ABC/bitcoin-abc | ||||
cd bitcoin-abc/ | cd bitcoin-abc/ | ||||
./autogen.sh | ./autogen.sh | ||||
./configure --disable-wallet --without-gui --without-miniupnpc | ./configure --disable-wallet --without-gui --without-miniupnpc | ||||
make check | make check | ||||
Note: | |||||
Enabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`, | |||||
or building and depending on a local version of Berkeley DB 4.8. The readily available Arch Linux packages are currently built using | |||||
`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD). | |||||
As mentioned above, when maintaining portability of the wallet between the standard Bitcoin Core distributions and independently built | |||||
node software is desired, Berkeley DB 4.8 must be used. | |||||
ARM Cross-compilation | ARM Cross-compilation | ||||
------------------- | ------------------- | ||||
These steps can be performed on, for example, an Ubuntu VM. The depends system | These steps can be performed on, for example, an Ubuntu VM. The depends system | ||||
will also work on other Linux distributions, however the commands for | will also work on other Linux distributions, however the commands for | ||||
installing the toolchain will be different. | installing the toolchain will be different. | ||||
Make sure you install the build requirements mentioned above. | Make sure you install the build requirements mentioned above. | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |