As I’m also using my umbrel node for Lightning, I wonder about procedures how to protect from power- and hardware falures. I’m using a Raspberry 4, and I did add a UPS covering also my NAS and internet router, and set up a watchtower, so these basic measures are taken, Also I mount an nfs share from my NAS, which has RAID, to Umbrel, where I’d have the possibility to regularly and automatically make backup copies. I’m also aware and make static channel backup files; however, to my understanding, you’d rely on your peers knowing the final balance and being honest about it. Ok, watchtowers could probably help here, but nevertheless, closing channels can be costly.
One thing I wonder is why lnd (or also other implementations) don’t allow mirroring critical data automatically into a backup file on a mounted share? The relevant file, to my understanding, is
/home/umbrel/umbrel/lnd/data/graph/mainnet/channel.db; I wrote a short Python script for test purposes that uses the INotify API of the Linux kernel to get a notification whenever that file is modified and then makes a backup to the NAS if its MD5 changes (this happens 4-5 times per minute on my node). However, this file is large (120MB) and probably contains the full channel graph and not only my own secrets/status. I did stop that again, as CPU load for it was too high (probably due to md5 calculations). So a smaller file with the critical data, maybe automatically created by lnd in a thread-safe manner would be great, or do I miss something? I’m aware there is always a small risk of a race condition, but considering I usually only have a transaction or routing all few days, it still looks pretty safe and would, to my understanding, allow continuation without closing channels. In case of a failure, an option might also be to check the file against data stored by a watchtower server if one was used, is something like that possible or maybe planned?