From b02b64ece1d0d9a1fa4c7eb88eac97466c90e1d3 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Tue, 31 Oct 2023 21:24:11 +0530 Subject: [PATCH] txoo: compose env var set network not chain - no need of using switch in entrypoint - directly set the network instead of chain Signed-off-by: Lakshya Singh --- docker-compose.regtest.yml | 3 ++- docker-compose.yml | 3 ++- txood/entrypoint.sh | 12 +----------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/docker-compose.regtest.yml b/docker-compose.regtest.yml index c40b408..87ad3e5 100644 --- a/docker-compose.regtest.yml +++ b/docker-compose.regtest.yml @@ -28,4 +28,5 @@ services: command: - -r http://rpcuser:VLSsigner1@bitcoind:38332 environment: - - BITCOIN_CHAIN=regtest \ No newline at end of file + - BITCOIN_NETWORK=regtest + diff --git a/docker-compose.yml b/docker-compose.yml index de19964..44637eb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,8 @@ services: bitcoin-core: condition: service_healthy environment: - - BITCOIN_CHAIN=test + - BITCOIN_NETWORK=testnet + volumes: data: diff --git a/txood/entrypoint.sh b/txood/entrypoint.sh index f9dae78..faf4783 100644 --- a/txood/entrypoint.sh +++ b/txood/entrypoint.sh @@ -1,20 +1,10 @@ #!/bin/sh set -e -LIGHTNING_NETWORK="" - -case $BITCOIN_CHAIN in - "test") LIGHTNING_NETWORK=testnet ;; - "regtest") LIGHTNING_NETWORK=regtest ;; - "main") LIGHTNING_NETWORK=bitcoin ;; - "signet") LIGHTNING_NETWORK=signet ;; - *) echo "Invalid BITCOIN_CHAIN value: $BITCOIN_CHAIN" && exit 1 ;; -esac - if [ $(echo "$1" | cut -c1) = "-" ]; then echo "$0: assuming arguments for txood" - set -- txood --network $LIGHTNING_NETWORK "$@" + set -- txood --network $BITCOIN_NETWORK "$@" fi echo