Skip to content

Instantly share code, notes, and snippets.

@ottosch
Last active October 14, 2025 01:59
Show Gist options
  • Save ottosch/1be48b62e6753f1e542c67c5b277a9c7 to your computer and use it in GitHub Desktop.
Save ottosch/1be48b62e6753f1e542c67c5b277a9c7 to your computer and use it in GitHub Desktop.
How to Compile Libbitcoin Node

How to compile libbitcoin

Start debian 12 docker container

docker run -it --name libbitcoin debian:bookworm

Install necessary packages

apt update && apt install -y dh-autoreconf build-essential git pkg-config wget

Clone libbitcoin

git clone https://github.com/libbitcoin/libbitcoin-node.git /root/
cd /root/libbitcoin-node/

Find which flags your CPU supports

grep -Eo "avx2|avx5|sha|sse" /proc/cpuinfo | sort -u

Depending on the output, you'll add build flags as follows:

Output Build flag
avx2 --enable-avx2
avx5 --enable-avx512
sse --enable-sse41
sha --enable-shani

Note: after build is done, you can run ./bn -d for a more robust flag detection.

Build

./install.sh --prefix=$HOME/libbitcoin/ --verbose --build-boost --build-secp256k1 --disable-shared [CPU build flags]

Exit the container and copy the binary

exit (or Ctrl + D)
docker cp libbitcoin:/root/libbitcoin/bin/bn .

The binary will be copied to the current directory. Run ./bn to start syncing or ./bn -h for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment