Skip to content

Instantly share code, notes, and snippets.

@dendisuhubdy
Last active December 12, 2023 04:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dendisuhubdy/3a615b203a8a5133b6390f2d401e11e5 to your computer and use it in GitHub Desktop.
Save dendisuhubdy/3a615b203a8a5133b6390f2d401e11e5 to your computer and use it in GitHub Desktop.
installing bitcoind on ubuntu 18.04
** Add repository and install bitcoind **
sudo apt-get install build-essential libtool autotools-dev autoconf libssl-dev libboost-all-dev software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get install libevent-dev
sudo apt-get install libdb4.8-dev libdb4.8++-dev # if you are on ubuntu 18.04, skip this part and do the next on 20.04
# if you are ubuntu 20.04 there needs to be a patch for libdb4.8 applied
# https://gist.github.com/danieldk/5700533
# https://askubuntu.com/questions/393289/how-to-install-libdb4-8-dev-or-equivalent-on-13-10
wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install
# if you encounter any problem
sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30/dbinc/atomic.h
sudo apt-get update
git clone git@github.com:bitcoin/bitcoin.git
cd bitcoin
./autogen.sh &&
./configure LDFLAGS="-static-libstdc++" --without-miniupnpc --enable-hardening --with-zmq --disable-man --disable-shared --disable-bench --disable-tests --without-gui --enable-cxx
mkdir ~/.bitcoin/ && cd ~/.bitcoin/
nano bitcoin.conf
** Add config to bitcoin.conf file **
[test]
rpcuser=bitwyre
rpcpassword=bitwyre
testnet=1
rpcport=18332
rpcallowip=0.0.0.0
rpcallowip=0.0.0.0/0
server=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubrawtxlock=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
** Start bitcoind **
bitcoind --daemon
** If bitcoind is already started **
ps -e | grep bitcoin // returns pid
kill -9 <pid>
bitcoind &
** Test bitcoind is running and working **
bitcoin-cli getinfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment