Skip to content

Instantly share code, notes, and snippets.

@runjak
Created April 3, 2015 10:42
Show Gist options
  • Save runjak/ef04bc57e10cb184f919 to your computer and use it in GitHub Desktop.
Save runjak/ef04bc57e10cb184f919 to your computer and use it in GitHub Desktop.
Starting and stopping some bitcoind instances in regtest mode
#!/usr/bin/sh
#https://bitcoin.stackexchange.com/questions/28107/bitcoin-is-not-connected-in-regtest-mode/28109
# Creating config directories:
RDIR="/tmp/bitcoind"
mkdir -p $RDIR/A $RDIR/B $RDIR/C $RDIR/D $RDIR/E
# Starting bitcoind instances:
bitcoind -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=pass -rpcport=16591 -datadir=$RDIR/A/ -connect=localhost:17592 -regtest -pid=$RDIR/A/.pid -daemon -debug
bitcoind -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=pass -rpcport=16592 -datadir=$RDIR/B/ -connect=localhost:17593 -regtest -pid=$RDIR/B/.pid -daemon -debug
bitcoind -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=pass -rpcport=16593 -datadir=$RDIR/C/ -connect=localhost:17594 -regtest -pid=$RDIR/C/.pid -daemon -debug
bitcoind -server -listen -port=17594 -rpcuser=bitcoinrpc -rpcpassword=pass -rpcport=16594 -datadir=$RDIR/D/ -connect=localhost:17595 -regtest -pid=$RDIR/D/.pid -daemon -debug
bitcoind -server -listen -port=17595 -rpcuser=bitcoinrpc -rpcpassword=pass -rpcport=16595 -datadir=$RDIR/E/ -connect=localhost:17591 -regtest -pid=$RDIR/E/.pid -daemon -debug
#!/usr/bin/sh
RDIR="/tmp/bitcoind/"
find $RDIR -type f -name .pid -exec cat {} \; | xargs kill
rm -rf $RDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment