-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck-route.sh
More file actions
executable file
·24 lines (19 loc) · 931 Bytes
/
Copy pathcheck-route.sh
File metadata and controls
executable file
·24 lines (19 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/zsh
addr_r=$(docker exec cln-remote lightning-cli --network=regtest getinfo | jq '.id' -r)
addr_c1=$(docker exec cln-c1 lightning-cli --network=regtest getinfo | jq '.id' -r)
function remote_balance () {
node=$1
remote=$2
r_balance=$(docker exec $node lncli --network=regtest listchannels | jq -r --arg remote $remote '[.channels | .[] | select(.remote_pubkey | contains($remote)) | .remote_balance | tonumber] | add ')
}
function local_balance () {
node=$1
remote=$2
l_balance=$(docker exec $node lncli --network=regtest listchannels | jq -r --arg remote $remote '[.channels | .[] | select(.remote_pubkey | contains($remote)) | .local_balance | tonumber] | add ')
}
remote_balance lnd $addr_r
local_balance lnd $addr_r
echo "cln-remote || Remote: $r_balance | Local: $l_balance"
remote_balance lnd $addr_c1
local_balance lnd $addr_c1
echo "coreln-c1 || Remote: $r_balance | Local: $l_balance"