mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
Merge pull request #104 from breez/savage-service-status
Update 0.2.10 & add service status page
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -25,8 +25,8 @@ jobs:
|
|||||||
name: setup
|
name: setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
sdk-ref: ${{ inputs.sdk-ref || '0.2.9' }}
|
sdk-ref: ${{ inputs.sdk-ref || '0.2.10' }}
|
||||||
package-version: '0.2.9'
|
package-version: '0.2.10'
|
||||||
steps:
|
steps:
|
||||||
- run: echo "set pre-setup output variables"
|
- run: echo "set pre-setup output variables"
|
||||||
|
|
||||||
|
|||||||
36
snippets/csharp/ServiceStatus.cs
Normal file
36
snippets/csharp/ServiceStatus.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using Breez.Sdk;
|
||||||
|
|
||||||
|
public class ServiceStatusSnippets
|
||||||
|
{
|
||||||
|
public void HealthCheckStatus(BlockingBreezServices sdk)
|
||||||
|
{
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var healthCheck = sdk.ServiceHealthCheck();
|
||||||
|
Console.WriteLine($"Current service status is: {healthCheck.status}");
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// Handle error
|
||||||
|
}
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReportPaymentFailure(BlockingBreezServices sdk)
|
||||||
|
{
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
var paymentHash = "...";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sdk.ReportIssue(new ReportIssueRequest.PaymentFailure(
|
||||||
|
new ReportPaymentFailureDetails(paymentHash)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// Handle error
|
||||||
|
}
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
|
}
|
||||||
18
snippets/dart_snippets/lib/service_status.dart
Normal file
18
snippets/dart_snippets/lib/service_status.dart
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import 'package:breez_sdk/breez_sdk.dart';
|
||||||
|
import 'package:breez_sdk/bridge_generated.dart';
|
||||||
|
|
||||||
|
Future<void> healthCheckStatus() async {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
ServiceHealthCheckResponse healthCheck = await BreezSDK().serviceHealthCheck();
|
||||||
|
print("Current service status is: ${healthCheck.status}");
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> reportPaymentFailure() async {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
String paymentHash = "...";
|
||||||
|
await BreezSDK().reportIssue(
|
||||||
|
req: ReportIssueRequest.paymentFailure(
|
||||||
|
data: ReportPaymentFailureDetails(paymentHash: paymentHash)));
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
@@ -52,12 +52,10 @@ packages:
|
|||||||
breez_sdk:
|
breez_sdk:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "packages/breez-sdk-flutter"
|
||||||
ref: HEAD
|
relative: true
|
||||||
resolved-ref: "9629def110a9dd03413850a05e9709d3c9794b0d"
|
source: path
|
||||||
url: "https://github.com/breez/breez-sdk-flutter"
|
version: "0.2.10"
|
||||||
source: git
|
|
||||||
version: "0.2.9"
|
|
||||||
build:
|
build:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -106,14 +104,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.2"
|
version: "1.17.2"
|
||||||
colorize:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: colorize
|
|
||||||
sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -171,10 +161,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_rust_bridge
|
name: flutter_rust_bridge
|
||||||
sha256: "8dcfeff9dcf0db9c76578c8805a337c0e5e21b4d96887eb1007b6fe141e15ea9"
|
sha256: ff90d5ddd0cda6d94ed048cc9c4a4d993d1a4bb11605d60a1282fc1bbf173c77
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.75.2"
|
version: "1.80.1"
|
||||||
freezed:
|
freezed:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -331,10 +321,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
|
sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.4.0"
|
version: "6.0.1"
|
||||||
pointycastle:
|
pointycastle:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -371,10 +361,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: puppeteer
|
name: puppeteer
|
||||||
sha256: dd49117259867d0ce0de33ddd95628fb70cff94581a6432c08272447b8dd1d27
|
sha256: eedeaae6ec5d2e54f9ae22ab4d6b3dda2e8791c356cc783046d06c287ffe11d8
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.24.0"
|
version: "3.6.0"
|
||||||
rxdart:
|
rxdart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -589,5 +579,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.1.0-185.0.dev <4.0.0"
|
dart: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.12"
|
flutter: ">=3.10.0"
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ module main
|
|||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require github.com/breez/breez-sdk-go v0.2.9
|
require github.com/breez/breez-sdk-go v0.2.10
|
||||||
|
|
||||||
replace github.com/breez/breez-sdk-go => ./packages/breez-sdk-go
|
replace github.com/breez/breez-sdk-go => ./packages/breez-sdk-go
|
||||||
|
|||||||
29
snippets/go/service_status.go
Normal file
29
snippets/go/service_status.go
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/breez/breez-sdk-go/breez_sdk"
|
||||||
|
)
|
||||||
|
|
||||||
|
func HealthCheckStatus() {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
if healthCheck, err := sdk.ServiceHealthCheck(); err != nil {
|
||||||
|
log.Printf("Current service status is: %v", healthCheck.Status)
|
||||||
|
}
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
}
|
||||||
|
|
||||||
|
func ReportPaymentFailure() {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
paymentHash := "..."
|
||||||
|
reportIssueRequest := breez_sdk.ReportIssueRequestPaymentFailure{
|
||||||
|
Data: breez_sdk.ReportPaymentFailureDetails{
|
||||||
|
PaymentHash: paymentHash,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if err := sdk.ReportIssue(reportIssueRequest); err != nil {
|
||||||
|
log.Printf("%#v", err)
|
||||||
|
}
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
@@ -34,7 +34,7 @@ kotlin {
|
|||||||
}
|
}
|
||||||
val commonMain by getting {
|
val commonMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("technology.breez:breez-sdk-kmp:0.2.9")
|
implementation("technology.breez:breez-sdk-kmp:0.2.10")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.example.kotlinmpplib
|
||||||
|
|
||||||
|
import breez_sdk.*
|
||||||
|
class ServiceStatus {
|
||||||
|
fun HealthCheckStatus(sdk: BlockingBreezServices) {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
try {
|
||||||
|
val healthCheck = sdk.serviceHealthCheck()
|
||||||
|
// Log.v("Breez", "Current service status is: ${healthCheck.status}")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// Handle error
|
||||||
|
}
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
}
|
||||||
|
|
||||||
|
fun reportPaymentFailure(sdk: BlockingBreezServices) {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
val paymentHash = "..."
|
||||||
|
try {
|
||||||
|
sdk.reportIssue(ReportIssueRequest.PaymentFailure(
|
||||||
|
ReportPaymentFailureDetails(paymentHash)))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
// Handle error
|
||||||
|
}
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
|
}
|
||||||
23
snippets/python/src/service_status.py
Normal file
23
snippets/python/src/service_status.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import breez_sdk
|
||||||
|
|
||||||
|
def health_check_status(sdk_services):
|
||||||
|
try:
|
||||||
|
# ANCHOR: health-check-status
|
||||||
|
health_check = sdk_services.service_health_check()
|
||||||
|
print("Current service status is: ", health_check.status)
|
||||||
|
# ANCHOR_END: health-check-status
|
||||||
|
except Exception as error:
|
||||||
|
print(error)
|
||||||
|
raise
|
||||||
|
|
||||||
|
def report_payment_failure(sdk_services):
|
||||||
|
try:
|
||||||
|
# ANCHOR: report-payment-failure
|
||||||
|
payment_hash = "..."
|
||||||
|
sdk_services.report_issue(
|
||||||
|
breez_sdk.ReportIssueRequest.PAYMENT_FAILURE(
|
||||||
|
breez_sdk.ReportPaymentFailureDetails(payment_hash)))
|
||||||
|
# ANCHOR_END: report-payment-failure
|
||||||
|
except Exception as error:
|
||||||
|
print(error)
|
||||||
|
raise
|
||||||
18
snippets/react-native/service_status.ts
Normal file
18
snippets/react-native/service_status.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { serviceHealthCheck, reportIssue, ReportIssueRequestVariant } from '@breeztech/react-native-breez-sdk'
|
||||||
|
|
||||||
|
const healthCheckStatus = async () => {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
const healthCheck = await serviceHealthCheck()
|
||||||
|
console.log(`Current service status is: ${healthCheck.status}`)
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
}
|
||||||
|
|
||||||
|
const reportPaymentFailure = async () => {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
const paymentHash = '...'
|
||||||
|
await reportIssue({
|
||||||
|
type: ReportIssueRequestVariant.PAYMENT_FAILURE,
|
||||||
|
data: { paymentHash }
|
||||||
|
})
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
@@ -714,10 +714,10 @@
|
|||||||
"@babel/helper-validator-identifier" "^7.22.20"
|
"@babel/helper-validator-identifier" "^7.22.20"
|
||||||
to-fast-properties "^2.0.0"
|
to-fast-properties "^2.0.0"
|
||||||
|
|
||||||
"@breeztech/react-native-breez-sdk@0.2.9":
|
"@breeztech/react-native-breez-sdk@0.2.10":
|
||||||
version "0.2.9"
|
version "0.2.10"
|
||||||
resolved "https://registry.yarnpkg.com/@breeztech/react-native-breez-sdk/-/react-native-breez-sdk-0.2.9.tgz#e1bcd37f16b92ac5792fedf7c4afa481322dac80"
|
resolved "https://registry.yarnpkg.com/@breeztech/react-native-breez-sdk/-/react-native-breez-sdk-0.2.10.tgz#072b00f57028b5276c600a462cbcaac93d3dee22"
|
||||||
integrity sha512-4mziuxCa8hpDGtMFD4VWK7tj+z3F/48x5NsKwxIYMkfLxxYP+6ZvD0ucEbyqr3P0Lwn0Cj4/iCnwM2gIL8UFcw==
|
integrity sha512-81wtbkKGxhDaIweIQkD+LLDUL7WTtbI3qEb9vx4Itiu1hGzM8Q2RlYNF5R1jh2m4wdYKUKMWSBd3O4VRnywf1Q==
|
||||||
|
|
||||||
"@esbuild/android-arm64@0.18.20":
|
"@esbuild/android-arm64@0.18.20":
|
||||||
version "0.18.20"
|
version "0.18.20"
|
||||||
|
|||||||
13
snippets/rust/Cargo.lock
generated
13
snippets/rust/Cargo.lock
generated
@@ -458,8 +458,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "breez-sdk-core"
|
name = "breez-sdk-core"
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
source = "git+https://github.com/breez/breez-sdk?tag=0.2.9#82fdc4f7d2de354fc299cc4fbf8691492d4bc642"
|
source = "git+https://github.com/breez/breez-sdk?tag=0.2.10#d18529988eb7b1038473161e44c88225c7a0236d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -605,9 +605,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cln-grpc"
|
name = "cln-grpc"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/cdecker/lightning.git?tag=gl-20231113#075927b2c5f38fdbde4c0764135be58340b0ce08"
|
||||||
checksum = "57af6eff15ee3fd7a0e09d0baeab8d33c892a73d97b87248e5f94f4749eacfe1"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bitcoin 0.30.1",
|
"bitcoin 0.30.1",
|
||||||
@@ -1132,7 +1131,7 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gl-client"
|
name = "gl-client"
|
||||||
version = "0.1.9"
|
version = "0.1.9"
|
||||||
source = "git+https://github.com/Blockstream/greenlight.git?rev=c7ff67eb062c021105f5601df3ac8699ecbeb51c#c7ff67eb062c021105f5601df3ac8699ecbeb51c"
|
source = "git+https://github.com/Blockstream/greenlight.git?rev=84a66ac3c467569365285814ef5a691b5b97f60d#84a66ac3c467569365285814ef5a691b5b97f60d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -1160,7 +1159,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_bolt 0.2.6",
|
"serde_bolt 0.2.6",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with 2.3.3",
|
|
||||||
"sha256",
|
"sha256",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -2583,7 +2581,6 @@ dependencies = [
|
|||||||
"base64 0.13.1",
|
"base64 0.13.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
"hex",
|
"hex",
|
||||||
"indexmap 1.9.3",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with_macros 2.3.3",
|
"serde_with_macros 2.3.3",
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
bip39 = { version = "2", features = ["rand"] }
|
bip39 = { version = "2", features = ["rand"] }
|
||||||
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.2.9" }
|
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.2.10" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
tokio = "1.29"
|
tokio = "1.29"
|
||||||
@@ -11,6 +11,7 @@ mod receive_payment;
|
|||||||
mod send_onchain;
|
mod send_onchain;
|
||||||
mod send_payment;
|
mod send_payment;
|
||||||
mod send_spontaneous_payment;
|
mod send_spontaneous_payment;
|
||||||
|
mod service_status;
|
||||||
mod static_channel_backup;
|
mod static_channel_backup;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|||||||
30
snippets/rust/src/service_status.rs
Normal file
30
snippets/rust/src/service_status.rs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
use breez_sdk_core::*;
|
||||||
|
use log::info;
|
||||||
|
|
||||||
|
async fn health_check_status(sdk: Arc<BreezServices>) -> Result<()> {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
let health_check = sdk.service_health_check().await?;
|
||||||
|
info!("Current service status is: {:?}", health_check.status);
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn report_payment_failure(sdk: Arc<BreezServices>) -> Result<()> {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
let payment_hash = String::from("...");
|
||||||
|
|
||||||
|
sdk.report_issue(ReportIssueRequest::PaymentFailure {
|
||||||
|
data: ReportPaymentFailureDetails {
|
||||||
|
payment_hash,
|
||||||
|
comment: None,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/breez/breez-sdk-swift",
|
"location" : "https://github.com/breez/breez-sdk-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "dcbb39d45bc6797447bf20f52bc22344026d0662",
|
"revision" : "74402afba8218ff84a0f32d1bc0d4ddc7698f576",
|
||||||
"version" : "0.2.9"
|
"version" : "0.2.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ let package = Package(
|
|||||||
platforms: [.macOS(.v12)],
|
platforms: [.macOS(.v12)],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.3"),
|
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.3"),
|
||||||
.package(url: "https://github.com/breez/breez-sdk-swift", from:"0.2.9")
|
.package(url: "https://github.com/breez/breez-sdk-swift", from:"0.2.10")
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
||||||
|
|||||||
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal file
27
snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
//
|
||||||
|
// ServiceStatus.swift
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Created by dangeross on 27/11/2023.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import BreezSDK
|
||||||
|
|
||||||
|
func getServiceStatus(sdk: BlockingBreezServices) -> ServiceHealthCheckResponse? {
|
||||||
|
// ANCHOR: health-check-status
|
||||||
|
let healthCheck = try? sdk.serviceHealthCheck()
|
||||||
|
print("Current service status is: \(healthCheck?.status)")
|
||||||
|
// ANCHOR_END: health-check-status
|
||||||
|
return healthCheck
|
||||||
|
}
|
||||||
|
|
||||||
|
func reportPaymentFailure(sdk: BlockingBreezServices) {
|
||||||
|
// ANCHOR: report-payment-failure
|
||||||
|
let paymentHash = "..."
|
||||||
|
|
||||||
|
try? sdk.reportIssue(
|
||||||
|
req: ReportIssueRequest.paymentFailure(
|
||||||
|
data: ReportPaymentFailureDetails(paymentHash: paymentHash)))
|
||||||
|
// ANCHOR_END: report-payment-failure
|
||||||
|
}
|
||||||
@@ -20,4 +20,5 @@
|
|||||||
- [Supporting fiat currencies](guide/fiat_currencies.md)
|
- [Supporting fiat currencies](guide/fiat_currencies.md)
|
||||||
- [Buy Bitcoin](guide/buy_btc.md)
|
- [Buy Bitcoin](guide/buy_btc.md)
|
||||||
- [Static Channel Backup](guide/static_channel_backup.md)
|
- [Static Channel Backup](guide/static_channel_backup.md)
|
||||||
|
- [Service status](guide/service_status.md)
|
||||||
- [Moving to production](guide/production.md)
|
- [Moving to production](guide/production.md)
|
||||||
|
|||||||
140
src/guide/service_status.md
Normal file
140
src/guide/service_status.md
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
# Health Check Status
|
||||||
|
|
||||||
|
You can check the general health status of the services provided by the Breez SDK.
|
||||||
|
The response status will inform you if there is maintenance occurring, a service distruption or the services are operational.
|
||||||
|
|
||||||
|
<custom-tabs category="lang">
|
||||||
|
<div slot="title">Rust</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```rust,ignore
|
||||||
|
{{#include ../../snippets/rust/src/service_status.rs:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Swift</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```swift,ignore
|
||||||
|
{{#include ../../snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Kotlin</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```kotlin,ignore
|
||||||
|
{{#include ../../snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ServiceStatus.kt:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">React Native</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
{{#include ../../snippets/react-native/service_status.ts:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Dart</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```dart,ignore
|
||||||
|
{{#include ../../snippets/dart_snippets/lib/service_status.dart:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Python</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```python,ignore
|
||||||
|
{{#include ../../snippets/python/src/service_status.py:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Go</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```go,ignore
|
||||||
|
{{#include ../../snippets/go/service_status.go:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">C#</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```cs,ignore
|
||||||
|
{{#include ../../snippets/csharp/ServiceStatus.cs:health-check-status}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
</custom-tabs>
|
||||||
|
|
||||||
|
# Reporting a Payment Failure
|
||||||
|
|
||||||
|
While attempting to send payments it may be that sometimes payment failures occur. Reporting these issues through the Breez SDK will help us to improve LSP routing.
|
||||||
|
|
||||||
|
<custom-tabs category="lang">
|
||||||
|
<div slot="title">Rust</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```rust,ignore
|
||||||
|
{{#include ../../snippets/rust/src/service_status.rs:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Swift</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```swift,ignore
|
||||||
|
{{#include ../../snippets/swift/BreezSDKExamples/Sources/ServiceStatus.swift:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Kotlin</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```kotlin,ignore
|
||||||
|
{{#include ../../snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/ServiceStatus.kt:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">React Native</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
{{#include ../../snippets/react-native/service_status.ts:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Dart</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```dart,ignore
|
||||||
|
{{#include ../../snippets/dart_snippets/lib/service_status.dart:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Python</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```python,ignore
|
||||||
|
{{#include ../../snippets/python/src/service_status.py:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">Go</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```go,ignore
|
||||||
|
{{#include ../../snippets/go/service_status.go:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div slot="title">C#</div>
|
||||||
|
<section>
|
||||||
|
|
||||||
|
```cs,ignore
|
||||||
|
{{#include ../../snippets/csharp/ServiceStatus.cs:report-payment-failure}}
|
||||||
|
```
|
||||||
|
</section>
|
||||||
|
</custom-tabs>
|
||||||
Reference in New Issue
Block a user