Merge branch 'king-11/bitcoind_health_regtest' into 'main'

bitcoind: healthcheck fix regtest

See merge request lightning-signer/vls-container!20
This commit is contained in:
dev random 2024-02-21 16:20:35 +00:00
commit 0833cfba0e
3 changed files with 16 additions and 8 deletions

View File

@ -1,11 +1,19 @@
#!/bin/sh #!/bin/sh
set -ex
if [[ "$BITCOIN_CHAIN" = "regtest" ]]; then 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 ! bitcoin-cli listwallets | grep -q "default"; then
# If the wallet does not exist, create it # 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 bitcoin-cli createwallet default
fi fi
fi
block_count=$(bitcoin-cli -chain=$BITCOIN_CHAIN getblockcount) block_count=$(bitcoin-cli -chain=$BITCOIN_CHAIN getblockcount)
if [[ "$block_count" = "0" ]]; then if [[ "$block_count" = "0" ]]; then
bitcoin-cli generatetoaddress 101 $(bitcoin-cli -chain=$BITCOIN_CHAIN getnewaddress) bitcoin-cli generatetoaddress 101 $(bitcoin-cli -chain=$BITCOIN_CHAIN getnewaddress)

View File

@ -85,13 +85,13 @@ RUN apk update && \
protobuf-dev \ protobuf-dev \
rust rust
ARG VLS_GIT_HASH=f8dea081b8d3ba292285266c9b304eb1d32ceaad \ ARG VLS_GIT_HASH=3abcd9525ff8da751a4a450ea40753f8bfbb80dd \
VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git
RUN git clone $VLS_REPO vls RUN git clone $VLS_REPO vls
RUN cd vls && \ RUN cd vls && \
echo building $VLS_GIT_HASH \ echo building $VLS_GIT_HASH \
git checkout $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 cargo clean
# final stage with runtime dependencies and pkgs # final stage with runtime dependencies and pkgs

View File

@ -12,13 +12,13 @@ RUN apk update && \
protobuf-dev \ protobuf-dev \
rust 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 git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls
RUN cd vls && \ RUN cd vls && \
echo building $VLS_GIT_HASH \ echo building $VLS_GIT_HASH \
git checkout $VLS_GIT_HASH && \ git checkout $VLS_GIT_HASH && \
cargo install --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ cargo install --locked --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-cli --profile release --root /usr/local/ && \
cargo clean cargo clean
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner