cl: Use bitcoin-cli to fund the wallet

Simpler than using curl+json and have to add the wallet argument.
pull/837/head
Christian Decker 3 years ago
parent 28fe6cbcde
commit b951cfa970

@ -2,21 +2,12 @@
set -Eeuo pipefail
# Generate a new receiving address for c-lightning wallet
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq .address)
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq '.bech32' -r)
# Ask Bitcoin Core to send 10 BTC to the address, using JSON-RPC call
curl --user regtest:regtest \
-H 'content-type: text/plain;' \
http://bitcoind:18443/ \
--data-binary @- <<EOF
{
"jsonrpc": "1.0",
"id": "c-lightning-container",
"method": "sendtoaddress",
"params": [
${address},
10,
"funding c-lightning"
]
}
EOF
bitcoin-cli \
--rpcuser=regtest \
--rpcpassword=regtest \
--rpcconnect=bitcoind \
--regtest \
sendtoaddress ${address} 10 "funding c-lightning"

Loading…
Cancel
Save