Skip to content

Commit

Permalink
Remove stagger from lnd wait script
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Jun 10, 2024
1 parent cab8421 commit ce3d776
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
restart: unless-stopped
depends_on:
- lnd1
entrypoint: ["/wait-for-lnd.sh", "lnd1", "1"]
entrypoint: ["/wait-for-lnd.sh", "lnd1"]
command: --address=https://lnd1:10009 --cert-path=/root/.lnd/tls.cert --macaroon-path=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon --log-level=trace --grpc-host=0.0.0.0
environment:
- RUST_BACKTRACE=1
Expand Down Expand Up @@ -89,7 +89,7 @@ services:
restart: unless-stopped
depends_on:
- lnd2
entrypoint: ["/wait-for-lnd.sh", "lnd2", "3"]
entrypoint: ["/wait-for-lnd.sh", "lnd2"]
command: --address=https://lnd2:10009 --cert-path=/root/.lnd/tls.cert --macaroon-path=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon --log-level=trace --grpc-host=0.0.0.0
environment:
- RUST_BACKTRACE=1
Expand Down
9 changes: 1 addition & 8 deletions docker/lndk/wait-for-lnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# delay The delay (in seconds) for the startup of lndk nodes after lnd's gRPC port is ready.
# lndk-args The arguments to be passed to the lndk command.

# Function to check if lnd is ready
is_lnd_ready() {
macaroon=$(base64 /root/.lnd/data/chain/bitcoin/regtest/readonly.macaroon | tr -d '\n')
response=$(curl --cacert /root/.lnd/tls.cert -Ss -H "Grpc-Metadata-macaroon: $macaroon" "https://$1:8080/v1/state")
Expand All @@ -33,13 +32,7 @@ until is_lnd_ready $1; do
sleep 2
done

# Delay startup of lndk nodes
# The sleep command is used to pause the script for a specified number of seconds before starting lndk.
# The number of seconds is specified by the second parameter to the script.
echo "Waiting for another $2 seconds before starting lndk..."
sleep "$2"

# Start lndk
# The exec command is used to replace the current shell process with the lndk command.
# The "${@:3}" part is used to pass all arguments starting from the third one to the lndk command.
exec lndk "${@:3}"
exec lndk "${@:2}"

0 comments on commit ce3d776

Please sign in to comment.