2020-06-07 16:36:44 +00:00
|
|
|
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) \
|
2020-06-07 16:36:44 +00:00
|
|
|
&& 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 \
|
2020-06-07 16:36:44 +00:00
|
|
|
&& 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
|