Skip to content

Commit 033490f

Browse files
authored
Merge pull request #23 from KoalaSat/add-lndg-docker
Add LNDg
2 parents 932fe92 + d31f436 commit 033490f

File tree

5 files changed

+74
-8
lines changed

5 files changed

+74
-8
lines changed

compose/docker-compose.override-lnd.yml

+17
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ services:
4545
volumes:
4646
- ${LND_DATA:?}:/lnd/:ro
4747
- ${LIT_DATA:?}:/root/
48+
49+
lndg:
50+
build: ./lndg
51+
restart: always
52+
container_name: lndg${SUFFIX}
53+
volumes:
54+
- ${LNDG_CONFIG}:/root/supervisord.conf:ro
55+
- ${LND_DATA}:/root/.lnd:ro
56+
- ${LNDG_DATA}:/lndg/data:rw
57+
depends_on:
58+
- tor
59+
- lnd
60+
command:
61+
- sh
62+
- -c
63+
- 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
64+
network_mode: service:tor
4865

4966
# Patch common services
5067
tor:

compose/env-sample/lndtn/compose.env

+9-8
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ BU_DIR2='/custom_path/backup'
4141
BU_DIR3='/custom_path/backup2'
4242

4343
BITCOIN_DATA='/custom_path/testnet/bitcoin'
44-
BITCOIN_CONF='./env/lndtn/bitcoin.conf'
44+
BITCOIN_CONF='./env-sample/lndtn/bitcoin.conf'
4545
LND_DATA='/custom_path/testnet/lnd'
46-
LND_CONF='./env/lndtn/lnd.conf'
46+
LND_CONF='./env-sample/lndtn/lnd.conf'
4747
LIT_DATA='/custom_path/testnet/lit'
4848

4949
GUEST_BITCOIN=/home/bitcoin/.bitcoin
5050

51-
TOR_DATA='./env/lndtn/tor'
52-
TOR_CONFIG='./env/lndtn/torrc'
51+
TOR_DATA='./env-sample/lndtn/tor'
52+
TOR_CONFIG='./env-sample/lndtn/torrc'
5353

5454
GUEST_LND_RPC_PORT=10009
5555
GUEST_LND_REST_PORT=8080
@@ -58,12 +58,13 @@ HOST_LND_RPC_PORT=10009
5858
HOST_LND_REST_PORT=8080
5959

6060
THUB_LOCAL_PORT=3001
61-
THUB_ACCOUNTS='./env/lndtn/thunderhub-accounts.yml'
61+
THUB_ACCOUNTS='./env-sample/lndtn/thunderhub-accounts.yml'
6262
# THUB_ACCOUNTS_CONFIG_PATH must match thub...env
6363
THUB_ACCOUNTS_CONFIG_PATH='/config/accounts.yml'
6464

65-
66-
65+
LNDG_CONFIG='./env-sample/lndtn/supervisord.conf'
66+
LNDG_DATA='/custom_path/testnet/lndg/data'
67+
LNDG_PASSWORD=999999999
6768

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

75-
LND_AUTOUNLOCK_PWD='./env/lndtn/lnd_autounlock_pwd'
76+
LND_AUTOUNLOCK_PWD='./env-sample/lndtn/lnd_autounlock_pwd'
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[supervisord]
2+
user=root
3+
childlogdir = /var/log
4+
logfile = /var/log/supervisord.log
5+
logfile_maxbytes = 50MB
6+
logfile_backups = 30
7+
loglevel = info
8+
pidfile = /var/supervisord.pid
9+
umask = 022
10+
nodaemon = false
11+
nocleanup = false
12+
13+
[inet_http_server]
14+
port = 9001
15+
username = lndg-supervisord
16+
password = 8888888888 # Change this password
17+
18+
[supervisorctl]
19+
serverurl = http://localhost:9001
20+
username = lndg-supervisord
21+
password = 8888888888 # Change this password
22+
23+
[rpcinterface:supervisor]
24+
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
25+
26+
[program:controller]
27+
command = sh -c "python controller.py && sleep 15"
28+
process_name = lndg-controller
29+
directory = /app
30+
autorestart = true
31+
redirect_stderr = true
32+
stdout_logfile = /var/log/lndg-controller.log
33+
stdout_logfile_maxbytes = 150MB
34+
stdout_logfile_backups = 15

compose/env-sample/lndtn/torrc

+4
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ HiddenServicePort 80 127.0.0.1:3000
2828
HiddenServiceDir /var/lib/tor/robotest-lit/
2929
HiddenServiceVersion 3
3030
HiddenServicePort 8443 127.0.0.1:8443
31+
32+
HiddenServiceDir /var/lib/tor/robotest-lndg/
33+
HiddenServiceVersion 3
34+
HiddenServicePort 80 127.0.0.1:8889

compose/lndg/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3-alpine
2+
ENV TZ=Europe/London
3+
ENV PYTHONUNBUFFERED 1
4+
5+
RUN apk add git g++ linux-headers && git clone https://github.com/cryptosharks131/lndg /app
6+
WORKDIR /app
7+
8+
RUN git checkout "v1.9.0"
9+
RUN pip install -r requirements.txt
10+
RUN pip install supervisor whitenoise

0 commit comments

Comments
 (0)