Skip to content

Commit

Permalink
Update docs for Berkeley DB 5.3 or greater
Browse files Browse the repository at this point in the history
Summary:
D1330 changed the requirements for Berkeley DB.
This updates the docs to reflect the new requirement.

Test Plan:
Follow the new instructions, check that it builds.
I tested on Ubuntu.
If possible, others could check: Debian, OSX, FreeBSD, and Open BSD.

Reviewers: deadalnix, schancel, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1409
  • Loading branch information
Mengerian committed May 11, 2018
1 parent 99bc4b8 commit b5c196d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 69 deletions.
15 changes: 7 additions & 8 deletions doc/build-openbsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,22 @@ config_opts="runtime-link=shared threadapi=pthread threading=multi link=static v

BerkeleyDB is only necessary for the wallet functionality. To skip this, pass `--disable-wallet` to `./configure`.

See "Berkeley DB" in [build_unix.md](build_unix.md) for instructions on how to build BerkeleyDB 4.8.
You cannot use the BerkeleyDB library from ports, for the same reason as boost above (g++/libstd++ incompatibility).

```bash
# Pick some path to install BDB to, here we create a directory within the bitcoin directory
BITCOIN_ROOT=$(pwd)
BDB_PREFIX="${BITCOIN_ROOT}/db4"
BDB_PREFIX="${BITCOIN_ROOT}/db6"
mkdir -p $BDB_PREFIX

# Fetch the source and verify that it is not tampered with
curl -o db-4.8.30.NC.tar.gz 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256 -c
# MUST output: (SHA256) db-4.8.30.NC.tar.gz: OK
tar -xzf db-4.8.30.NC.tar.gz
curl -o db-6.2.32.NC.tar.gz 'http://download.oracle.com/berkeley-db/db-6.2.32.NC.tar.gz'
echo 'd86cf1283c519d42dd112b4501ecb2db11ae765b37a1bdad8f8cb06b0ffc69b8 db-6.2.32.NC.tar.gz' | sha256sum -c
# MUST output: (SHA256) db-6.2.32.NC.tar.gz: OK
tar -xzf db-6.2.32.NC.tar.gz

# Build the library and install to specified prefix
cd db-4.8.30.NC/build_unix/
cd db-6.2.32.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
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX CC=egcc CXX=eg++ CPP=ecpp
make install # do NOT use -jX, this is broken
Expand Down Expand Up @@ -124,7 +123,7 @@ To configure with wallet:
```bash
./configure --with-gui=no --with-boost=$BOOST_PREFIX \
CC=egcc CXX=eg++ CPP=ecpp \
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-6.2" BDB_CFLAGS="-I${BDB_PREFIX}/include"
```

To configure without wallet:
Expand Down
2 changes: 1 addition & 1 deletion doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dependencies

Install dependencies:

brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config protobuf --c++11 qt5 libevent
brew install automake berkeley-db libtool boost --c++11 miniupnpc openssl pkg-config protobuf --c++11 qt5 libevent

In case you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG

Expand Down
65 changes: 5 additions & 60 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Optional dependencies:
Library | Purpose | Description
------------|------------------|----------------------
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)
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)
Expand Down Expand Up @@ -79,22 +79,10 @@ install necessary parts of boost:

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).
You can add the repository and install using the following commands:

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.
sudo apt-get install libdb-dev
sudo apt-get install libdb++-dev

See the section "Disable-wallet mode" to build Bitcoin ABC without wallet.

Expand Down Expand Up @@ -133,7 +121,7 @@ Dependency Build Instructions: Fedora
-------------------------------------
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:

Expand Down Expand Up @@ -164,40 +152,6 @@ turned off by default. See the configure options for upnp behavior desired:
--disable-upnp-default (the default) UPnP support turned off 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
-----
For documentation on building Boost look at their official documentation: http://www.boost.org/build/doc/html/bbv2/installation.html
Expand Down Expand Up @@ -258,8 +212,6 @@ disable-wallet mode with:

./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
call not `getwork`.

Expand All @@ -281,13 +233,6 @@ This example lists the steps necessary to setup and build a command line only, n
./configure --disable-wallet --without-gui --without-miniupnpc
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
-------------------
Expand Down
1 change: 1 addition & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ This release includes the following features and fixes:
- Remove deprecated `estimatesmartpriority` RPC.
- Remove support for `-sendfreetransactions`.
- Remove unstable `estimatesmartfee` RPC.
- Update berkley DB to 5.3 minimum. Developers should update their build environment accordingly.

0 comments on commit b5c196d

Please sign in to comment.