Skip to content

Instantly share code, notes, and snippets.

@sheharyarn
Last active March 2, 2018 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheharyarn/05ea8431a73065de6ccd161e43461d66 to your computer and use it in GitHub Desktop.
Save sheharyarn/05ea8431a73065de6ccd161e43461d66 to your computer and use it in GitHub Desktop.
Quickly work with BTC Testnet
testnet=1
server=1
# enable SSL for RPC server
#rpcssl=1
rpcallowip=0.0.0.0/0
rpcuser=admin
rpcpassword=123
function btc {
local server="bitcoind -testnet"
local client="bitcoin-cli -testnet"
local dir="$HOME/.bitcoin/testnet3"
if [ $# -eq 0 ] ; then
$client --help
else
case $1 in
start) $server -server -daemon ;;
stop) $client stop ;;
tail) tail -f $dir/debug.log ;;
info) $client getinfo ;;
blockchain) $client getblockchaininfo ;;
network) $client getnetworkinfo ;;
*) $client $@ ;;
esac
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment