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.
This commit is contained in:
Torkel Rogstad
2019-09-04 11:15:36 +02:00
committed by Oliver Gugger
parent 0e14e0d904
commit 27849d3020

View File

@@ -17,7 +17,7 @@ return() {
# set_default function gives the ability to move the setting of default # 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 # 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() { set_default() {
# docker initialized env variables with blank string and we can't just # docker initialized env variables with blank string and we can't just
# use -z flag as usually. # use -z flag as usually.
@@ -45,10 +45,16 @@ DEBUG=$(set_default "$DEBUG" "debug")
NETWORK=$(set_default "$NETWORK" "simnet") NETWORK=$(set_default "$NETWORK" "simnet")
CHAIN=$(set_default "$CHAIN" "bitcoin") CHAIN=$(set_default "$CHAIN" "bitcoin")
BACKEND="btcd" BACKEND="btcd"
HOSTNAME=$(hostname)
if [[ "$CHAIN" == "litecoin" ]]; then if [[ "$CHAIN" == "litecoin" ]]; then
BACKEND="ltcd" BACKEND="ltcd"
fi 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 \ exec lnd \
--noseedbackup \ --noseedbackup \
"--$CHAIN.active" \ "--$CHAIN.active" \
@@ -58,5 +64,6 @@ exec lnd \
"--$BACKEND.rpchost"="blockchain" \ "--$BACKEND.rpchost"="blockchain" \
"--$BACKEND.rpcuser"="$RPCUSER" \ "--$BACKEND.rpcuser"="$RPCUSER" \
"--$BACKEND.rpcpass"="$RPCPASS" \ "--$BACKEND.rpcpass"="$RPCPASS" \
"--rpclisten=$HOSTNAME:10009" \
--debuglevel="$DEBUG" \ --debuglevel="$DEBUG" \
"$@" "$@"