From e4159120f98faf470a6c671b1c3ca9233b5307dc Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Thu, 15 Feb 2024 09:00:42 +0530 Subject: [PATCH 1/3] bitcoind: healthcheck fix regtest - if wallet file is present we can't create new wallet, we load it - set -ex wasn't enabled which didn't fail the healthcheck Signed-off-by: Lakshya Singh --- bitcoind/healthcheck.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bitcoind/healthcheck.sh b/bitcoind/healthcheck.sh index 9131b63..dc71e54 100755 --- a/bitcoind/healthcheck.sh +++ b/bitcoind/healthcheck.sh @@ -1,11 +1,19 @@ #!/bin/sh +set -ex + if [[ "$BITCOIN_CHAIN" = "regtest" ]]; then - # Check if the wallet already exists + # Check if default wallet isn't loaded if ! bitcoin-cli listwallets | grep -q "default"; then - # If the wallet does not exist, create it - bitcoin-cli createwallet default + # Check if default wallet is present and needs to be loaded + if bitcoin-cli listwalletdir | grep -q "default"; then + bitcoin-cli loadwallet default + else + # create default wallet since no file was found + bitcoin-cli createwallet default + fi fi + block_count=$(bitcoin-cli -chain=$BITCOIN_CHAIN getblockcount) if [[ "$block_count" = "0" ]]; then bitcoin-cli generatetoaddress 101 $(bitcoin-cli -chain=$BITCOIN_CHAIN getnewaddress) From df33aad57612855abcdf257bbe1fcf319582caf8 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Wed, 21 Feb 2024 20:22:48 +0530 Subject: [PATCH 2/3] fix: cargo install use cargo.lock - --locked makes use of cargo.lock Signed-off-by: Lakshya Singh --- lightningd/Dockerfile | 2 +- vlsd/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index eee12b1..351491c 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -91,7 +91,7 @@ RUN git clone $VLS_REPO vls RUN cd vls && \ echo building $VLS_GIT_HASH \ git checkout $VLS_GIT_HASH && \ - cargo install --path ./vls-proxy --bin remote_hsmd_socket --profile release --root /usr/local/ && \ + cargo install --locked --path ./vls-proxy --bin remote_hsmd_socket --profile release --root /usr/local/ && \ cargo clean # final stage with runtime dependencies and pkgs diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index d55ee34..eb19982 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -17,8 +17,8 @@ RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.gi RUN cd vls && \ echo building $VLS_GIT_HASH \ git checkout $VLS_GIT_HASH && \ - cargo install --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ - cargo install --path ./vls-cli --profile release --root /usr/local/ && \ + cargo install --locked --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ + cargo install --locked --path ./vls-cli --profile release --root /usr/local/ && \ cargo clean FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner From 6212e2f56f448e6364e788b039adae7424dbc76f Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Wed, 21 Feb 2024 20:24:44 +0530 Subject: [PATCH 3/3] vls: use v0.11.0-rc.2 candidate Signed-off-by: Lakshya Singh --- lightningd/Dockerfile | 2 +- vlsd/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 351491c..7cf10de 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -85,7 +85,7 @@ RUN apk update && \ protobuf-dev \ rust -ARG VLS_GIT_HASH=f8dea081b8d3ba292285266c9b304eb1d32ceaad \ +ARG VLS_GIT_HASH=3abcd9525ff8da751a4a450ea40753f8bfbb80dd \ VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git RUN git clone $VLS_REPO vls RUN cd vls && \ diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index eb19982..a6e48bc 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -12,7 +12,7 @@ RUN apk update && \ protobuf-dev \ rust -ARG VLS_GIT_HASH=f8dea081b8d3ba292285266c9b304eb1d32ceaad +ARG VLS_GIT_HASH=3abcd9525ff8da751a4a450ea40753f8bfbb80dd RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls RUN cd vls && \ echo building $VLS_GIT_HASH \