Building Bitcoin Core from Source
TL;DR
Building Bitcoin Core from source is essential for independent verification and development. The process involves using
autogen.sh,configure, andmakeafter installing necessary dependencies.
Building Bitcoin Core directly from the source code rather than downloading a pre-compiled binary is a fundamental skill for developers and serious node operators.
General Steps
The standard process follows these steps (example for Unix-like systems):
- Install Dependencies: You must install compilers (
gccorclang),make,autoconf,libtool, and libraries likeboost,libevent,sqlite3(for the wallet), etc. - Clone the Repository: Get the code using
git clone https://github.com/bitcoin/bitcoin.git. - Autogen: Run
./autogen.shto generate the configure script. - Configure: Run
./configure. You can pass flags to customize the build. Common flags:--without-gui: Builds onlybitcoindand command-line tools, stripping out Qt/GUI dependencies, speeding up compilation.--disable-wallet: Compiles without wallet support if you only need a routing node or are developing non-wallet features.
- Compile: Run
make(ormake -j Nwhere N is the number of CPU cores to parallelize the build).
Building from source allows you to verify what you run and the ability to test new changes manually.