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
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -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" \
"$@"