2020-06-11 02:46:55 +00:00
|
|
|
#!/bin/bash
|
2020-06-15 14:40:11 +00:00
|
|
|
set -Eeuo pipefail
|
2020-06-11 02:46:55 +00:00
|
|
|
|
|
|
|
export address=`cat /bitcoind/keys/demo_address.txt`
|
|
|
|
echo "================================================"
|
|
|
|
echo "Balance:" `bitcoin-cli -datadir=/bitcoind getbalance`
|
|
|
|
echo "================================================"
|
|
|
|
echo "Mining 101 blocks to unlock some bitcoin"
|
|
|
|
bitcoin-cli -datadir=/bitcoind generatetoaddress 101 $address
|
2021-09-12 14:12:43 +00:00
|
|
|
echo "Mining 6 blocks every 10 seconds"
|
|
|
|
while echo "Balance:" `bitcoin-cli -datadir=/bitcoind getbalance`;
|
|
|
|
do
|
|
|
|
bitcoin-cli -datadir=/bitcoind generatetoaddress 6 $address; \
|
|
|
|
sleep 10; \
|
|
|
|
|
2020-06-11 02:46:55 +00:00
|
|
|
done
|
2020-06-15 14:40:11 +00:00
|
|
|
|
|
|
|
# If loop is interrupted, stop bitcoind
|
|
|
|
bitcoin-cli -datadir=/bitcoind stop
|