From 27849d30203a65e26cd4a8ed450a443e8b0da7a2 Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Wed, 4 Sep 2019 11:15:36 +0200 Subject: [PATCH] docker: add --rpclisten to start-lnd.sh To make it possible to communicate over gRPC with an instance running in Docker we need to expose the correct RPC interface. --- docker/lnd/start-lnd.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/lnd/start-lnd.sh b/docker/lnd/start-lnd.sh index 1fb8502ff..c7bfe3058 100755 --- a/docker/lnd/start-lnd.sh +++ b/docker/lnd/start-lnd.sh @@ -17,7 +17,7 @@ return() { # set_default function gives the ability to move the setting of default # env variable from docker file to the script thereby giving the ability to the -# user override it durin container start. +# user override it during container start. set_default() { # docker initialized env variables with blank string and we can't just # use -z flag as usually. @@ -45,10 +45,16 @@ DEBUG=$(set_default "$DEBUG" "debug") NETWORK=$(set_default "$NETWORK" "simnet") CHAIN=$(set_default "$CHAIN" "bitcoin") BACKEND="btcd" +HOSTNAME=$(hostname) if [[ "$CHAIN" == "litecoin" ]]; then BACKEND="ltcd" fi +# CAUTION: DO NOT use the --noseedback for production/mainnet setups, ever! +# Also, setting --rpclisten to $HOSTNAME will cause it to listen on an IP +# address that is reachable on the internal network. If you do this outside of +# docker, this might be a security concern! + exec lnd \ --noseedbackup \ "--$CHAIN.active" \ @@ -58,5 +64,6 @@ exec lnd \ "--$BACKEND.rpchost"="blockchain" \ "--$BACKEND.rpcuser"="$RPCUSER" \ "--$BACKEND.rpcpass"="$RPCPASS" \ + "--rpclisten=$HOSTNAME:10009" \ --debuglevel="$DEBUG" \ "$@"