layout | title | parent | nav_order | has_toc |
---|---|---|---|---|
default |
Static Channel Backups |
Bonus Section |
45 |
false |
Difficulty: easy
Since lnd V0.6, Static Channel Backups (SCB) is supported. In a nutshell, every time a channel changes, lnd writes a new copy of the channels.backup file. For more details, see v0.6-beta Release Notes This guide explains one way to automatically upload the channels.backup file on changes, to your Dropbox The following scripts were created by Vindard
The channels.backup file is encrypted so that it is safe to transmit over the Internet and to store on (e.g.) a cloud server.
In your web browser, do the following:
-
Go to https://www.dropbox.com/developers/apps/create and sign in
-
Choose Dropbox Api
-
Choose App Folder
-
Name your app and click Create App to proceed
-
On the settings page for your new app, scroll down to OAuth 2 and click Generate
-
You will now see a string of letters and numbers appear. This is your Api Token. Copy this token and keep it safe for the next steps. This api token will be referenced as
<dropbox-api-token>
in the next step.
As user "admin", download the script, make it executable and move to the global bin folder.
$ cd /home/admin/download/
$ wget https://gist.githubusercontent.com/vindard/e0cd3d41bb403a823f3b5002488e3f90/raw/4bcf3c0163f77443a6f7c00caae0750b1fa0d63d/lnd-channel-backup.sh
# check script & modify with your <dropbox-api-token> (third line)
$ sudo nano lnd-channel-backup.sh
$ sudo chmod +x lnd-channel-backup.sh
$ sudo mv lnd-channel-backup.sh /usr/local/bin
$ sudo nano /etc/systemd/system/backup-channels.service
[Service]
ExecStart=/usr/local/bin/lnd-channel-backup.sh
Restart=always
RestartSec=1
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=backup-channels
User=root
Group=root
[Install]
WantedBy=multi-user.target
Start
$ sudo systemctl start backup-channels
Monitor
$ journalctl -fu backup-channels
Run at boot
$ sudo systemctl enable backup-channels
You will now cause the channel.backup to change and see if the copy gets uploaded to your webserver.
$ sudo touch /home/bitcoin/.lnd/data/chain/bitcoin/mainnet/channel.backup
Logon to your dropbox and see if you have a new file.
<< Back: Bonus guides