scripts: include list of node pubkeys in credentials export

This is information that we can only get with warcli, so we copy it
across while we're working externally with our credentials copying.
This commit is contained in:
Carla Kirk-Cohen 2024-04-10 17:10:58 -04:00
parent 6fbf1f2683
commit 2f49b06152
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91
1 changed files with 11 additions and 1 deletions

View File

@ -9,4 +9,14 @@ kubectl cp warnet-armada/lnd0:root/.lnd/data/chain/bitcoin/regtest/admin.macaroo
kubectl cp warnet-armada/lnd1:root/.lnd/data/chain/bitcoin/regtest/admin.macaroon $tmp_dir/lnd1-admin.macaroon
kubectl cp warnet-armada/lnd2:root/.lnd/data/chain/bitcoin/regtest/admin.macaroon $tmp_dir/lnd2-admin.macaroon
kubectl cp $tmp_dir warnet-armada/flagship:/credentials
# In addition to our credentials, we'll create a list of pubkeys/ips to connect to.
json_data=$(warcli lncli 0 describegraph)
pub_keys=$(echo "$json_data" | jq -r '.nodes[] | select(.addresses != null and .addresses != []) | .pub_key')
addrs=$(echo "$json_data" | jq -r '.nodes[] | select(.addresses != null and .addresses != []) | .addresses[].addr')
# Loop through each entry and print pub_key and addr
for i in $(seq 1 $(($(echo "$pub_keys" | wc -l)-1))); do
echo "$(echo "$pub_keys" | sed -n ${i}p)@$(echo "$addrs" | sed -n ${i}p)" >> "$tmp_dir"/nodes.txt
done
kubectl cp $tmp_dir warnet-armada/flagship:/credentials