Jul 29, 2019 Brief: This beginner’s guide shows you what you can do with apt-get commands in Linux, how to use them to find new packages, install and upgrade new packages, and clean your system. If you have started using Ubuntu or any Ubuntu-based Linux distribution, such as Linux Mint, elementary OS, etc., you must have come across the apt-get command by now. May 06, 2018 sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev. Sudo apt-get install software-properties-common. Sudo add-apt-repository ppa:bitcoin/bitcoin.
Some notes on how to build Bitcoin Core in Unix.
(For BSD specific instructions, see
build-*bsd.md
in this directory.)Note
Always use absolute paths to configure and compile Bitcoin Core and the dependencies.For example, when specifying the path of the dependency:
Here BDB_PREFIX must be an absolute path - it is defined using $(pwd) which ensuresthe usage of the absolute path.
To Build
This will build bitcoin-qt as well, if the dependencies are met.
Dependencies
These dependencies are required:
Library | Purpose | Description |
---|---|---|
libboost | Utility | Library for threading, data structures, etc |
libevent | Networking | OS independent asynchronous networking |
Optional dependencies:
Library | Purpose | Description |
---|---|---|
miniupnpc | UPnP Support | Firewall-jumping support |
libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled) |
qt | GUI | GUI toolkit (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) |
libzmq3 | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.0.0) |
For the versions used, see dependencies.md
Memory Requirements
C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB ofmemory available when compiling Bitcoin Core. On systems with less, gcc can betuned to conserve memory with additional CXXFLAGS:
Alternatively, or in addition, debugging information can be skipped for compilation. The default compile flags are
-g -O2
, and can be changed with:Finally, clang (often less resource hungry) can be used instead of gcc, which is used by default:
Linux Distribution Specific Instructions
Ubuntu & Debian
Dependency Build Instructions
Build requirements:
Now, you can either build from self-compiled depends or install the required dependencies:
BerkeleyDB is required for the wallet.
Ubuntu and Debian have their own
libdb-dev
and libdb++-dev
packages, but these will installBerkeleyDB 5.1 or later. This will break binary wallet compatibility with the distributed executables, whichare based on BerkeleyDB 4.8. If you do not care about wallet compatibility,pass --with-incompatible-bdb
to configure.Otherwise, you can build from self-compiled
depends
(see above).To build Bitcoin Core without wallet, see Disable-wallet mode
Optional (see
--with-miniupnpc
and --enable-upnp-default
):ZMQ dependencies (provides ZMQ API):
GUI dependencies:
If you want to build bitcoin-qt, make sure that the required packages for Qt developmentare installed. Qt 5 is necessary to build the GUI.To build without GUI pass
--without-gui
.To build with Qt 5 you need the following:
libqrencode (optional) can be installed with:
Once these are installed, they will be found by configure and a bitcoin-qt executable will bebuilt by default.
Fedora
Dependency Build Instructions
Build requirements:
Optional (see
--with-miniupnpc
and --enable-upnp-default
):ZMQ dependencies (provides ZMQ API):
To build with Qt 5 you need the following:
libqrencode (optional) can be installed with:
Notes
The release is built with GCC and then 'strip bitcoind' to strip the debugsymbols, which reduces the executable size by about 90%.
miniupnpc
miniupnpc may be used for UPnP port mapping. It can be downloaded from here. UPnP support is compiled in andturned off by default. See the configure options for upnp behavior desired:
Berkeley DB
It is recommended to use Berkeley DB 4.8. If you have to build it yourself,you can use the installation script included in contrib/like so:
from the root of the repository.
Note: You only need Berkeley DB if the wallet is enabled (see Disable-wallet mode).
Boost
If you need to build Boost yourself:
Security
To help make your Bitcoin Core installation more secure by making certain attacks impossible toexploit even if a vulnerability is found, binaries are hardened by default.This can be disabled with:
Hardening Flags:
Hardening enables the following features:
- Position Independent Executable: Build position independent code to take advantage of Address Space Layout Randomizationoffered by some kernels. Attackers who can cause execution of code at an arbitrary memorylocation are thwarted if they don't know where anything useful is located.The stack and heap are randomly located by default, but this allows the code section to berandomly located as well.On an AMD64 processor where a library was not compiled with -fPIC, this will cause an errorsuch as: 'relocation R_X86_64_32 against `......' can not be used when making a shared object;'To test that you have built PIE executable, install scanelf, part of paxutils, and use:The output should contain:TYPEET_DYN
- Non-executable Stack: If the stack is executable then trivial stack-based buffer overflow exploits are possible ifvulnerable buffers are found. By default, Bitcoin Core should be built with a non-executable stack,but if one of the libraries it uses asks for an executable stack or someone makes a mistakeand uses a compiler extension which requires an executable stack, it will silently build anexecutable without the non-executable stack protection.To verify that the stack is non-executable after compiling use:
scanelf -e ./bitcoin
The output should contain:STK/REL/PTLRW- R-- RW-The STK RW- means that the stack is readable and writeable but not executable.
Disable-wallet mode
When the intention is to run only a P2P node without a wallet, Bitcoin Core may be compiled indisable-wallet mode with:
In this case there is no dependency on Berkeley DB 4.8.
Mining is also possible in disable-wallet mode using the
getblocktemplate
RPC call.Additional Configure Flags
A list of additional configure flags can be displayed with:
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:
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.As mentioned above, when maintaining portability of the wallet between the standard Bitcoin Core distributions and independently builtnode software is desired, Berkeley DB 4.8 must be used.ARM Cross-compilation
These steps can be performed on, for example, an Ubuntu VM. The depends systemwill also work on other Linux distributions, however the commands forinstalling the toolchain will be different.
Make sure you install the build requirements mentioned above.Then, install the toolchain and curl:
To build executables for ARM:
For further documentation on the depends system see README.md in the depends directory.
Document your code
Every project on GitHub comes with a version-controlled wiki to give your documentation the high level of care it deserves. It’s easy to create well-maintained, Markdown or rich text documentation alongside your code.
Sign up for free See pricing for teams and enterprises CaptAgent: Installation
This section provides guidance to download the latest code from our repository and compile it on your system.
Requirements
- Captagent 6.2+ requires
libuv
If your system does not providelibuv
andlibuv-dev
, please install from ourrepository or compile it from source
Operating Systems
Debian 9 (stretch):
Debian 8 (jessie):
Debian 7 (wheezy):
CentOS 7:
CentOS 6:
Clone & Compile
Build Options
Name | Configure Flag | Libraries |
---|---|---|
HEP Compression | --enable-compression | |
IPv6 Support | --enable-ipv6 | |
PCRE Support | --enable-pcre | libpcre |
SSL Support | --enable-ssl | openssl |
TLS Support | --enable-tls | libgcrypt20 openssl |
MySQL Support | --enable-mysql | libmysqlclient |
Redis Support | --enable-redis | libhiredis |
TLS Support (experimental)
To compile and enable TLS decryption features, please check the dedicated Wiki page.
Congratulations! You just installed your first basic instance of CaptAgent 6!