Add lnd v0.14.2 docker

This commit is contained in:
Reckless_Satoshi 2022-02-09 07:21:51 -08:00
parent 243690899e
commit ee7786c5c1
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
6 changed files with 93 additions and 4 deletions

View File

@ -539,7 +539,7 @@ class Logics():
cltv_expiry_secs=BOND_EXPIRY*3600)
except Exception as e:
if 'status = StatusCode.UNAVAILABLE' in str(e):
return False, {'bad_request':'The Lightning Network Daemon (LND) is down. Write in the Telegram group to make sure staff is aware.'}
return False, {'bad_request':'The Lightning Network Daemon (LND) is down. Write in the Telegram group to make sure the staff is aware.'}
order.maker_bond = LNPayment.objects.create(
concept = LNPayment.Concepts.MAKEBOND,
@ -625,7 +625,7 @@ class Logics():
except Exception as e:
if 'status = StatusCode.UNAVAILABLE' in str(e):
return False, {'bad_request':'The Lightning Network Daemon (LND) is down. Write in the Telegram group to make sure staff is aware.'}
return False, {'bad_request':'The Lightning Network Daemon (LND) is down. Write in the Telegram group to make sure the staff is aware.'}
order.taker_bond = LNPayment.objects.create(
concept = LNPayment.Concepts.TAKEBOND,
@ -695,7 +695,7 @@ class Logics():
except Exception as e:
if 'status = StatusCode.UNAVAILABLE' in str(e):
return False, {'bad_request':'The Lightning Network Daemon (LND). Write in the Telegram group to make sure staff is aware.'}
return False, {'bad_request':'The Lightning Network Daemon (LND) is down. Write in the Telegram group to make sure the staff is aware.'}
order.trade_escrow = LNPayment.objects.create(

View File

@ -85,6 +85,29 @@ services:
volumes:
- /mnt/development/tor/data:/var/lib/tor
- /mnt/development/tor/config:/etc/tor
ports:
- '10009'
- '8080'
lnd:
build: ./docker/lnd
restart: always
network_mode: service:tor
container_name: lnd-dev
depends_on:
- tor
- bitcoind
volumes:
- /mnt/development/tor/data:/var/lib/tor
- /mnt/development/tor/config:/etc/tor
- /mnt/development/lnd:/home/lnd/.lnd
- /mnt/development/lnd:/root/.lnd
command: lnd
environment:
LOCAL_USER_ID: 1000
LOCAL_GROUP_ID: 1000
LND_RPC_PORT: 10009
LND_REST_PORT: 8080
bitcoind:
build: ./docker/bitcoind

18
docker/lnd/Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM lightninglabs/lnd:v0.14.2-beta
ARG LOCAL_USER_ID=9999
ARG LOCAL_GROUP_ID=9999
USER root
RUN adduser --disabled-password lnd
# Set the expected local user id
# for shared group to access tor cookie
RUN apk --no-cache --no-progress add shadow=~4 sudo=~1 gettext=~0.21 && \
usermod -u "$LOCAL_USER_ID" lnd && \
groupmod -g "$LOCAL_GROUP_ID" lnd
USER root
COPY entrypoint.sh /root/entrypoint.sh
COPY lnd.conf /tmp/lnd.conf
ENTRYPOINT [ "/root/entrypoint.sh" ]

17
docker/lnd/entrypoint.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
set -e
# Create lnd.conf if it doesn't exist
if [ ! -f "/home/lnd/.lnd/lnd.conf" ]; then
envsubst < /tmp/lnd.conf > /home/lnd/.lnd/lnd.conf
fi
# Change local user id and group
usermod -u "${LOCAL_USER_ID:?}" lnd
groupmod -g "${LOCAL_GROUP_ID:?}" lnd
# Fix ownership
chown -R lnd /home/lnd
# Start lnd
exec sudo -u lnd "$@"

31
docker/lnd/lnd.conf Normal file
View File

@ -0,0 +1,31 @@
# Reference: https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf
debuglevel=info
alias=🤖RoboSats⚡(RoboDevs)
color=#4126a7
maxpendingchannels=6
bitcoin.active=1
bitcoin.testnet=1
bitcoin.node=bitcoind
bitcoind.rpcuser=bitcoindrobodevtestnet3
bitcoind.rpcpass=bitcoindrobodevtestnet3
bitcoind.zmqpubrawblock=tcp://127.0.0.1:18501
bitcoind.zmqpubrawtx=tcp://127.0.0.1:18502
# Wallet-unlock-password-file=/root/.lnd/pwd
# Neutrino
neutrino.connect=faucet.lightning.community
# Configuring Tor docs:
# https://github.com/lightningnetwork/lnd/blob/master/docs/configuring_tor.md
tor.active=1
tor.v3=1
# Listening port will need to be changed if multiple LND instances are running
listen=localhost:9735
# Allow connection to gRPC from host
rpclisten=0.0.0.0:10009
restlisten=0.0.0.0:8080
tlsextraip=0.0.0.0

File diff suppressed because one or more lines are too long