backup: Some improvements to text of README.md

This commit is contained in:
Wladimir J. van der Laan
2020-12-18 17:40:25 +01:00
committed by Christian Decker
parent a6afc5a612
commit 7678fe1ed1

View File

@@ -3,13 +3,13 @@
**This version only supports the default SQLite3 database**
This plugin will maintain clean database backups to another location. It uses
the `db_write` hook to make sure to always have a backup that isn't missing any
states and be potentially harmful.
the `db_write` hook to make sure to always have a backup that is not missing any
state updates and is not potentially harmful.
## Installation
There are some python dependencies. You can install them using `pip`:
There are some Python dependencies. You can install them using `pip3`:
```bash
pip3 install --user -r requirements.txt
@@ -18,25 +18,24 @@ pip3 install --user -r requirements.txt
## Setup
Before using the backup pluging it has to be initialized once. The following
command will create a `backup.lock` file lightning directoy that stores the
internal state and makes sure that not two or more instances are using the same
backup.
Before the backup plugin can be used it has to be initialized once. The following
command will create a `backup.lock` in the lightning directory that stores the
internal state, and which makes sure no instances are using the same backup.
```bash
./backup-cli init ~/.lightning/bitcoin file:///mnt/external/location
```
Notes:
- Make sure to adjust your `~/.lightning/bitcoin` directory to your needs.
- Make sure to adjust the `~/.lightning/bitcoin` directory to your needs.
- You should use some non-local SSH or NFS mount as destination.
- Currently only `file:///` URL scheme is supported.
- Currently only the `file:///` URL scheme is supported.
## IMPORTANT note about hsm_secret
**You need to secure your nodes `~/.lightning/bitcoin/hsm_secret` once! This
file will not change, but without this file, you won't be able to use your
database backup!**
**You need to secure `~/.lightning/bitcoin/hsm_secret` once! This
file will not change, but without this file, the database backup will be
unusable!**
Make sure it has user read only permissions, otherwise `lightningd` will refuse
to work: `chmod 0400 hsm_secret`
@@ -46,15 +45,15 @@ to work: `chmod 0400 hsm_secret`
In order to tell `lightningd` to use the plugin you either need to tell it
via the startup option `--plugin /path/to/backup.py` or by placing it (or a
symlink to it) in the lightning dir's plugin directory (`~/.lightning/plugins`).
symlink to it) in the lightning plugin directory (`~/.lightning/plugins`).
On daemon startup the plugin will check for the integrity of last prior backup
and complain if theres a mismatch.
On daemon startup the plugin will check the integrity of the existing backup
and complain if there is a version mismatch.
## Restoring a backup
If things really messed up and you reinstall clightning on a new host, you can
If things really messed up and you need to reinstall clightning, you can
restore the database backup by using the `backup-cli` utility:
```bash