Skip to content

Commit

Permalink
Merge pull request #23 from KoalaSat/add-lndg-docker
Browse files Browse the repository at this point in the history
Add LNDg
  • Loading branch information
KoalaSat authored Oct 17, 2024
2 parents 932fe92 + d31f436 commit 033490f
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 8 deletions.
17 changes: 17 additions & 0 deletions compose/docker-compose.override-lnd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ services:
volumes:
- ${LND_DATA:?}:/lnd/:ro
- ${LIT_DATA:?}:/root/

lndg:
build: ./lndg
restart: always
container_name: lndg${SUFFIX}
volumes:
- ${LNDG_CONFIG}:/root/supervisord.conf:ro
- ${LND_DATA}:/root/.lnd:ro
- ${LNDG_DATA}:/lndg/data:rw
depends_on:
- tor
- lnd
command:
- sh
- -c
- python initialize.py -net ${NETWORK} -d -dx -dir /root/.lnd -rpc 127.0.0.1:${GUEST_LND_RPC_PORT:?} -pw '${LNDG_PASSWORD:?}' && supervisord -c /root/supervisord.conf && python manage.py runserver 0.0.0.0:8889
network_mode: service:tor

# Patch common services
tor:
Expand Down
17 changes: 9 additions & 8 deletions compose/env-sample/lndtn/compose.env
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ BU_DIR2='/custom_path/backup'
BU_DIR3='/custom_path/backup2'

BITCOIN_DATA='/custom_path/testnet/bitcoin'
BITCOIN_CONF='./env/lndtn/bitcoin.conf'
BITCOIN_CONF='./env-sample/lndtn/bitcoin.conf'
LND_DATA='/custom_path/testnet/lnd'
LND_CONF='./env/lndtn/lnd.conf'
LND_CONF='./env-sample/lndtn/lnd.conf'
LIT_DATA='/custom_path/testnet/lit'

GUEST_BITCOIN=/home/bitcoin/.bitcoin

TOR_DATA='./env/lndtn/tor'
TOR_CONFIG='./env/lndtn/torrc'
TOR_DATA='./env-sample/lndtn/tor'
TOR_CONFIG='./env-sample/lndtn/torrc'

GUEST_LND_RPC_PORT=10009
GUEST_LND_REST_PORT=8080
Expand All @@ -58,12 +58,13 @@ HOST_LND_RPC_PORT=10009
HOST_LND_REST_PORT=8080

THUB_LOCAL_PORT=3001
THUB_ACCOUNTS='./env/lndtn/thunderhub-accounts.yml'
THUB_ACCOUNTS='./env-sample/lndtn/thunderhub-accounts.yml'
# THUB_ACCOUNTS_CONFIG_PATH must match thub...env
THUB_ACCOUNTS_CONFIG_PATH='/config/accounts.yml'



LNDG_CONFIG='./env-sample/lndtn/supervisord.conf'
LNDG_DATA='/custom_path/testnet/lndg/data'
LNDG_PASSWORD=999999999

LIT_LOCAL_PORT=4001
LIT_PASSWORD=999999999
Expand All @@ -72,4 +73,4 @@ LND_BACKUP_PATH='/custom_path/testnet/lnd-backup'
NODE_ALIAS='🤖RoboSats⚡(Testnet)'
NODE_COLOR='#4126a7'

LND_AUTOUNLOCK_PWD='./env/lndtn/lnd_autounlock_pwd'
LND_AUTOUNLOCK_PWD='./env-sample/lndtn/lnd_autounlock_pwd'
34 changes: 34 additions & 0 deletions compose/env-sample/lndtn/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[supervisord]
user=root
childlogdir = /var/log
logfile = /var/log/supervisord.log
logfile_maxbytes = 50MB
logfile_backups = 30
loglevel = info
pidfile = /var/supervisord.pid
umask = 022
nodaemon = false
nocleanup = false

[inet_http_server]
port = 9001
username = lndg-supervisord
password = 8888888888 # Change this password

[supervisorctl]
serverurl = http://localhost:9001
username = lndg-supervisord
password = 8888888888 # Change this password

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[program:controller]
command = sh -c "python controller.py && sleep 15"
process_name = lndg-controller
directory = /app
autorestart = true
redirect_stderr = true
stdout_logfile = /var/log/lndg-controller.log
stdout_logfile_maxbytes = 150MB
stdout_logfile_backups = 15
4 changes: 4 additions & 0 deletions compose/env-sample/lndtn/torrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ HiddenServicePort 80 127.0.0.1:3000
HiddenServiceDir /var/lib/tor/robotest-lit/
HiddenServiceVersion 3
HiddenServicePort 8443 127.0.0.1:8443

HiddenServiceDir /var/lib/tor/robotest-lndg/
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:8889
10 changes: 10 additions & 0 deletions compose/lndg/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3-alpine
ENV TZ=Europe/London
ENV PYTHONUNBUFFERED 1

RUN apk add git g++ linux-headers && git clone https://github.com/cryptosharks131/lndg /app
WORKDIR /app

RUN git checkout "v1.9.0"
RUN pip install -r requirements.txt
RUN pip install supervisor whitenoise

0 comments on commit 033490f

Please sign in to comment.