From e9a9cd78d5235c07e00c0672cb0fc0ef06db3e18 Mon Sep 17 00:00:00 2001 From: Chris Guida Date: Thu, 26 Sep 2024 12:27:44 -0600 Subject: [PATCH] wip debugging --- Cargo.lock | 25 ++++++++++++------------- Cargo.toml | 6 ++++-- src/main.rs | 3 +++ src/wallet.rs | 1 + 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48fb625..6f383f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,7 +317,6 @@ checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "cln-plugin" version = "0.1.6" -source = "git+https://github.com/elementsproject/lightning#b135ba2224da4e7fc6f6ac899bc6917cb71ba0dc" dependencies = [ "anyhow", "bytes", @@ -553,9 +552,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -999,9 +998,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1009,9 +1008,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -1024,9 +1023,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1034,9 +1033,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -1047,9 +1046,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index 8eca6d2..0876f54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0" +# async-std = { version = "1", features = ["attributes", "tokio1"] } base64 = "0.21.2" # bdk = "0.27.1" # bdk = { version = "0.29", default-features=false, features = ["std", "key-value-db","async-interface", "use-esplora-async", "rpc"] } @@ -26,8 +27,8 @@ bdk_file_store = { git = "https://github.com/chrisguida/bdk", rev = "cc32e69a12b # bitcoincore-rpc = { path = "../rust-bitcoincore-rpc/client" } bitcoincore-rpc = { git = "https://github.com/chrisguida/rust-bitcoincore-rpc", branch = "feat/scanblocks" } clap = { version = "4.4.0", features = ["derive"] } -cln-plugin = { git = "https://github.com/elementsproject/lightning", version = "0.1.4" } -# cln-plugin = { path = "../../lightning/plugins" } +# cln-plugin = { git = "https://github.com/elementsproject/lightning", version = "0.1.6" } +cln-plugin = { path = "../lightning/plugins" } # cln-plugin = { git = "https://github.com/chrisguida/lightning", version = "0.1.4", branch = "feat/cln-plugin-send-notifs" } cln-rpc = "0.1.3" home = "0.5.5" @@ -38,3 +39,4 @@ serde_json = "1.0.72" [dependencies.tokio] features = ["net", "rt-multi-thread"] version = "1" +#path = "../tokio/tokio" diff --git a/src/main.rs b/src/main.rs index 8bed6aa..dbe9c34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,12 +67,15 @@ async fn main() -> Result<(), anyhow::Error> { parse_command, ) .subscribe("block_added", block_added_handler) + // .with_logging(true) .dynamic(); let configured_plugin = if let Some(cp) = builder.configure().await? { cp } else { return Ok(()); }; + // log::info!("CLN_PLUGIN_LOG = {}", std::env::var("CLN_PLUGIN_LOG")?); + // log::info!("RUST_LOG = {}", std::env::var("RUST_LOG")?); log::debug!( "Configuration from CLN main daemon: {:?}", configured_plugin.configuration() diff --git a/src/wallet.rs b/src/wallet.rs index f077e89..b3eefe5 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -109,6 +109,7 @@ pub fn parse_network(network: &Option) -> Result { } fn parse_currency(network: &Option) -> Result { + log::info!("parsing network {:?} to currency", network); Ok(get_currency(parse_network(network)?)) }