Welcome to LNDg, an advanced web interface designed for analyzing LND data and automating node management tasks.
Choose your preferred installation method:
# Clone the repository
git clone https://github.com/cryptosharks131/lndg.git
# Change directory to the repository
cd lndg
# Customize the docker-compose.yaml file
nano docker-compose.yaml
Replace the contents of docker-compose.yaml
with your desired volume paths and settings. An example configuration is shown below.
services:
lndg:
build: .
volumes:
- /home/<user>/.lnd:/root/.lnd:ro
- /home/<user>/<path-to>/lndg/data:/lndg/data:rw
command:
- sh
- -c
- python initialize.py -net 'mainnet' -server '127.0.0.1:10009' -d && supervisord && python manage.py runserver 0.0.0.0:8889
network_mode: "host"
# Deploy the Docker image
docker-compose up -d
# Retrieve the admin password for login
nano data/lndg-admin.txt
lndg-admin
.docker-compose down
docker-compose build --no-cache
docker-compose up -d
# OPTIONAL: remove unused builds and objects
docker system prune -f
git clone https://github.com/cryptosharks131/lndg.git
cd lndg
sudo apt install virtualenv
virtualenv -p python3 .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python initialize.py
.venv/bin/python initialize.py --help
to see additional options-wn | --whitenoise
option to serve static (.js, .css) files (required if installing manually)
.venv/bin/pip install whitenoise
lndg-admin
, and the password will be genereted and stored in: data/lndg-admin.txt
.venv/bin/python manage.py runserver 0.0.0.0:8889
The file controller.py
orchastrates the services needed to update the backend database with the most up-to-date information, rebalance any channels based on your LNDg dashboard settings, listen for any failure events in your HTLC stream and serves the p2p trade secrets.
Recommended Setup with Supervisord (least setup) or Systemd (most compatible):
Systemd (2 options)
sudo bash systemd.sh
Supervisord
.venv/bin/python initialize.py -sd
.venv/bin/pip install supervisor
supervisord
Alternatively, you may create your own task for these files using your preferred tool (task scheduler, cron job, etc).
cd lndg
git pull
.venv/bin/python manage.py migrate
mainnet
, use the correct flags in step 6 (see initialize.py --help
) or edit the variables directly in lndg/settings.py
..venv/bin/pip install whitenoise && rm lndg/settings.py && .venv/bin/python initialize.py -wn
. (see 6.1)lndg/settings.py
file by directly modifying it or re-running the script .venv/bin/python initialize.py <options> -f
. (see 6)http:<your-hosting-lndg-ip:port>/lndg-admin
.You can serve the dashboard at all times using a webserver instead of the development server. Using a webserver will serve your static files, and installing whitenoise is not required when running in this manner. Any webserver can be used to host the site if configured properly. A bash script has been included to help aid in the setup of an nginx webserver.
To set up the nginx webserver, run the following command:
sudo bash nginx.sh
When updating your LNDg installation, follow the same steps as described above. However, after updating, you will also need to restart the uWSGI service to apply the changes to the user interface (UI).
To restart the uWSGI service, use the following command:
sudo systemctl restart uwsgi.service
Optionally, you may chose to run LNDg using a postgres database instead of the default sqlite3.
A setup guide can be found here: Postgres Setup
LNDg will track the changes your peers make to channel policies you have in open channels and any connection events that may happen with those channels.
You can use LNDg to batch open up to 10 channels at a time with a single transaction. This can help to significantly reduce the channel open fees incurred when opening multiple channels.
You can use LNDg to add, monitor, or remove watch towers from the LND node.
LNDg will make suggestions on an adjustment to the current set outbound fee rate for each channel. This uses historical payment and forwarding data over the last 7 days to drive suggestions. You can use the Auto-Fees feature in order to automatically act upon the suggestions given.
You may see another adjustment right after setting the new suggested fee rate on some channels. This is normal, and you should wait ~24 hours before changing the fee rate again on any given channel.
LNDg will make suggestions for new peers to open channels to based on your node's successful routing history.
The initial login username is lndg-admin
but can be easily modified by going to the page found here: /lndg-admin
LNDg will make suggestions for actions to take around Auto-Rebalancing.
LNDg will automatically act upon the suggestions it makes on the Suggests AR Actions page.
LNDg will listen for failure events in your htlc stream and record them to the dashboard when they occur.
The following data can be accessed at the /api endpoint:
payments
paymenthops
invoices
forwards
onchain
peers
channels
rebalancer
settings
pendinghtlcs
failedhtlcs
LNDg will automatically try to resolve any channels that are seen as inactive, no more than every 3 minutes per peer.
LNDg can update your fees on a channel every 24 hours (default) if there is a suggestion listed on the fee rates page. You must make sure the AF-Enabled
setting is set to 1
and that individual channels you want to be managed are also set to enabled
. You can view a log of AF changes by opening the Autofees tab.
You can customize some settings of AF by updating the following settings:
AF-FailedHTLCs
- The minimum daily failed HTLCs count in which we could trigger a fee increase (depending on flow)
AF-Increment
- The increment size of our potential fee changes, all fee suggestions will be a multiple of this value
AF-MaxRate
- The maximum fee rate in which we can adjust to
AF-MinRate
- The minimum fee rate in which we can adjust to
AF-Multiplier
- Multiplier to increase incremental movements, the larger the multiplier, the larger the incremental moves
AF-UpdateHours
- Change the number of hours that must pass since the last fee rate change before AF may adjust the fee rate again
AF-LowLiqLimit
- The liquidity (%) a channel must drop below before running the Low Liquidity
fee algorithm
AF-ExcessLimit
- The liquidity (%) a channel must go above before running the Excess Liquidity
fee algorithm
AF Notes:
AF-UpdateHours
hours of no fee updates via LNDgAF-LowLiqLimit
outbound liquidty will increase based on failed HTLC counts and incoming flowAF-ExcessLimit
outbound liquidty will decrease based on no flows or assisted revenuesThe objective of the Auto-Rebalancer is to "refill" the liquidity on the local side (i.e. OUTBOUND) of profitable and lucrative channels. So that, when a forward comes in from another node there is always enough liquidity to route the payment and in return collect the desired routing fees.
AR-Enabled
must be set to 1 (enabled) in order to start looking for new rebalance opportunities. (default=0)AR-Target%
defines the % size of the channel capacity you would like to use for rebalance attempts. Example: If a channel size is 1M Sats and AR-Target% = 0.05 LNDg will select an amount of 5% of 1M = 50K for rebalancing. (default=5)AR-Time
defines the maximum amount of time (minutes) we will spend looking for a route. (default=5)AR-MaxFeeRate
defines the maximum amount in ppm a rebalance attempt can ever use for a fee limit. This is the maximum limit to ensure the total fee does not exceed this amount. Example: AR-MaxFeeRate = 800 will ensure the rebalance fee is always less than 800 ppm. (default=100)AR-MaxCost%
defines the maximum % of the ppm being charged on the INBOUND
receving channel that will be used as the fee limit for the rebalance attempt. Example: If your fee to node A is 1000ppm and AR-MaxCost% = 0.5 LNDg will use 50% of 1000ppm = 500ppm max fee limit for rebalancing. (default=65)AR-Outbound%
helps identify all the channels that would be a candidate for rebalancing targetd channels. Rebalances will only consider any OUTBOUND
channel that has more outbound liquidity than the current AR-Outbound%
setting AND the channel is not currently being targeted as an INBOUND
receving channel for rebalances. Example: AR-Outboud% = 0.6 would make all channels with an outbound capacity of 60% or more AND not enabled under AR on the channel line to be a candidate for rebalancing. (default=75)INBOUND
receving channel.INBOUND
receving channels you would like to target and set an inbound liquidity Target%
on the specific channel. Rebalance attempts will be made until inbound liquidity falls below this channel settting.INBOUND
receving channel is the channel that later routes out real payments and earns back the fees paid. Target channels that have lucrative outbound flows.AR-WaitPeriod
setting.Additional customization options:
AR-Autopilot
- Automatically act upon suggestions on the AR Actions page. (default=0)AR-WaitPeriod
- How much time (minutes) AR should wait before scheduling a channel that has recently failed an attempt. (default=30)AR-Variance
- How much to randomly vary the target rebalance amount by this % of the target amount. (default=0)AR-Inbound%
- The default iTarget%
value to assign to new channels. (default=100)AR-APDays
- The number of days of historical data AP should use to decide actions to take. (default=7)AR-Workers
- Define how many parallel rebalances to spin up at once. (default=1)Update Channel Specific Settings
a. Go to Active Channels section
b. Find the channels you would like to activate for rebalancing (this refills its outbound)
c. On far right column Click the Enable button to activate rebalancing
d. The dashboard will refresh and show AR-Target 100%
e. Adjust the AR-Target to desired % of liquidity you want to keep on remote INBOUND side. Example select 0.60 if you want 60% of the channel capacity on Remote/INBOUND side which would mean that there is 40% on Local/OUTBOUND side
f. Hit Enter
g. Dashboard will refresh in the browser
h. Make sure you enable all channels that are valuable outbound routes for you to ensure they are not used for filling up routes you have targeted (you can enable and target 100% in order to avoid any action on this channel from the rebalancer)
Update Global Settings
a. Go to section Update Auto Rebalancer Settings
b. Select the global settings (sample below):
c. Click OK button to submit
d. Once enabled is set to 1 in the global settings - the rebalancer will become active
Enabled: 1
Target Amount (%): 0.03
Target Time (min): 3
Target Outbound Above (%): 0.4
Global Max Fee Rate (ppm): 500
Max Cost (%): 0.6
Go to section Last 10 Rebalance Requests - that will show the list of the rebalancing queue and status.
If you want a channel not to be picked for rebalancing (i.e. it is already full with OUTBOUND capacity that you desire), enable the channel and set the AR-Target% to 100. The rebalancer will ignore the channel while selecting the channels for outbound candidates and since its INBOUND can never be above 100% it will never trigger a rebalance.
/api
(json format available with url appended with ?format=json
)accept-keysend=true
in lnd.conf)