How to compact your LND node's database

Posted over 2 years ago by StackingSomeSats

Uncompacted databases may cause issues for routing nodes such as gigabytes of space used on channels.db, and may lead to slowness of more than 20 seconds above average for transactions if it gets bad enough.

  1. Edit lnd.conf (use nano)
    • Umbrel: `~/umbrel/lnd/lnd.conf`
    • RaspiBlitz: `/mnt/hdd/lnd/lnd.conf`
  2. Add the following code: 
  3. [bolt]
    db.bolt.auto-compact=true
    db.bolt.auto-compact-min-age=0
  4. Restart lnd
    •  Umbrel: `cd ~/umbrel; docker-compose restart lnd`
    • RaspiBlitz: `sudo systemctl restart lnd`
  5. Wait for a minute or two.
  6. (Optional) If you do not want LND to compact on every restart, replace `db.bolt.auto-compact=true` with `db.bolt.auto-compact=false`

2 Comments

DonKingLN

DonKingLN wrote over 2 years ago

On RaspiBlitz you can check the LND channel.db size by running:

sudo du -h /mnt/hdd/lnd/data/graph/mainnet/channel.db


Tr4ck3r

Tr4ck3r wrote almost 2 years ago

The path of the lnd.conf file is:
umbrel/app-data/lightning/data/lnd/

Please login to post comments.

Lightning Network Node
StackingSomeSats
Rank: 0
Capacity: 7,418,402 SAT
Channels: 6

Latest news

Status update on StackingSomeSats

Posted over 2 years ago