Merge pull request #104 from breez/savage-service-status

Update 0.2.10 & add service status page
This commit is contained in:
Roei Erez
2023-11-27 17:27:25 +02:00
committed by GitHub
20 changed files with 379 additions and 42 deletions

View File

@@ -458,8 +458,8 @@ dependencies = [
[[package]]
name = "breez-sdk-core"
version = "0.2.9"
source = "git+https://github.com/breez/breez-sdk?tag=0.2.9#82fdc4f7d2de354fc299cc4fbf8691492d4bc642"
version = "0.2.10"
source = "git+https://github.com/breez/breez-sdk?tag=0.2.10#d18529988eb7b1038473161e44c88225c7a0236d"
dependencies = [
"aes",
"anyhow",
@@ -605,9 +605,8 @@ dependencies = [
[[package]]
name = "cln-grpc"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57af6eff15ee3fd7a0e09d0baeab8d33c892a73d97b87248e5f94f4749eacfe1"
version = "0.1.7"
source = "git+https://github.com/cdecker/lightning.git?tag=gl-20231113#075927b2c5f38fdbde4c0764135be58340b0ce08"
dependencies = [
"anyhow",
"bitcoin 0.30.1",
@@ -1132,7 +1131,7 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
[[package]]
name = "gl-client"
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 = [
"anyhow",
"async-trait",
@@ -1160,7 +1159,6 @@ dependencies = [
"serde",
"serde_bolt 0.2.6",
"serde_json",
"serde_with 2.3.3",
"sha256",
"tempfile",
"thiserror",
@@ -2583,7 +2581,6 @@ dependencies = [
"base64 0.13.1",
"chrono",
"hex",
"indexmap 1.9.3",
"serde",
"serde_json",
"serde_with_macros 2.3.3",

View File

@@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
anyhow = "1"
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"
tokio = "1.29"

View File

@@ -11,6 +11,7 @@ mod receive_payment;
mod send_onchain;
mod send_payment;
mod send_spontaneous_payment;
mod service_status;
mod static_channel_backup;
use anyhow::Result;

View 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(())
}