Compact the LND database (channel.db)
Compact the LND database (channel.db)
An over 1GB channel.db
file does not work on 32bit systems: https://github.com/lightningnetwork/lnd/issues/4811
Auto-compact on restart
Since LND v0.12.0 can set db.bolt.auto-compact=true
in the lnd.conf
.
To edit:
sudo nano /mnt/hdd/lnd/lnd.conf
insert the following (can leave out the comments):
restart lnd:
sudo systemctl restart lnd
monitor the process (can take several minutes):
sudo tail -fn 30 /mnt/hdd/lnd/logs/bitcoin/mainnet/lnd.log
might want to disable the auto-compact in
lnd.conf
and only activate on-demand to avoid long startup times:
Compacting with Channels Tools
https://github.com/guggero/chantools#compactdb
Run the following commands in the RaspiBlitz terminal
See the comments for what each command does.
Prune the revocation logs
available since LND v0.15.1
Does not replace the database compacting and needs to be done only once after updating to LND v0.15.1 and above
On a Raspiblitz or compatible system:
Edit the systemd service:
Edit the line starting with
ExecStart=
so it looks like:CTRL+o, ENTER and CTRL+x to save then restart LND:
monitor the process in the logs:
can take 30-60 mins typically similar to compacting after a long time.
after the pruning has finished the node comes back online
will need to compact once again to remove the pruned logs and reduce the size of the channel.db
example output of the compaction after pruning the revocation logs:
Last updated