Skip to content

Instantly share code, notes, and snippets.

@bensig
Last active June 20, 2021 22:25
Show Gist options
  • Save bensig/62a8beded42be9b7199bc078b1d11418 to your computer and use it in GitHub Desktop.
Save bensig/62a8beded42be9b7199bc078b1d11418 to your computer and use it in GitHub Desktop.
Compile and install bitcoind like a boss
# installing bitcoind like a boss on Ubuntu 20.04.2 LTS \n \l
# Update & Upgrade the System
sudo apt-get update
sudo apt-get upgrade
# Install dependencies there might be more based on your system
# However below instructions are for the fresh Ubuntu install/server
# Please carefully watch the logs because if something could not be install
# You have to make sure it is installed properly by trying the command or that particular
# dependency again
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqrencode-dev autoconf openssl libssl-dev libevent-dev
sudo apt-get install libminiupnpc-dev
# Download Bitcoin Source code
# ----------------------------
cd ~
git clone https://github.com/bitcoin/bitcoin.git
# install berkeley db 4.8
cd ~/bitcoin/
./contrib/install_db4.sh `pwd`
export BDB_PREFIX='~/bitcoin/db4'
# Compile Bitcoin with Berkley DB 4.8
# -----------------------------------
./autogen.sh
# below command ./configure may return with error for dependencies
# you need to make sure that it returns with no error
# If it does please install the dependencies and rerun the /autogen.sh command again and then below command again
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" LDFLAGS="-L/home/theusername/bitcoin/db4/lib/" BDB_LIBS="-L`pwd`/db4/lib -ldb_cxx-4.8"
# below command may take 5-10 minutes based on your system
make -s -j5
echo “If all went well you will be able to access the binary at below location \
cd ~/bitcoin/ \
./src/bitcoind \
./src/bitcoin-cli”
echo "if that works then you can run:"
echo "user=`whoami` && sudo ln -s /home/$user/bitcoin/src/bitcoind /usr/local/bin && sudo ln -s /home/$user/bitcoin/src/bitcoin-cli /usr/local/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment