Browse Source

Expose LND RPC/REST for lndconnect (#237)

ram-fix
Mayank Chhabra 4 years ago
committed by GitHub
parent
commit
5c8d06e8b6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      docker-compose.yml
  2. 4
      scripts/configure
  3. 1
      scripts/start
  4. 1
      templates/lnd-sample.conf
  5. 8
      templates/torrc-sample

8
docker-compose.yml

@ -60,6 +60,8 @@ services:
stop_grace_period: 5m30s stop_grace_period: 5m30s
ports: ports:
- "9735:9735" - "9735:9735"
- "8080:8080"
- "10009:10009"
networks: networks:
net: net:
ipv4_address: 10.11.1.2 ipv4_address: 10.11.1.2
@ -84,6 +86,7 @@ services:
- ${PWD}/info.json:/info.json - ${PWD}/info.json:/info.json
- ${PWD}/db:/db - ${PWD}/db:/db
- ${PWD}/events/signals:/signals - ${PWD}/events/signals:/signals
- ${PWD}/lnd:/lnd:ro
- ${PWD}/statuses:/statuses - ${PWD}/statuses:/statuses
- ${PWD}/tor/data:/var/lib/tor/ - ${PWD}/tor/data:/var/lib/tor/
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
@ -98,11 +101,16 @@ services:
JWT_EXPIRATION: "3600" JWT_EXPIRATION: "3600"
DOCKER_COMPOSE_DIRECTORY: $PWD DOCKER_COMPOSE_DIRECTORY: $PWD
DEVICE_HOSTS: ${DEVICE_HOSTS:-"http://umbrel.local"} DEVICE_HOSTS: ${DEVICE_HOSTS:-"http://umbrel.local"}
DEVICE_HOSTNAME: ${DEVICE_HOSTNAME:-""}
MIDDLEWARE_API_URL: "http://10.11.2.2" MIDDLEWARE_API_URL: "http://10.11.2.2"
UMBREL_SEED_FILE: "/db/umbrel-seed/seed" UMBREL_SEED_FILE: "/db/umbrel-seed/seed"
UMBREL_DASHBOARD_HIDDEN_SERVICE_FILE: "/var/lib/tor/web/hostname" UMBREL_DASHBOARD_HIDDEN_SERVICE_FILE: "/var/lib/tor/web/hostname"
BITCOIN_P2P_HIDDEN_SERVICE_FILE: "/var/lib/tor/bitcoin-p2p/hostname" BITCOIN_P2P_HIDDEN_SERVICE_FILE: "/var/lib/tor/bitcoin-p2p/hostname"
BITCOIN_P2P_PORT: $BITCOIN_P2P_PORT BITCOIN_P2P_PORT: $BITCOIN_P2P_PORT
LND_REST_HIDDEN_SERVICE_FILE: "/var/lib/tor/lnd-rest/hostname"
LND_GRPC_HIDDEN_SERVICE_FILE: "/var/lib/tor/lnd-grpc/hostname"
LND_CERT_FILE: "/lnd/tls.cert"
LND_ADMIN_MACAROON_FILE: "/lnd/data/chain/bitcoin/${BITCOIN_NETWORK}/admin.macaroon"
SHUTDOWN_SIGNAL_FILE: "/signals/shutdown" SHUTDOWN_SIGNAL_FILE: "/signals/shutdown"
REBOOT_SIGNAL_FILE: "/signals/reboot" REBOOT_SIGNAL_FILE: "/signals/reboot"
GITHUB_REPO: "getumbrel/umbrel" GITHUB_REPO: "getumbrel/umbrel"

4
scripts/configure

@ -163,6 +163,10 @@ sed -i "s/tor.password=<password>/tor.password=$TOR_PASS/g;" "$LND_CONF_FILE"
sed -i "s/TOR_PASSWORD=<password>/TOR_PASSWORD=$TOR_PASS/g;" "$ENV_FILE" sed -i "s/TOR_PASSWORD=<password>/TOR_PASSWORD=$TOR_PASS/g;" "$ENV_FILE"
sed -i "s/TOR_HASHED_PASSWORD=<password>/TOR_HASHED_PASSWORD=$TOR_HASHED_PASS/g;" "$ENV_FILE" sed -i "s/TOR_HASHED_PASSWORD=<password>/TOR_HASHED_PASSWORD=$TOR_HASHED_PASS/g;" "$ENV_FILE"
# Add hostname to lnd.conf for TLS certificate
DEVICE_HOSTNAME="$(hostname)"
sed -i "s/tlsextradomain=<hostname>/tlsextradomain=$DEVICE_HOSTNAME.local/g;" "$LND_CONF_FILE"
# If node is already synced, do not reset to neutrino # If node is already synced, do not reset to neutrino
if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then
sed -i "s/bitcoin.node=.*/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE" sed -i "s/bitcoin.node=.*/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE"

1
scripts/start

@ -59,6 +59,7 @@ if [[ -f "${UMBREL_ROOT}/tor/data/web/hostname" ]]; then
DEVICE_HOSTS="${DEVICE_HOSTS},http://${hidden_service_url}" DEVICE_HOSTS="${DEVICE_HOSTS},http://${hidden_service_url}"
fi fi
export DEVICE_HOSTS=$DEVICE_HOSTS export DEVICE_HOSTS=$DEVICE_HOSTS
export DEVICE_HOSTNAME="${DEVICE_HOSTNAME}.local"
# Increase default Docker and Compose timeouts to 240s # Increase default Docker and Compose timeouts to 240s
# as bitcoin can take a long while to respond # as bitcoin can take a long while to respond

1
templates/lnd-sample.conf

@ -6,6 +6,7 @@ maxpendingchannels=3
minchansize=10000 minchansize=10000
accept-keysend=true accept-keysend=true
tlsextraip=10.11.1.2 tlsextraip=10.11.1.2
tlsextradomain=<hostname>
tlsautorefresh=1 tlsautorefresh=1
[Bitcoind] [Bitcoind]

8
templates/torrc-sample

@ -10,4 +10,12 @@ HiddenServicePort 80 10.11.0.2:80
HiddenServiceDir /var/lib/tor/bitcoin-p2p HiddenServiceDir /var/lib/tor/bitcoin-p2p
HiddenServicePort <bitcoin-p2p-port> 10.11.1.1:<bitcoin-p2p-port> HiddenServicePort <bitcoin-p2p-port> 10.11.1.1:<bitcoin-p2p-port>
# LND REST Hidden Service
HiddenServiceDir /var/lib/tor/lnd-rest
HiddenServicePort 8080 10.11.1.2:8080
# LND gRPC Hidden Service
HiddenServiceDir /var/lib/tor/lnd-grpc
HiddenServicePort 10009 10.11.1.2:10009
HashedControlPassword <password> HashedControlPassword <password>

Loading…
Cancel
Save