From b37b4f30c96609365a13b94cc00c29759bcf646b Mon Sep 17 00:00:00 2001 From: shocknet-justin Date: Sun, 4 Jan 2026 15:57:59 -0500 Subject: [PATCH] docker data_dir --- DOCKER.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/DOCKER.md b/DOCKER.md index 1e4bebae..f65fe41b 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -14,9 +14,55 @@ docker run -d \ --network host \ -p 1776:1776 \ -p 1777:1777 \ + -e DATA_DIR=/app/data \ -v /path/to/local/data:/app/data \ -v $HOME/.lnd:/root/.lnd \ ghcr.io/shocknet/lightning-pub:latest ``` Network host is used so the service can reach a local LND via localhost. LND is assumed to be under the users home folder, update these resources as needed. + +## Getting the Connection String + +After starting the container, you can get the connection string in several ways: + +### Option 1: From the mounted data directory + +If `DATA_DIR=/app/data` is set and the volume is mounted correctly, the connection string will be in: + +```ssh +cat /path/to/local/data/admin.connect +``` + +The connection string format is: `nprofile1...:token` + +### Option 2: Via API endpoint + +Access the wizard endpoint to get connection info: + +```ssh +curl http://localhost:1777/wizard/admin_connect_info +``` + +The response will include the `nprofile` and `admin_token`. Combine them as `nprofile:admin_token` to form the connection string. + +### Option 3: From inside the container + +If the files aren't in the mounted volume, check inside the container: + +```ssh +docker exec lightning-pub cat /app/data/admin.connect +``` + +Or if `DATA_DIR` wasn't set, check the working directory: + +```ssh +docker exec lightning-pub cat /app/admin.connect +``` + +### Troubleshooting + +If `/data` folder is empty: +- Ensure `DATA_DIR=/app/data` environment variable is set in the docker run command +- Check container logs: `docker logs lightning-pub` to see where files are being written +- The logs will show the configured data directory path at startup