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 <lakshay.singh1108@gmail.com>
This commit is contained in:
Lakshya Singh 2023-10-31 21:24:11 +05:30
parent 9cb9062ce8
commit b02b64ece1
No known key found for this signature in database
GPG Key ID: D3239BA6109A2CE7
3 changed files with 5 additions and 13 deletions

View File

@ -28,4 +28,5 @@ services:
command:
- -r http://rpcuser:VLSsigner1@bitcoind:38332
environment:
- BITCOIN_CHAIN=regtest
- BITCOIN_NETWORK=regtest

View File

@ -62,7 +62,8 @@ services:
bitcoin-core:
condition: service_healthy
environment:
- BITCOIN_CHAIN=test
- BITCOIN_NETWORK=testnet
volumes:
data:

View File

@ -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