2020-06-15 14:40:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
|
2021-02-21 20:30:02 +00:00
|
|
|
# Generate a new receiving address for c-lightning wallet
|
2021-08-25 19:17:17 +00:00
|
|
|
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq '.bech32' -r)
|
2020-06-15 14:40:23 +00:00
|
|
|
|
|
|
|
# Ask Bitcoin Core to send 10 BTC to the address, using JSON-RPC call
|
2021-09-12 14:12:43 +00:00
|
|
|
until bitcoin-cli \
|
2021-08-25 19:17:17 +00:00
|
|
|
--rpcuser=regtest \
|
|
|
|
--rpcpassword=regtest \
|
2021-09-12 14:12:43 +00:00
|
|
|
--rpcconnect=bitcoind:18443 \
|
2021-08-25 19:17:17 +00:00
|
|
|
--regtest \
|
|
|
|
sendtoaddress ${address} 10 "funding c-lightning"
|
2021-09-12 14:12:43 +00:00
|
|
|
do
|
|
|
|
sleep 1;
|
|
|
|
echo Retrying funding...
|
|
|
|
done
|