lnbook/code/docker/bitcoind/mine.sh
Andreas M. Antonopoulos f94fe3fd93 Docker example fixes, upgrades and ch4 text edits
The docker containers have been improved and updated. The payment demo script can be rerun and is resilient to errors and delays. The docker mini-tutotial and installation instructions have been moved to a new appendix
2021-09-12 16:12:43 +02:00

20 lines
637 B
Bash
Executable File

#!/bin/bash
set -Eeuo pipefail
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
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; \
done
# If loop is interrupted, stop bitcoind
bitcoin-cli -datadir=/bitcoind stop