- Blockchain By Example
- Bellaj Badr Richard Horrocks Xun (Brian) Wu
- 301字
- 2021-06-10 18:53:40
Installing dependencies
Before we advance any further, I would like to note that we will be using the Bitcoin core project, as it's the most complete implementation of the Bitcoin protocol. The project is based on many external libraries, including:
- libssl: The portion of OpenSSL that supports TLS (https://www.openssl.org)
- Boost C++: Aset of libraries that provides support for tasks and structures such as multi threading, filesystem operations, and pseudo random number generation, (go tohttps://www.boost.org)
- libevent: An event notification library (go tohttp://libevent.org)
- Miniupnpc: UPnP IGD client (firewall-jumping support) (https://github.com/miniupnp/miniupnp)
- libdb4.8: The library for the Berkeley database, which is used for wallet storage (wallet.dat file) (https://github.com/berkeleydb/libdb)
- Qt: Qt SDK (only needed when GUI-enabled) (www.qt.io)
- Protobuf: A data interchange format used for payment protocol (only needed when GUI-enabled) (https://github.com/protocolbuffers/protobuf)
To install these dependencies, make sure you upgrade and update any outdated packages:
sudo apt-get update
sudo apt-get upgrade
Instead of installing all dependencies in one go, let's install by grouping the packages:
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 git
You need to watch the output logs carefully to detect if something goes wrong. The next step will be to install only the necessary part of the boost C++ library:
sudo apt-get install
libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
If that doesn't work for any reason, you can install all the boost development packages using the following:
sudo apt-get install libboost-all-dev
Afterward, you'll need to install the Berkeley database, which is what the Bitcoin software uses for wallet storage, and to store the necessary functions that make the wallet work correctly (BerkeleyDB for wallet files, and LevelDB for blockchain indexes).
To install Berkeley 4.8 libs on Ubuntu 16.04, run 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