Bitcoin Node

sudo ufw allow 8332
mkdir /nodes
mkdir /nodes/BTC
sudo apt update
sudo apt install supervisor

/nodes/BTC/bitcoin.conf

[main]
rpcallowip=0.0.0.0/0 # !ALLOWED IP!
rpcbind=127.0.0.1
rpcport=8332
rpcuser=YOUR_USER_NAME
rpcpassword=YOUR_PASSWORD
server=1
#txindex=1
prune=2048 #2GB
datadir=/nodes/BTC
keypool=2000

/etc/supervisor/conf.d/bitcoind.conf

[program:bitcoind]
command=nice /usr/local/bin/bitcoind -conf=/nodes/BTC/bitcoin.conf
autostart=true
autorestart=true
stderr_logfile=/var/log/supervisor/bitcoind.error.log
stdout_logfile=/var/log/supervisor/bitcoind.output.log
stderr_logfile_backups=2
stdout_logfile_backups=2
environment=HOME="/root"

CMD:

sudo supervisorctl start bitcoind
sudo supervisorctl stop bitcoind

curl -#o /tmp/bitcoin.tar.gz https://bitcoin.org/bin/bitcoin-core-25.0/bitcoin-25.0-x86_64-linux-gnu.tar.gz
tar -xf /tmp/bitcoin.tar.gz -C /tmp/
cp /tmp/bitcoin-25.0/bin/bitcoind /usr/local/bin/bitcoind
rm -r /tmp/bitcoin-25.0
rm /tmp/bitcoin.tar.gz

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start bitcoind

Last updated