Beschaffung und Kompilation von BitcoinCore 21.1 auf einem Debian 10(Buster) System. / Download and Compilation BitcoinCore 21.1 on Debian 10(Buster) (DE/EN)

in #deutsch3 years ago

(English Below / Englisch unten)

Beschaffung und Kompilation von BitcoinCore 21.1 auf einem Debian 10(Buster) System.

Die Erzeugung der Binarys (bitcoin-qt und bitcoind und div. andere) erfolgt in 4 Schritten.

Zuerst wird der komplette Quellcode von github.com heruntergeladen

Als zweites muss die BerkeleyDB 4.8.30.NC von Oracle.com heruntergeladen und kompiliert werden. Diese Version der db ist so alt das sie in den meisten aktuellen Distributionen nicht mehr mitgeliefert wird. Die neueren Versionen sind aber nicht richtig Abwärtskompatibel so das es mit diesen zu Problemen beim handling der Wallets kommen kann.
Die bitcoincore Entwickler liefern zu diesem Zweck ein script Namens install_db4.sh mit, welches zuerst einige Patches auf dem Quellcode durchfuehrt. Danach startet es den Kompiliervorgang.
Wenn man die Kompilation manuel durchfuehren will und der Quellcode der db nicht gepatcht wurde dann bricht der Compiler mit ner Fehlermeldung die auf atomic.h zeigt ab.

Das Basisverzeichniss fuer alle unten angegebenen Ausfuehrungen ist
/home/btc

1.

Erstmal muessen mit dem auf dem System die folgenden Pakete installiert werden:

apt-get install automake autotools-dev bsdmainutils build-essential libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libevent-dev libminiupnpc-dev libprotobuf-dev libqrencode-dev libqt5core5a libqt5dbus5 libqt5gui5 libssl-dev libtool libzmq3-dev pkg-config protobuf-compiler qttools5-dev qttools5-dev-tools git

2.

Download des BitcoinCore Sourcecodes

cd /home/btc/
git clone https://github.com/bitcoin/bitcoin.git

Danach liegt der Quellcode in /home/btc/bitcoin

3.

Download und Kompilation von BerkeleyDB
Download des berkeleydb Source Paket
Entpacken

cd /home/btc/
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz

Start des Kompilationscripts

cd /home/btc/db-4.8.30.NC
/home/btc/bitcoin/contrib/install_db4.sh /home/btc/db-4.8.30.NC

Die erzeugten Binarys liegen danach in /home/btc/db-4.8.30.NC/db4

4.

Die Erzeugung der Bitcoin Core Binarys also bitcoin-qt und bitcoind usw.

Ins Source Verzeichniss wechseln

cd /home/btc/bitcoin

Dieser 2 Zeiler bewirkt das die aktuelle Version von bitcoincore gebaut wird.

CURRENT=`git tag | grep -P '^v[\d\.]+$$' | sort --version-sort | tail -1`
git checkout tags/$CURRENT -b local-$CURRENT

Vorbereitung fuer den build Prozess
Erzeugen des Makefiles mit den Pfadangeben fuer die BerkeleyDB und
die Installation der Binarys

/home/btc/bitcoin/autogen.sh
/home/btc/bitcoin/configure LDFLAGS="-L/home/btc/db-4.8.30.NC/db4/lib/ -ldb_cxx-4.8" CPPFLAGS="-I/home/btc/db-4.8.30.NC/db4/include/" --prefix="/home/btc/bin/"

Kompilation und Installation Starten.

make install

Die Binarys wie z.b bitcoin-qt liegen dann in
/home/btc/bin/bin/


English Version

Download and Compilation of BitcoinCore on a Debian 10 (Buster) installation

The generation of the binarys (bitcoin-qt and bitcoind and various others)
takes place in 4 steps.
First the complete source code must be downloaded from github.com

Second, the BerkeleyDB 4.8.30.NC must be downloaded from Oracle.com and compiled. This version of the db is so old that it is in most current Distributions no longer included. The newer versions but are not really backwards compatible so that there could be problems when handling the wallets.
The bitcoincore developers provide a script name for this purpose named install_db4.sh. This Script first apply some patches to the source code, then it starts the compilation process.
If you want to do the compilation manually and the source code of the db was not patched, the compiler stops with an error message which points to atomic.h.

The base directory for working is
/home/btc

1.

First of all, the following packages must be installed on the system:

apt-get install automake autotools-dev bsdmainutils build-essential libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libevent-dev libminiupnpc-dev libprotobuf-dev libqrencode-dev libqt5core5a libqt5dbus5 libqt5gui5 libssl-dev libtool libzmq3-dev pkg-config protobuf-compiler qttools5-dev qttools5-dev-tools git

2.

Download the BitcoinCore Sourcecode

cd /home/btc/
git clone https://github.com/bitcoin/bitcoin.git

after that the Source Code is in /home/btc/bitcoin

3.

Download and Compile BerkeleyDB
Download berkeleydb Source Paket
unzip

cd /home/btc/
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz

Start the Script

cd /home/btc/db-4.8.30.NC
/home/btc/bitcoin/contrib/install_db4.sh /home/btc/db-4.8.30.NC

The generated binarys are then in /home/btc/db-4.8.30.NC/db4

4. The creation of the Bitcoin Core Binarys bitcoin-qt and bitcoind.

Switch to Source Directory

cd /home/btc/bitcoin

This 2 lines causes the current version of bitcoincore to be built.

CURRENT=`git tag | grep -P '^v[\d\.]+$$' | sort --version-sort | tail -1`
git checkout tags/$CURRENT -b local-$CURRENT

Preparation for the build process
Creation of the Makefile with the path information for the BerkeleyDB
and install the Binarys

/home/btc/bitcoin/autogen.sh
/home/btc/bitcoin/configure LDFLAGS="-L/home/btc/db-4.8.30.NC/db4/lib/ -ldb_cxx-4.8" CPPFLAGS="-I/home/btc/db-4.8.30.NC/db4/include/" --prefix="/home/btc/bin/"

Start Compilation and Installation

make install

The BitcoinCore binarys like bitcoin-qt then resides in
/home/btc/bin/bin

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.028
BTC 59705.02
ETH 2619.44
USDT 1.00
SBD 2.39