2
0
mirror of https://github.com/lnbook/lnbook synced 2024-11-06 21:20:29 +00:00
lnbook/code/docker/bitcoind-regtest/Dockerfile

25 lines
813 B
Docker
Raw Normal View History

FROM lnbook/bitcoind_base:latest
2020-03-05 18:15:41 +00:00
ADD bitcoind /bitcoind
WORKDIR /bitcoind
EXPOSE 12001
2020-04-19 20:13:18 +00:00
CMD bitcoind -datadir=/bitcoind -daemon \
&& sleep 2 \
&& address=$(bitcoin-cli -datadir=/bitcoind getnewaddress) \
&& privkey=$(bitcoin-cli -datadir=/bitcoind dumpprivkey $address)\
&& echo "================================================"\
&& echo "Mining to bitcoin address: " ${address} \
&& echo "Private key: " ${privkey} \
&& echo "Configuration:" \
&& cat /bitcoind/bitcoin.conf \
&& echo "================================================"\
&& echo "Mining 101 blocks to unlock some bitcoin" \
2020-04-19 20:13:18 +00:00
&& bitcoin-cli -datadir=/bitcoind generatetoaddress 101 $address \
&& echo "Mining 1 block every 10 seconds"\
2020-04-19 20:13:18 +00:00
&& while sleep 10 \
; do bitcoin-cli -datadir=/bitcoind generatetoaddress 1 $address \
; done