diff --git a/Cargo.lock b/Cargo.lock index 54ef9f0c1..3c256f022 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,28 +94,6 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-trait" -version = "0.1.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "autocfg" version = "1.2.0" @@ -155,15 +133,6 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -191,15 +160,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "bumpalo" version = "3.15.4" @@ -276,15 +236,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "concurrent-queue" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "const-random" version = "0.1.18" @@ -321,21 +272,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - [[package]] name = "crunchy" version = "0.2.2" @@ -372,15 +308,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "dirs-next" version = "2.0.0" @@ -432,27 +359,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener", - "pin-project-lite", -] - [[package]] name = "fancy-regex" version = "0.11.0" @@ -494,20 +400,6 @@ dependencies = [ "num", ] -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.30" @@ -515,7 +407,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -542,26 +433,14 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" -dependencies = [ - "gloo-timers", - "send_wrapper", -] - [[package]] name = "futures-util" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ - "futures-channel", "futures-core", "futures-io", - "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -569,16 +448,6 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.12" @@ -598,52 +467,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "gloo-net" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils", - "http", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "gloo-utils" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" -dependencies = [ - "js-sys", - "serde", - "serde_json", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "h2" version = "0.3.25" @@ -745,22 +568,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "log", - "rustls 0.21.10", - "rustls-native-certs 0.6.3", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "idna" version = "0.5.0" @@ -833,123 +640,14 @@ dependencies = [ ] [[package]] -name = "jsonrpsee" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cdbb7cb6f3ba28f5b212dd250ab4483105efc3e381f5c8bb90340f14f0a2cc3" -dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", - "jsonrpsee-types", - "jsonrpsee-wasm-client", - "jsonrpsee-ws-client", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab2e14e727d2faf388c99d9ca5210566ed3b044f07d92c29c3611718d178380" -dependencies = [ - "futures-channel", - "futures-util", - "gloo-net", - "http", - "jsonrpsee-core", - "pin-project", - "rustls-native-certs 0.7.0", - "rustls-pki-types", - "soketto", - "thiserror", - "tokio", - "tokio-rustls 0.25.0", - "tokio-util", - "tracing", - "url", - "webpki-roots", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71962a1c49af43adf81d337e4ebc93f3c915faf6eccaa14d74e255107dfd7723" -dependencies = [ - "anyhow", - "async-lock", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "hyper", - "jsonrpsee-types", - "pin-project", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "wasm-bindgen-futures", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.22.3" +name = "jsonrpc" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c13987da51270bda2c1c9b40c19be0fe9b225c7a0553963d8f17e683a50ce84" +checksum = "a26d9104d516092f092d97448787505881fdb6518293b2d6500bf9c180c839dd" dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "base64 0.13.1", "serde", "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e53c72de6cd2ad6ac1aa6e848206ef8b736f92ed02354959130373dfa5b3cbd" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "jsonrpsee-wasm-client" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae2c3f2411052b4a831cb7a34cd1498e0d8b9309bd49fca67567634ff64023d" -dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a07ab8da9a283b906f6735ddd17d3680158bb72259e853441d1dd0167079ec" -dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", - "url", ] [[package]] @@ -1165,16 +863,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" version = "0.32.2" @@ -1190,18 +878,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - [[package]] name = "ordered-multimap" version = "0.7.1" @@ -1212,12 +888,6 @@ dependencies = [ "hashbrown 0.14.3", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.12.1" @@ -1267,26 +937,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1480,21 +1130,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - [[package]] name = "rust-ini" version = "0.21.0" @@ -1512,109 +1147,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" -dependencies = [ - "log", - "ring", - "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.1.1", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" -dependencies = [ - "base64 0.21.7", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.14" @@ -1627,60 +1159,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - [[package]] name = "serde" version = "1.0.197" @@ -1724,19 +1208,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer", - "cfg-if", - "cpufeatures", - "digest", - "opaque-debug", -] - [[package]] name = "slab" version = "0.4.9" @@ -1762,39 +1233,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64 0.13.1", - "bytes", - "futures", - "httparse", - "log", - "rand", - "sha-1", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "strsim" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "2.0.55" @@ -1928,56 +1372,11 @@ dependencies = [ "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", - "tokio-macros", "windows-sys 0.48.0", ] -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.10", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.3", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.10" @@ -1986,34 +1385,12 @@ checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", "tracing", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -2026,23 +1403,10 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" version = "0.1.32" @@ -2064,12 +1428,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2097,12 +1455,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.5.0" @@ -2148,7 +1500,7 @@ dependencies = [ "anyhow", "base64 0.22.0", "clap", - "jsonrpsee", + "jsonrpc", "jsonschema", "petgraph", "petgraph-graphml", @@ -2158,7 +1510,6 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "tokio", "xmltree", ] @@ -2244,15 +1595,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2452,9 +1794,3 @@ dependencies = [ "quote", "syn", ] - -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 84a569c1b..5eb9cd34a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" anyhow = "1.0.81" base64 = "0.22.0" clap = { version = "4.5.4", features = ["derive"] } -jsonrpsee = { version = "0.22.3", features = ["http-client", "client"] } +jsonrpc = "0.17.0" jsonschema = "0.17.1" petgraph = "0.6.4" petgraph-graphml = "3.0.0" @@ -19,7 +19,6 @@ rand = "0.8.5" rust-ini = "0.21.0" serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.115" -tokio = { version = "1.36.0", features = ["rt-multi-thread"] } xmltree = { version = "0.10.3", features = ["indexmap"] } [[bin]] diff --git a/src/rust-cli/debug.rs b/src/rust-cli/debug.rs index 4fdbb0af0..6f693b2f5 100644 --- a/src/rust-cli/debug.rs +++ b/src/rust-cli/debug.rs @@ -1,5 +1,4 @@ -use anyhow::Context; -use jsonrpsee::core::params::ObjectParams; +use serde_json::{json, Value}; use std::path::PathBuf; use clap::Subcommand; @@ -15,18 +14,11 @@ pub enum DebugCommand { }, } -pub async fn handle_debug_command( - command: &DebugCommand, - mut rpc_params: ObjectParams, -) -> anyhow::Result<()> { +pub fn handle_debug_command(command: &DebugCommand, mut rpc_params: Value) -> anyhow::Result<()> { match command { DebugCommand::GenerateCompose { graph_file_path } => { - rpc_params - .insert("graph_file", graph_file_path.to_str()) - .context("Adding graph_file_path to rpc params")?; - let data = make_rpc_call("generate_compose", rpc_params) - .await - .context("Calling generate_compose RPC")?; + rpc_params["graph_file"] = json!(graph_file_path.to_str()); + let data = make_rpc_call("generate_compose", &rpc_params); println!("Docker-compose file generated: {:?}", data); } } diff --git a/src/rust-cli/general.rs b/src/rust-cli/general.rs index 9209d3722..64f5d8fff 100644 --- a/src/rust-cli/general.rs +++ b/src/rust-cli/general.rs @@ -1,6 +1,6 @@ use crate::rpc_call::make_rpc_call; use anyhow::Context; -use jsonrpsee::core::params::ObjectParams; +use serde_json::{json, Value}; use crate::util::pretty_print_value; @@ -9,81 +9,59 @@ pub enum NodeType { BitcoinCli, } -pub async fn handle_rpc_commands( +pub fn handle_rpc_commands( node_type: NodeType, node_index: &u64, method: &String, rpc_params: &Option>, - mut params: ObjectParams, + mut params: Value, ) -> anyhow::Result<()> { - params - .insert("node", node_index) - .context("add node_index param")?; - params - .insert("method", method) - .context("add method param")?; + params["node"] = json!(node_index); + params["method"] = json!(method); if let Some(p) = rpc_params { - params.insert("params", p).context("add rpc params")?; + params["params"] = json!(p); } let data = match node_type { - NodeType::LnCli => make_rpc_call("tank_lncli", params) - .await - .context("make RPC call lncli")?, - NodeType::BitcoinCli => make_rpc_call("tank_bcli", params) - .await - .context("make RPC call bitcoin-cli")?, + NodeType::LnCli => make_rpc_call("tank_lncli", ¶ms).context("make RPC call lncli")?, + NodeType::BitcoinCli => { + make_rpc_call("tank_bcli", ¶ms).context("make RPC call bitcoin-cli")? + } }; pretty_print_value(&data).context("Pretty print the result")?; Ok(()) } -pub async fn handle_debug_log_command(node: &u64, mut params: ObjectParams) -> anyhow::Result<()> { - params - .insert("node", node) - .context("add node_index param")?; - let data = make_rpc_call("tank_debug_log", params) - .await - .context("make RPC call tank_debug_log")?; +pub fn handle_debug_log_command(node: &u64, mut params: Value) -> anyhow::Result<()> { + params["node"] = json!(node); + let data = make_rpc_call("tank_debug_log", ¶ms).context("make RPC call tank_debug_log")?; pretty_print_value(&data).context("pretty print result")?; Ok(()) } -pub async fn handle_messages_command( +pub fn handle_messages_command( node_a: &u64, node_b: &u64, - mut params: ObjectParams, + mut params: Value, ) -> anyhow::Result<()> { - params - .insert("node_a", node_a) - .context("add node_b param")?; - params - .insert("node_b", node_b) - .context("add node_b param")?; - let data = make_rpc_call("tank_messages", params) - .await - .context("Failed to make RPC call tank_messages")?; + params["node_a"] = json!(node_a); + params["node_b"] = json!(node_b); + let data = + make_rpc_call("tank_messages", ¶ms).context("Failed to make RPC call tank_messages")?; pretty_print_value(&data).context("pretty print result")?; Ok(()) } -pub async fn handle_grep_logs_command( - pattern: &String, - mut params: ObjectParams, -) -> anyhow::Result<()> { - params - .insert("pattern", pattern) - .context("add pattern param")?; - let data = make_rpc_call("logs_grep", params) - .await - .context("Failed to make RPC call tank_messages")?; +pub fn handle_grep_logs_command(pattern: &String, mut params: Value) -> anyhow::Result<()> { + params["pattern"] = json!(pattern); + let data = + make_rpc_call("logs_grep", ¶ms).context("Failed to make RPC call tank_messages")?; pretty_print_value(&data).context("pretty print result")?; Ok(()) } -pub async fn handle_stop_command(params: ObjectParams) -> anyhow::Result<()> { - let data = make_rpc_call("server_stop", params) - .await - .context("Failed to make RPC call server_stop")?; +pub fn handle_stop_command(params: Value) -> anyhow::Result<()> { + let data = + make_rpc_call("server_stop", ¶ms).context("Failed to make RPC call server_stop")?; pretty_print_value(&data).context("pretty print result")?; Ok(()) } diff --git a/src/rust-cli/graph.rs b/src/rust-cli/graph.rs index 70dbf88c8..c7bf87e0c 100644 --- a/src/rust-cli/graph.rs +++ b/src/rust-cli/graph.rs @@ -252,7 +252,7 @@ fn handle_create_command( Ok(()) } -pub async fn handle_graph_command(command: &GraphCommand) -> anyhow::Result<()> { +pub fn handle_graph_command(command: &GraphCommand) -> anyhow::Result<()> { match command { GraphCommand::Create { number, diff --git a/src/rust-cli/image.rs b/src/rust-cli/image.rs index 86a5413ed..0024d4eb2 100644 --- a/src/rust-cli/image.rs +++ b/src/rust-cli/image.rs @@ -145,7 +145,7 @@ fn build_image( } } -pub async fn handle_image_command(command: &ImageCommand) -> anyhow::Result<()> { +pub fn handle_image_command(command: &ImageCommand) -> anyhow::Result<()> { match command { ImageCommand::Build { repo, diff --git a/src/rust-cli/main.rs b/src/rust-cli/main.rs index 548ded168..eb9f833a8 100644 --- a/src/rust-cli/main.rs +++ b/src/rust-cli/main.rs @@ -1,5 +1,7 @@ -use anyhow::Context; use clap::{Parser, Subcommand}; +use debug::handle_debug_command; +use network::handle_network_command; +use serde_json::json; mod debug; mod general; @@ -9,11 +11,11 @@ mod network; mod rpc_call; mod scenarios; mod util; -use crate::debug::{handle_debug_command, DebugCommand}; +use crate::debug::DebugCommand; use crate::general::*; use crate::graph::{handle_graph_command, GraphCommand}; use crate::image::{handle_image_command, ImageCommand}; -use crate::network::{handle_network_command, NetworkCommand}; +use crate::network::NetworkCommand; use crate::scenarios::{handle_scenario_command, ScenarioCommand}; #[derive(Parser, Debug)] @@ -94,35 +96,33 @@ enum Commands { Stop {}, } -#[tokio::main] -async fn main() -> anyhow::Result<()> { +fn main() -> anyhow::Result<()> { let cli = Cli::parse(); - let mut rpc_params = jsonrpsee::core::params::ObjectParams::new(); + + let mut rpc_params = json!({}); if let Some(network_value) = &cli.network { - rpc_params - .insert("network", network_value) - .context("Adding --network to rpc_params")?; + rpc_params["network"] = json!(network_value); } match &cli.command { Some(Commands::Debug { command }) => { if let Some(command) = command { - handle_debug_command(command, rpc_params).await?; + handle_debug_command(command, rpc_params)?; } } Some(Commands::Graph { command }) => { if let Some(command) = command { - handle_graph_command(command).await?; + handle_graph_command(command)?; } } Some(Commands::Network { command }) => { if let Some(command) = command { - handle_network_command(command, rpc_params).await?; + handle_network_command(command, rpc_params)?; } } Some(Commands::Scenarios { command }) => { if let Some(command) = command { - handle_scenario_command(command, rpc_params).await?; + handle_scenario_command(command, rpc_params)?; } } Some(Commands::Rpc { @@ -130,31 +130,31 @@ async fn main() -> anyhow::Result<()> { method, params, }) => { - handle_rpc_commands(NodeType::BitcoinCli, node, method, params, rpc_params).await?; + handle_rpc_commands(NodeType::BitcoinCli, node, method, params, rpc_params)?; } Some(Commands::LnCli { node, method, params, }) => { - handle_rpc_commands(NodeType::LnCli, node, method, params, rpc_params).await?; + handle_rpc_commands(NodeType::LnCli, node, method, params, rpc_params)?; } Some(Commands::DebugLog { node }) => { - handle_debug_log_command(node, rpc_params).await?; + handle_debug_log_command(node, rpc_params)?; } Some(Commands::Image { command }) => { if let Some(command) = command { - handle_image_command(command).await?; + handle_image_command(command)?; } } Some(Commands::Messages { node_a, node_b }) => { - handle_messages_command(node_a, node_b, rpc_params).await?; + handle_messages_command(node_a, node_b, rpc_params)?; } Some(Commands::GrepLogs { pattern }) => { - handle_grep_logs_command(pattern, rpc_params).await?; + handle_grep_logs_command(pattern, rpc_params)?; } Some(Commands::Stop {}) => { - handle_stop_command(rpc_params).await?; + handle_stop_command(rpc_params)?; } None => println!("No command provided"), } diff --git a/src/rust-cli/network.rs b/src/rust-cli/network.rs index edb04d515..3d391f4a0 100644 --- a/src/rust-cli/network.rs +++ b/src/rust-cli/network.rs @@ -1,9 +1,8 @@ use anyhow::{bail, Context}; use base64::{engine::general_purpose, Engine as _}; use clap::Subcommand; -use jsonrpsee::core::params::ObjectParams; use prettytable::{cell, Row, Table}; -use serde_json::Value; +use serde_json::{json, Value}; use std::path::PathBuf; use crate::rpc_call::make_rpc_call; @@ -118,20 +117,13 @@ fn handle_network_start_response(data: serde_json::Value) -> anyhow::Result<()> Ok(()) } -pub async fn handle_network_command( - command: &NetworkCommand, - mut params: ObjectParams, -) -> anyhow::Result<()> { +pub fn handle_network_command(command: &NetworkCommand, mut params: Value) -> anyhow::Result<()> { let (request, params) = match command { NetworkCommand::Start { graph_file, force } => { let b64_graph = graph_file_to_b64(graph_file).context("Reading graph file to base 64")?; - params - .insert("graph_file", b64_graph) - .context("Add base64 graph file to params")?; - params - .insert("force", *force) - .context("Add force bool to params")?; + params["graph_file"] = json!(b64_graph); + params["force"] = json!(force); ("network_from_file", params) } NetworkCommand::Up {} => ("network_up", params), @@ -142,7 +134,7 @@ pub async fn handle_network_command( NetworkCommand::Export {} => ("network_export", params), }; - let data = make_rpc_call(request, params).await?; + let data = make_rpc_call(request, ¶ms)?; match request { "network_status" => { handle_network_status_response(data).context("Handling network status response")? diff --git a/src/rust-cli/rpc_call.rs b/src/rust-cli/rpc_call.rs index 814d34734..65773af5c 100644 --- a/src/rust-cli/rpc_call.rs +++ b/src/rust-cli/rpc_call.rs @@ -1,13 +1,16 @@ -use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder}; +use anyhow::Context; +use jsonrpc::{simple_http::SimpleHttpTransport, Client}; -use serde_json::Value; +use serde_json::{value::to_raw_value, Value}; -pub async fn make_rpc_call( - request: &str, - params: jsonrpsee::core::params::ObjectParams, -) -> anyhow::Result { +pub fn make_rpc_call(request: &str, params: &Value) -> anyhow::Result { + let params = to_raw_value(¶ms)?; let url = "http://127.0.0.1:9276/api"; - let client = HttpClientBuilder::default().build(url)?; - let response = client.request::(request, params).await?; - Ok(response) + let t = SimpleHttpTransport::builder().url(url)?.build(); + let client = Client::with_transport(t); + let req = client.build_request(request, Some(¶ms)); + let response = client.send_request(req)?; + response + .result() + .with_context(|| format!("RPC call failed: {}", request)) } diff --git a/src/rust-cli/scenarios.rs b/src/rust-cli/scenarios.rs index daf3dbfb8..d207938b2 100644 --- a/src/rust-cli/scenarios.rs +++ b/src/rust-cli/scenarios.rs @@ -2,8 +2,8 @@ use crate::rpc_call::make_rpc_call; use anyhow::{bail, Context}; use base64::{engine::general_purpose, Engine as _}; use clap::Subcommand; -use jsonrpsee::core::params::ObjectParams; use prettytable::{row, Table}; +use serde_json::{json, Value}; use std::path::PathBuf; #[derive(Subcommand, Debug)] @@ -32,9 +32,8 @@ pub enum ScenarioCommand { pid: u64, }, } -async fn handle_available(params: ObjectParams) -> anyhow::Result<()> { - let data = make_rpc_call("scenarios_available", params) - .await +fn handle_available(params: Value) -> anyhow::Result<()> { + let data = make_rpc_call("scenarios_available", ¶ms) .context("Making RPC to fetch available scenarios")?; if let serde_json::Value::Array(scenarios) = data { let mut table = Table::new(); @@ -55,47 +54,36 @@ async fn handle_available(params: ObjectParams) -> anyhow::Result<()> { Ok(()) } -async fn handle_run( - mut params: ObjectParams, +fn handle_run( + mut params: Value, scenario: &str, additional_args: &Vec, ) -> anyhow::Result<()> { - params - .insert("scenario", scenario) - .context("Add scenario to params")?; - params - .insert("additional_args", additional_args) - .context("Add additional_args to params")?; - let data = make_rpc_call("scenarios_run", params) - .await + params["scenario"] = json!(scenario); + params["additional_args"] = json!(additional_args); + let data = make_rpc_call("scenarios_run", ¶ms) .context("Making RPC call to run scenario with remote file")?; println!("{:?}", data); Ok(()) } -async fn handle_run_file( - mut params: ObjectParams, +fn handle_run_file( + mut params: Value, scenario_path: &PathBuf, additional_args: &Vec, ) -> anyhow::Result<()> { let file_contents = std::fs::read(scenario_path).context("Failed to read scenario file")?; let scenario_base64 = general_purpose::STANDARD.encode(file_contents); - params - .insert("scenario_base64", scenario_base64) - .context("Adding scenario to params")?; - params - .insert("additional_args", additional_args) - .context("Adding additional_args to params")?; - let data = make_rpc_call("scenarios_run_file", params) - .await + params["scenario_base64"] = json!(scenario_base64); + params["additional_args"] = json!(additional_args); + let data = make_rpc_call("scenarios_run_file", ¶ms) .context("Making RPC call to run scenario with local file")?; println!("{:?}", data); Ok(()) } -async fn handle_active(params: ObjectParams) -> anyhow::Result<()> { - let data = make_rpc_call("scenarios_list_running", params) - .await +fn handle_active(params: Value) -> anyhow::Result<()> { + let data = make_rpc_call("scenarios_list_running", ¶ms) .context("Making RPC call to list running scenarios")?; if let serde_json::Value::Array(scenarios) = data { let mut table = Table::new(); @@ -128,10 +116,9 @@ async fn handle_active(params: ObjectParams) -> anyhow::Result<()> { Ok(()) } -async fn handle_stop(mut params: ObjectParams, pid: &u64) -> anyhow::Result<()> { - params.insert("pid", pid).context("Add pid to params")?; - let data = make_rpc_call("scenarios_stop", params) - .await +fn handle_stop(mut params: Value, pid: &u64) -> anyhow::Result<()> { + params["pid"] = json!(pid); + let data = make_rpc_call("scenarios_stop", ¶ms) .context("Making RPC call to stop running scenario")?; if let serde_json::Value::String(message) = data { println!("{}", message); @@ -141,23 +128,16 @@ async fn handle_stop(mut params: ObjectParams, pid: &u64) -> anyhow::Result<()> Ok(()) } -pub async fn handle_scenario_command( - command: &ScenarioCommand, - params: ObjectParams, -) -> anyhow::Result<()> { +pub fn handle_scenario_command(command: &ScenarioCommand, params: Value) -> anyhow::Result<()> { match command { ScenarioCommand::Available {} => { - handle_available(params) - .await - .context("List available scenarios")?; + handle_available(params).context("List available scenarios")?; } ScenarioCommand::Run { scenario, additional_args, } => { - handle_run(params, scenario, additional_args) - .await - .context("Run scenario from remote")?; + handle_run(params, scenario, additional_args).context("Run scenario from remote")?; } ScenarioCommand::RunFile { @@ -165,18 +145,13 @@ pub async fn handle_scenario_command( additional_args, } => { handle_run_file(params, scenario_path, additional_args) - .await .context("Run scenario file from path")?; } ScenarioCommand::Active {} => { - handle_active(params) - .await - .context("List active scenarios")?; + handle_active(params).context("List active scenarios")?; } ScenarioCommand::Stop { pid } => { - handle_stop(params, pid) - .await - .context(format!("Stop running scenario with pid: {}", pid))?; + handle_stop(params, pid).context(format!("Stop running scenario with pid: {}", pid))?; } }; Ok(())