# download, inspect and run the install script
wget https://raw.githubusercontent.com/openoms/lightning-node-management/master/lnd.updates/bonus.chantools.sh
bash bonus.chantools.sh on
# change to the home directory of the bitcoin user
chantools compactdb --sourcedb /mnt/hdd/lnd/data/graph/mainnet/channel.db \
--destdb /mnt/hdd/lnd/data/graph/mainnet/compacted.db
# check the size of the compacted.db
# (the first compacting will have the biggest effect)
du -h /mnt/hdd/lnd/data/graph/mainnet/compacted.db
# 730M /mnt/hdd/lnd/data/graph/mainnet/compacted.db
# make sure lnd is not runnning (needs sudo)
# backup the original database
mv /mnt/hdd/lnd/data/graph/mainnet/channel.db \
/mnt/hdd/lnd/data/graph/mainnet/uncompacted.db
# move the compacted database in place of the old
mv /mnt/hdd/lnd/data/graph/mainnet/compacted.db \
/mnt/hdd/lnd/data/graph/mainnet/channel.db
# exit the bitcoin user to admin