Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dcnl1980/bf6bd145d4cb4bcd3330b54ad6a79698 to your computer and use it in GitHub Desktop.
Save dcnl1980/bf6bd145d4cb4bcd3330b54ad6a79698 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 [email protected]: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