Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- touch <.../somewhere/logfile.log>
- LOGFILE=<.../somewhere/logfile.log>
- {#script text} > $LOGFILE
- #!/bin/bash
- #This is a script for creating a test network consisting of 2 bitcoin regtest peers.
- #Step 1: creating data directories
- DATADIR="/home/$USER/bctestnet1"
- rm -rf "$DATADIR"
- mkdir -p "$DATADIR"/{node0,node1,node2,node3}
- #Step 2: creating configuration files
- touch "$DATADIR"/{node0,node1,node2,node3}/bitcoin.conf
- chmod +x "$DATADIR"/{node0,node1,node2,node3}/bitcoin.conf
- #Step 2.1: writing configurations to file
- for i in {0..3}
- do
- echo 'regtest=1
- rpcuser=rt
- rpcpassword=rt
- port='`expr 12000 + $$ % 55536 + $i`'
- rpcport='`expr 13000 + $$ % 55536 + $i + 1`'' > "$DATADIR"/node$/bitcoin.conf
- done
- #Step 3: Starting bitcoinds separately from each directory with corresponding configuration file
- for i in {0..3}
- do
- bitcoind -daemon -datadir="$DATADIR"/node$i/ &
- done
- sleep 60s
- for i in {0..3}
- do
- echo "Mined blocks by node$i:"
- bitcoin-cli -datadir="$DATADIR"/node$i/ setgenerate "true" `expr 101 + $i`
- for i in {0..3}
- do
- echo "Balance of node$i:"
- bitcoin-cli -datadir="$DATADIR"/node$i/ getbalance
- done
- done
- #!/bin/bash
- <command> <arguments> >> $LOGFILE &>
- <command> <arguments> >> $LOGFILE &>
Add Comment
Please, Sign In to add comment