From f4b919200e69e89faad76e6fb64da91c1dbe9555 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Tue, 18 Jun 2024 22:41:13 +0200 Subject: [PATCH] Update ldknode setup --- bin/ldknode-cli | 2 +- docker/ldknode/Dockerfile | 2 +- scripts/init.sh | 8 ++++---- test/test01_payments_eclair.bats | 8 ++++---- test/test02_payments_cln.bats | 8 ++++---- test/test03_payments_ldknode.bats | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/ldknode-cli b/bin/ldknode-cli index 844cb92..7070195 100755 --- a/bin/ldknode-cli +++ b/bin/ldknode-cli @@ -8,7 +8,7 @@ fi # Function to get node pubkey getinfo() { - docker compose logs "$1" | tac | grep "NODE_ID" | awk '{print $4}' | head -n 1 + docker compose logs "$1" | tac | grep "CONNECTION_STRING" | awk '{print $4}' | head -n 1 } # Function to get offer diff --git a/docker/ldknode/Dockerfile b/docker/ldknode/Dockerfile index 667b9ca..4b605ae 100644 --- a/docker/ldknode/Dockerfile +++ b/docker/ldknode/Dockerfile @@ -4,7 +4,7 @@ FROM rust:1.78-bookworm AS builder # References for lndk -ARG LDK_NODE_REF=be54d4dfb95888fb7405ce1e740d5c24f8f054a6 +ARG LDK_NODE_REF=4c3f96713870c7127d81460384eca99420180e9f # Add utils RUN apt-get update \ diff --git a/scripts/init.sh b/scripts/init.sh index f3eb2ef..54454d7 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -146,8 +146,8 @@ getNodeInfo() { echo ECLAIR1_PUBKEY: $ECLAIR1_PUBKEY echo ECLAIR1_NODE_URI: $ECLAIR1_NODE_URI - LDKNODE1_PUBKEY=$(ldknode1 getinfo) - LDKNODE1_NODE_URI="${LDKNODE1_PUBKEY}@172.30.1.32:9735" + LDKNODE1_NODE_URI=$(ldknode1 getinfo) + LDKNODE1_PUBKEY=$(echo $LDKNODE1_NODE_URI | cut -d'@' -f1) echo LDKNODE1_PUBKEY: $LDKNODE1_PUBKEY echo LDKNODE1_NODE_URI: $LDKNODE1_NODE_URI @@ -176,8 +176,8 @@ getNodeInfo() { echo ECLAIR2_PUBKEY: $ECLAIR2_PUBKEY echo ECLAIR2_NODE_URI: $ECLAIR2_NODE_URI - LDKNODE2_PUBKEY=$(ldknode2 getinfo) - LDKNODE2_NODE_URI="${LDKNODE2_PUBKEY}@172.30.2.32:9735" + LDKNODE2_NODE_URI=$(ldknode2 getinfo) + LDKNODE2_PUBKEY=$(echo $LDKNODE2_NODE_URI | cut -d'@' -f1) echo LDKNODE2_PUBKEY: $LDKNODE2_PUBKEY echo LDKNODE2_NODE_URI: $LDKNODE2_NODE_URI diff --git a/test/test01_payments_eclair.bats b/test/test01_payments_eclair.bats index fb18345..b3f2896 100755 --- a/test/test01_payments_eclair.bats +++ b/test/test01_payments_eclair.bats @@ -14,7 +14,7 @@ setup() { run generate_offer_eclair 'eclair1' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -22,7 +22,7 @@ setup() { run generate_offer_eclair 'eclair2' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -30,7 +30,7 @@ setup() { run generate_offer_eclair 'eclair3' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -38,6 +38,6 @@ setup() { run generate_offer_eclair 'eclair3' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } \ No newline at end of file diff --git a/test/test02_payments_cln.bats b/test/test02_payments_cln.bats index 83de67a..aae3983 100755 --- a/test/test02_payments_cln.bats +++ b/test/test02_payments_cln.bats @@ -14,7 +14,7 @@ setup() { run generate_offer_cln 'cln1' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -22,7 +22,7 @@ setup() { run generate_offer_cln 'cln2' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -30,7 +30,7 @@ setup() { run generate_offer_cln 'cln3' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk2 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk2 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } @@ -38,6 +38,6 @@ setup() { run generate_offer_cln 'cln3' assert_line --partial 'lno' - run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 10000 + run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' } \ No newline at end of file diff --git a/test/test03_payments_ldknode.bats b/test/test03_payments_ldknode.bats index 7bf7105..e06da1f 100755 --- a/test/test03_payments_ldknode.bats +++ b/test/test03_payments_ldknode.bats @@ -18,10 +18,10 @@ setup() { assert_line --partial 'Successfully paid for offer!' } -@test "Generate bolt12 offer on ldknode2 and pay from lndk1 (lnd1 -> ldknode2)" { +@test "Generate bolt12 offer on ldknode2 and pay from lndk1 (lnd1 -> lnd2 -> ldknode2)" { run generate_offer_ldknode 'ldknode2' assert_line --partial 'lno' run $PROJECT_ROOT/bin/lndk-cli lndk1 pay-offer $output 5000000 assert_line --partial 'Successfully paid for offer!' -} \ No newline at end of file +}