diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 0c30636..6d043be 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -15,4 +15,5 @@ - [LNURL-Auth](guide/lnurl_auth.md) - [Supporting fiat currencies](guide/fiat_currencies.md) - [Buy Bitcoin](guide/buy_btc.md) +- [Static Channel Backup](guide/static_channel_backup.md) - [Moving to production](guide/production.md) diff --git a/src/guide/static_channel_backup.md b/src/guide/static_channel_backup.md new file mode 100644 index 0000000..f4c117b --- /dev/null +++ b/src/guide/static_channel_backup.md @@ -0,0 +1,109 @@ +# Static Channel Backup + +A static channel backup is automatically saved by the Breez SDK in the background. More specifically, the static backup is updated +each time a new channel is opened. + +If the Greenlight node is not available, you can retrieve the static channel backup from the SDK's working directory as follows: + + +
Rust
+
+ +```rust,ignore +let backup_data = BreezServices::static_backup(StaticBackupRequest { + working_dir: "".into(), +})?; +``` + +
+ +
Swift
+
+ +```swift +do { + let backupData = breez_sdk.staticBackup(workingDir: ""); +} catch{ + // handle error +} +``` + +
+ +
Android
+
+ +```kotlin,ignore +try { + val backupData = staticBackup("") +} catch (e: Exception) { + // handle error +} +``` + +
+ +
React Native
+
+ +```typescript +try { + let backupData = await staticBackup(""); +} catch (error) { + console.log(error) +} +``` + +
+ +
Dart
+
+ +```dart +try { + StaticBackupResponse backupData = await staticBackup(workingDir: ""); +} catch (error) { + // handle error +} +``` +
+ +
Python
+
+ +```python +try: + backup_data = breez_sdk.static_backup("") +except Exception as error: + # Handle error +``` +
+ +
Go
+
+ +```go +backupData, err := breez_sdk.StaticBackup("") +if err != nil { + log.Fatalf("Failed to retrieve static backup data: %#v", err) +} +``` +
+ +
C#
+
+ +```cs +using Breez.Sdk; + +StaticBackupResponse backupData; +try +{ + backupData = BreezSdkMethods.StaticBackup(""); +} catch (Exception) +{ + // Handle error +} +``` +
+