Skip to content

Commit

Permalink
Adding an article to FAQ-LightningNetwork.md
Browse files Browse the repository at this point in the history
 Date:      Thu Feb 20 22:36:10 2020 +0300
 Committer: bereska <[email protected]>

 Changes to be committed:
	modified:   FAQ/FAQ-LightningNetwork.md#
  • Loading branch information
bereska authored and bereska committed Feb 20, 2020
1 parent 7c2c627 commit cf792e1
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions FAQ/FAQ-LightningNetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,59 @@ cd btcpayserver-docker
export LIGHTNING_ALIAS="namehere"
. ./btcpay-setup.sh -i
```
### How to back up LND channels offsite
https://github.com/btcpayserver/btcpayserver-doc/blob/master/FAQ/readme.md
Currently your BTCPay Server Docker on every change in channels state saves static channels backup (SCB) locally on the same disk (on-site). This poses a threat to LN off-chain funds recovery in case of the server crash or fatal data loss.
IMPORTANT: to recover your LN on-chain and off-chain funds you need two things: LN wallet seed and SCB.
Every time a change is made to channel.backup file in your BTCPay Server docker it will instantly be copied to your remotes.
The following procedure will allow you to keep the latest SCB offsite (on a remote server and/or popular cloud):
NOTE: this has been tested on Linux systems only.

1. Ssh into your BTCPay Server and run ```lnd-channels-backup-dependencies.sh``` script.

```bash
sudo su -
cd btcpayserver-docker
./lnd-channels-backup-dependencies.sh
```

2. Copy your btcpayserver ssh key to your remote server and create btcpayserver directory there. Replace USER_NAME and IP wihth remote server credentials.

```bash
cat /root/.ssh/id_ed25519_btcpayserver | ssh USER_NAME@IP "mkdir ~/btcpayserver ~/.ssh; cat >> ~/.ssh/authorized_keys"
```

3. Configure rclone for a cloud storage of your choice and note your newly configured remote name. You will need it for the next step.
Please refer to this guide https://rclone.org/docs/

4. edit ```lnd-channels-remote-backup-on-change.sh``` script to add your remote server credentials and configured rclone remote from step 2 & 3.

```bash
nano lnd-channels-remote-backup-on-change.sh
```
Edit these two lines:

```
remote_server1="YOUR_REMOTE_SERVER_USER_NAME@YOUR_REMOTE_SERVER_IP:~/btcpayserver/"
cloud1="YOUR_RCLONE_REMOTE:btcpayserver/"
```

5. Run ```lnd-channels-backup-systemd.sh``` script to finally set it up on your system.

```bash
./lnd-channels-backup-systemd.sh
```

6. Test it

```bash
touch /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/data/chain/bitcoin/mainnet/channel.backup
```

Ssh into your remote server and log into your cloud to see the latest SCB (channel.backup file in ~/btcpayserver).

Now you have your latest SCB off-site!


## Lightning Network (c-lightning) FAQ

Expand Down

0 comments on commit cf792e1

Please sign in to comment.