Skip to content

Instantly share code, notes, and snippets.

@pointbiz
pointbiz / bitcoin_full_node.txt
Last active Jul 18, 2017
bitcoin full node setup script
View bitcoin_full_node.txt
#!/bin/bash
#setup script
yum update
yum install nano
homedir=~/
fbtcinfo=btcinfo.sh
echo -e "./bitcoin-cli -datadir=$homedir.bitcoin getinfo
echo -n \"device ip: \"
View getonionaddr.sh
#get onion address
cat /var/lib/tor/bitcoin-service/hostname > $HOME/onionaddr
onion=$(<$HOME/onionaddr)
echo $onion
View torproject.repo
[tor]
name=Tor repo
enabled=1
baseurl=https://deb.torproject.org/torproject.org/rpm/el/6/$basearch/
gpgcheck=1
gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
repo_gpgcheck=1
View blockstatus.sh
#!/bin/bash
#get current block height from blockchain.infoecho $(date)
wget -4 https://blockchain.info/q/getblockcount &> /dev/null
netblk=$(<getblockcount)
echo "Current Block: $netblk"
#get current block from local bitcoin-cli
./bitcoin-cli getblockcount > locblock
nodeblk=$(<locblock)
echo "Local Block: $nodeblk"
#if bitcoin-cli responds, compare local with network blocks
View btcstop.sh
#!/bin/bash
/root/./bitcoin-cli -datadir=/root/.bitcoin stop
echo Do not shut down the device until notified
x=$(pgrep -f bitcoind)
while [ "$x" != "" ]
do
echo -n "."
sleep 1s
x=$(pgrep -f bitcoind)
done
View btcinfo.sh
./bitcoin-cli -datadir=/root/.bitcoin getinfo
echo -n "device ip: "
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
date