From 27d5c63fc6f622ff440810eeefb79fa8a3c32661 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Thu, 25 Nov 2021 16:33:58 -0500 Subject: [PATCH] blitz.web.api.sh update-config for testnet (#2724) --- home.admin/config.scripts/blitz.web.api.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.web.api.sh b/home.admin/config.scripts/blitz.web.api.sh index c31577dfb..249ed70c0 100755 --- a/home.admin/config.scripts/blitz.web.api.sh +++ b/home.admin/config.scripts/blitz.web.api.sh @@ -131,11 +131,23 @@ if [ "$1" = "update-config" ]; then echo "# CONFIG Web API Lightning --> LND" tlsCert=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/tls.cert) - adminMacaroon=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/bitcoin/mainnet/admin.macaroon) + adminMacaroon=$(sudo xxd -ps -u -c 1000 /mnt/hdd/lnd/data/chain/bitcoin/${chain}net/admin.macaroon) sed -i "s/^ln_node=.*/ln_node=lnd/g" ./.env sed -i "s/^lnd_grpc_ip=.*/lnd_grpc_ip=127.0.0.1/g" ./.env sed -i "s/^lnd_macaroon=.*/lnd_macaroon=${adminMacaroon}/g" ./.env sed -i "s/^lnd_cert=.*/lnd_cert=${tlsCert}/g" ./.env + if [ "${chain}" == "main" ];then + L2rpcportmod=0 + portprefix="" + elif [ "${chain}" == "test" ];then + L2rpcportmod=1 + portprefix=1 + elif [ "${chain}" == "sig" ];then + L2rpcportmod=3 + portprefix=3 + fi + lnd_grpc_port=1${L2rpcportmod}009 + lnd_rest_port=${portprefix}8080 # configure CL elif [ "${lightning}" == "cl" ]; then