Sauvegarde et récupération

From PlebNet Wiki
Revision as of 15:53, 3 November 2021 by ADssx (talk | contribs) (Created page with "Sauvegarde et récupération")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Other languages:
English • ‎español • ‎français

Gérer un node Lightning est risqué et il est possible de perdre vos fonds. Néanmoins, les étapes ci-dessous vous permettent de drastiquement réduire cette possibilité.

Sauvegarde des canaux

Static Channel Backups (SCB)

LND peut générer un fichier de sauvegarde de vos canaux en utilisant la méthode "Static Channel Backups" (SCB). Au lieu d'essayer de maintenir l'état du canal le plus récent, la méthode SCB tente de notifier vos pairs afin qu'ils forcent la fermeture du canal (force close). Ceci empêche des utilisateurs de diffuser accidentellement un ancien état et cela leur permet de fermer le canal et de recevoir leur solde local (local balance). Quand vous utilisez un SCB vous recevez vos fonds assez rapidement dans la mesure où le verrouillage temporel (time-lock) pour les fermetures forcées (force closures) s'applique seulement aux pairs qui initient la fermeture forcée et non à l'autre pair.

Un fichier SCB est mis à jour dès qu'un canal est ouvert ou fermé. Les information sur le canal sont ajoutées au SCB à l'ouverture du canal et sont supprimées du SCB lors de sa fermeture.

IMPORTANT : Les SCB ne rétablissent pas votre nœud à son état normal. Les SCB servent uniquement à récupérer tous les fonds de votre portefeuille on-chain et le solde local de vos canaux (off-chain).

Comment obtenir un SCB ?

Il y a différentes manières d'obtenir un SCB.

  • Using the BoS Telegram bot (recommended): Umbrel - Installing BoS
  • Umbrel users: Can contact Umbrel for receiving your SCB if your node goes down.
  • Non-Umbrel users: Using ThunderHub, there is an option to download the latest backup from the tools option.
  • Using lncli: lncli exportchanbackup

BOS Telegram is a recommended way because it automatically sends you an SCB file every time a channel is opened/closed. The other methods are manual processes and there is a risk of not maintaining the latest backup.

Recovery

Shit happens! If your node ever goes down and you can't bring it back up again:

You still have access to your node

You will need your 24-word cipher seed and the SCB. Follow these instructions: https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md#recovering-using-scbs (Use lncli restorechanbackup)

You don't have access to your node

In this scenario, for example, if your node has been destroyed in a nuclear attack, you will need to start a new node to recover funds.

You will need your 24-word cipher seed and the SCB. You can set up a new node in Neutrino mode to save time. Neutrino is a lightweight client that allows you to run an LN node without Bitcoin Core. You can create a new Neutrino node by following these instructions by Alex Bosworth: https://github.com/alexbosworth/ln-service These instructions are for creating a node on AWS EC2, however, you can create one on your laptop/desktop or on a Raspberry Pi. After you start a new node on Neutrino, you can follow the same recovery instructions: https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md#recovering-using-scbs (use lncli create -multi_file=channel.backup) Note: Replace channel.backup with the name of your backup file.

ALL HOPE IS LOST (No SCB)

If you don't have an SCB and all you have is your 24-word cipher seed, there is a possibility to recover your funds (no promises). First, contact all your peers and ask them to force close on you manually. After the force closure is confirmed, follow these instructions: https://github.com/guggero/chantools/blob/master/doc/chantools_genimportscript.md

Exception scenarios

Node goes down during an in-flight HTLC

If there was a payment that was in-flight that was being routed through your node or payment you were making and your node goes down and does not come back up, sorry, there is no way to recover funds that are stuck in the HTLC as of now but you can recover all the other on-chain and off-chain funds. This is probably a very extreme scenario.

You initiated a force closure, funds are still stuck in time-lock

If you initiate a force closure, the funds are locked for a certain number of blocks. If the node goes down during the time-lock period of a force closure initiated by you, unfortunately, LND has a bug today which removes the channel details from the latest SCB before the time-lock expires. The way to recover these funds would be to use an older SCB that you might have before the channel details were removed and use it start the recovery as shown in the previous steps and you will receive your funds back to your on-chain wallet after the time-lock expires. BOS Telegram bot can be a real savior in this scenario because the chat history with the bot will have older SCBs that you can use to recover funds. Lightning Labs say they will be fixing this in 0.14.0-beta. If you don't have an older SCB, unfortunately, there is no other way as of today to recover those funds, this also is an extreme scenario.