2020-06-18 19:46:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo Getting node IDs
|
2021-02-07 17:19:40 +00:00
|
|
|
alice_address=$(docker-compose exec -T Alice bash -c "lncli -n regtest getinfo | jq -r .identity_pubkey")
|
|
|
|
bob_address=$(docker-compose exec -T Bob bash -c "lightning-cli getinfo | jq -r .id")
|
2021-02-08 22:28:18 +00:00
|
|
|
chan_address=$(docker-compose exec -T Chan bash -c "eclair-cli -s -j -p eclair getinfo| jq -r .nodeId")
|
|
|
|
dina_address=$(docker-compose exec -T Dina bash -c "lncli -n regtest getinfo | jq -r .identity_pubkey")
|
2020-06-18 19:46:04 +00:00
|
|
|
|
2020-06-27 14:54:28 +00:00
|
|
|
# Let's tell everyone what we found!
|
2021-02-07 17:19:40 +00:00
|
|
|
echo Alice: ${alice_address}
|
|
|
|
echo Bob: ${bob_address}
|
2021-02-08 22:28:18 +00:00
|
|
|
echo Chan: ${chan_address}
|
|
|
|
echo Dina: ${dina_address}
|
2020-06-18 19:46:04 +00:00
|
|
|
|
|
|
|
echo Setting up channels...
|
|
|
|
echo Alice to Bob
|
|
|
|
docker-compose exec -T Alice lncli -n regtest connect ${bob_address}@Bob
|
|
|
|
docker-compose exec -T Alice lncli -n regtest openchannel ${bob_address} 1000000
|
|
|
|
|
2021-02-02 15:56:01 +00:00
|
|
|
echo Bob to Chan
|
2021-02-08 22:28:18 +00:00
|
|
|
docker-compose exec -T Bob lightning-cli connect ${chan_address}@Chan
|
|
|
|
docker-compose exec -T Bob lightning-cli fundchannel ${chan_address} 1000000
|
2020-06-18 19:46:04 +00:00
|
|
|
|
2021-02-02 15:56:01 +00:00
|
|
|
echo Chan to Dina
|
2021-02-08 22:28:18 +00:00
|
|
|
docker-compose exec -T Chan eclair-cli -p eclair connect --uri=${dina_address}@Dina
|
|
|
|
docker-compose exec -T Chan eclair-cli -p eclair open --nodeId=${dina_address} --fundingSatoshis=1000000
|
2020-06-18 19:46:04 +00:00
|
|
|
|
2021-02-08 22:28:18 +00:00
|
|
|
echo Get 10k sats invoice from Dina
|
|
|
|
dina_invoice=$(docker-compose exec -T Dina bash -c "lncli -n regtest addinvoice 10000 | jq -r .payment_request")
|
2020-06-18 19:46:04 +00:00
|
|
|
|
2021-02-08 22:28:18 +00:00
|
|
|
echo Dina invoice ${dina_invoice}
|
2020-06-18 19:46:04 +00:00
|
|
|
|
2020-06-19 14:38:36 +00:00
|
|
|
echo Wait for channel establishment - 60 seconds for 6 blocks
|
2020-06-19 14:19:12 +00:00
|
|
|
sleep 60
|
2020-06-19 14:38:36 +00:00
|
|
|
|
2021-02-02 15:56:01 +00:00
|
|
|
echo Alice pays Dina 10k sats, routed around the network
|
2021-02-08 22:28:18 +00:00
|
|
|
docker-compose exec -T Alice lncli -n regtest payinvoice --json --inflight_updates -f ${dina_invoice}
|