accounts.sqlite3 and emergency.recover are created in my ~/.lightning/bitcoin when I launch lightningd - they weren't created there some years ago. What are accounts.sqlite3 and emergency.recover and why might I want to back them up?
- 542
- 2
- 11
1 Answers
The accounts.sqlite3 file is managed by the built-in plugin bkpr (the bookkeeper plugin). It tracks each individual coin movement that was performed while the plugin was running, and will give detailed information as to where your funds are at any point in time.
The emergency.recover file was introduced in version v0.12.0 and is equivalent to LND's Static Channel Backups (which is more of a emergency recovery rather than a backup, hence the name change). It contains the minimal set of information to know with whom you had a channel, what the funding parameters where, and how to contact them to ask them to shut down the channel. It requires cooperation from the peer, but in absence of a better backup it can be used to recover some funds. It is by no means a replacement for backups, rather a last ditch attempt at clawing back some funds. This file has to be backed up after each funding of a new channel, so ideally set up a cron job to do that for you.
- 9,319
- 1
- 38
- 61
-
`emergency.recover` was not generated back in 2021 when my friend funded their channel. They noticed the file some time in late 2022. Is `emergency.recover`'s creation based on the content of `lightningd.sqlite3`? Is `emergency.recover` created for each open channel (even for those channels funded before version 0.12.00)? – John Smith May 31 '23 at 13:21
-
It is indeed recreated each time a new channel gets funded from the `lightningd.sqlite3`, so a single channel opening after the upgrade will create that file. – cdecker Jun 01 '23 at 14:04