Skip to content

Commit

Permalink
Use macaroons for lnd
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Jun 29, 2024
1 parent 4da14cc commit 1297afd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion tests/deploy/lnd-init/lnd-bob/lnd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
listen=0.0.0.0:9835
rpclisten=localhost:11009
restlisten=localhost:8180
no-macaroons=true
no-rest-tls=true
noseedbackup=true

Expand Down
1 change: 0 additions & 1 deletion tests/deploy/lnd-init/lnd-ingrid/lnd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
listen=0.0.0.0:9735
rpclisten=localhost:10009
restlisten=localhost:8080
no-macaroons=true
no-rest-tls=true
noseedbackup=true

Expand Down
8 changes: 4 additions & 4 deletions tests/deploy/lnd-init/setup-lnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ setup-lnd() {
echo "$!" > "$lnd_dir/lnd.pid"
local retries=30
echo "waiting for ready"
while [[ $retries -gt 0 ]] && ! lncli -n regtest --lnddir="$lnd_dir" --no-macaroons --rpcserver "localhost:$lnd_port" getinfo &>/dev/null; do
while [[ $retries -gt 0 ]] && ! lncli -n regtest --lnddir="$lnd_dir" --macaroonpath="$lnd_dir/data/chain/bitcoin/regtest/admin.macaroon" --rpcserver "localhost:$lnd_port" getinfo &>/dev/null; do
sleep 1
retries=$((retries - 1))
done
Expand All @@ -71,8 +71,8 @@ setup-channels() {
echo "=> open channel from ingrid to bob"
local bob_dir="$script_dir/lnd-bob"
local ingrid_dir="$script_dir/lnd-ingrid"
local ingrid_p2tr_address="$(lncli -n regtest --lnddir="$ingrid_dir" --no-macaroons --rpcserver "localhost:$ingrid_port" newaddress p2tr | jq -r .address)"
local bob_node_key="$(lncli -n regtest --lnddir="$bob_dir" --no-macaroons --rpcserver "localhost:$bob_port" getinfo | jq -r .identity_pubkey)"
local ingrid_p2tr_address="$(lncli -n regtest --lnddir="$ingrid_dir" --macaroonpath="$ingrid_dir/data/chain/bitcoin/regtest/admin.macaroon" --rpcserver "localhost:$ingrid_port" newaddress p2tr | jq -r .address)"
local bob_node_key="$(lncli -n regtest --lnddir="$bob_dir" --macaroonpath="$bob_dir/data/chain/bitcoin/regtest/admin.macaroon" --rpcserver "localhost:$bob_port" getinfo | jq -r .identity_pubkey)"
echo "ingrid_p2tr_address=$ingrid_p2tr_address"
echo "bob_node_key=$bob_node_key"

Expand All @@ -84,7 +84,7 @@ setup-channels() {

echo "openchannel"
local retries=5
while [[ $retries -gt 0 ]] && ! lncli -n regtest --lnddir="$ingrid_dir" --no-macaroons --rpcserver "localhost:$ingrid_port" \
while [[ $retries -gt 0 ]] && ! lncli -n regtest --lnddir="$ingrid_dir" --macaroonpath="$ingrid_dir/data/chain/bitcoin/regtest/admin.macaroon" --rpcserver "localhost:$ingrid_port" \
openchannel \
--node_key "$bob_node_key" \
--connect localhost:9835 \
Expand Down

0 comments on commit 1297afd

Please sign in to comment.