Difference between revisions of "LND Configuration Settings"

From PlebNet Wiki
Jump to navigation Jump to search
Line 76: Line 76:
|maxchansize=50000000
|maxchansize=50000000
| Maximum Channel Size in Sats
| Maximum Channel Size in Sats
|-
|maxpendingchannels=5
|The maximum number of incoming pending channels permitted per peer
|}
|}



Revision as of 20:18, 16 July 2021

Intro

    Ever since the Lightning Network has started and when people began opening channels with others they have been trying to get the most out their Node.  People have been doing this ever since computers have gotten into peoples hands.  Trying out different settings and finding out what works best.

Anyone who would love to go over a long list of config parameters which can be used could check out this Lnd GitHub page https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf

    There are more entries then I ever thought possible, but this Wiki page is how to make adjustments to the Lightning Node environment which helps ones node to perform better.  Something which we'd all would like to happen.

The list which follows is the most common settings which Node Operators have come to agree which best suites a Node which wants to earn fees and route other Nodes Payments. These settings apply to LND 0.12.1 releases. The latest release still has many issues which need to be resolved.

Watch Tower Settings

    Pretty good name for what this does.  Watch Towers are communications between agreeing Nodes to keep on eye on each others Node.  Node Operators pass their Watch Tower address between each other so when one of them is down for some reason, the other one watches for channel situations like a forced close.  If this closure tries to use a non-current Channel state, then the Watch Tower will step in and penalize the Node trying to cheat.
    Currently, the fee for watching another Node is disabled, but at some point there will be a cost with this.  Now if your Node does catch some foul play one will earn fees for being the good guy.
Setting Description
wtclient.active=1 Turns on the Watch Tower Client
wtclient.sweep-fee-rate=10 Sets the sweep fee in sats/vbyte for the justice transaction

Routing Optimization

Setting Description
routerrpc.apriorihopprob=0.5 Probabilistic router hop bias
routerrpc.aprioriweight=0.75 Probabilistic router weighting bias
routerrpc.attemptcost=10 Probabilistic router cost base
routerrpc.attemptcostppm=10 Probabilistic router cost PPM
routerrpc.maxmchistory=100000 Maximum channels you keep in memory, increasing this will require more memory
routerrpc.minrtprob=0.005 Minimum probability to attempt a channel in a route path
routerrpc.penaltyhalflife=2h0m0s Probabilistic router penalty halflife period (how often it will 1/2 the penalty cost of associated with failed route attempt)
routerrpc.attemptcost=10 Probabilistic router attempt cost
routerrpc.attemptcostppm=10 Probabilistic router cost value
max-cltv-expiry=5000 Max CLTV value for route path (this is the sum of all the CLTVs from each hop, so it limits max hops as a result)
max-commit-fee-rate-anchors=100 Commit fee to use when opening a anchor style channel

Channel Size limits

Setting Description
minchansize=5000000 Minimum Channel Size in Sats
maxchansize=50000000 Maximum Channel Size in Sats
maxpendingchannels=5 The maximum number of incoming pending channels permitted per peer

Database optimizations

Setting Description
db.bolt.auto-compact=true Allow automatic compaction of your channel.db file on startup
gc-canceled-invoices-on-startup=1 Cleanup canceled invoices on startup
gc-canceled-invoices-on-the-fly=1 Cleanup chanceled invoices at run-time
caches.channel-cache-size=500000 How many channels should be kept in memory

Startup Optimizations

Setting Description
sync-freelist=1 Enable free list syncing for the default bbolt database. This will decrease start up time, but can result in performance degradation for very large databases, and also result in higher memory usage
stagger-initial-reconnect=1 Stagger initial reconnection on startup, this will reduce load when you have a bunch of channels

Logging

Setting Description debuglevel=CNCT=debug,CRTR=debug,HSWC=debug,NTFN=debug,RPCS=debug This allows you to change the default logging level, the example provides max amount of logging information at the expense of some more disk IO and space

Pre 0.13 LND settings

  • protocol.anchors=true