diff --git a/Cargo.lock b/Cargo.lock index ffb451d367..1f8c52b169 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4828,22 +4828,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.3" @@ -8924,7 +8908,7 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls 0.24.2", - "hyper-tls 0.5.0", + "hyper-tls", "ipnet", "js-sys", "log", @@ -8940,7 +8924,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration 0.5.1", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", @@ -8964,22 +8948,18 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", "hyper-rustls 0.27.2", - "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -8991,9 +8971,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "system-configuration 0.6.1", "tokio", - "tokio-native-tls", "tokio-rustls 0.26.0", "tokio-util", "tower-service", @@ -9828,7 +9806,6 @@ name = "rooch-rpc-client" version = "0.6.9" dependencies = [ "anyhow", - "axum 0.7.5", "bcs", "futures", "hex", @@ -9836,7 +9813,6 @@ dependencies = [ "log", "move-core-types", "moveos-types", - "reqwest 0.12.7", "rooch-config", "rooch-key", "rooch-rpc-api", @@ -11529,18 +11505,7 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys 0.5.0", -] - -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.5.0", - "core-foundation", - "system-configuration-sys 0.6.0", + "system-configuration-sys", ] [[package]] @@ -11553,16 +11518,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tap" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index b2beabfb01..37191c9d3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -217,7 +217,6 @@ tonic = { version = "0.8", features = ["gzip"] } tracing = "0.1.37" tracing-appender = "0.2.2" tracing-subscriber = { version = "0.3.15" } -reqwest = { version = "0.12.7", features = ["json"] } codespan-reporting = "0.11.1" codespan = "0.11.1" diff --git a/crates/rooch-rpc-client/Cargo.toml b/crates/rooch-rpc-client/Cargo.toml index 44c37a0012..b2d7526b24 100644 --- a/crates/rooch-rpc-client/Cargo.toml +++ b/crates/rooch-rpc-client/Cargo.toml @@ -23,8 +23,6 @@ jsonrpsee = { workspace = true } serde_json = { workspace = true } log = { workspace = true } hex = { workspace = true } -reqwest = { workspace = true } -axum = { workspace = true } move-core-types = { workspace = true } diff --git a/crates/rooch-rpc-client/src/lib.rs b/crates/rooch-rpc-client/src/lib.rs index dc9ae52bf8..4fe4598ec2 100644 --- a/crates/rooch-rpc-client/src/lib.rs +++ b/crates/rooch-rpc-client/src/lib.rs @@ -15,9 +15,7 @@ use moveos_types::{ function_return_value::FunctionResult, module_binding::MoveFunctionCaller, moveos_std::tx_context::TxContext, transaction::FunctionCall, }; -use reqwest::Proxy; use rooch_client::RoochRpcClient; -use serde_json::json; use std::sync::Arc; use std::time::Duration; use tokio::runtime::Handle; @@ -58,24 +56,9 @@ impl ClientBuilder { .build(http)?, ); - if let Some(proxy_url) = self.proxy_url { - let reqwest_client = Some(Arc::new( - reqwest::Client::builder() - .proxy(Proxy::https(proxy_url.clone())?) - .proxy(Proxy::all(proxy_url)?) - .build()?, - )); - return Ok(Client { - http: http_client.clone(), - rooch: RoochRpcClient::new(http_client.clone()), - reqwest: reqwest_client, - }); - }; - Ok(Client { http: http_client.clone(), rooch: RoochRpcClient::new(http_client.clone()), - reqwest: None, }) } } @@ -93,7 +76,6 @@ impl Default for ClientBuilder { #[derive(Clone)] pub struct Client { http: Arc, - reqwest: Option>, pub rooch: RoochRpcClient, } @@ -111,28 +93,6 @@ impl Client { ) -> Result { Ok(self.http.request(method, params).await?) } - - pub async fn request_by_proxy( - &self, - url: &str, - method: &str, - params: Vec, - ) -> Result { - if let Some(reqwest) = &self.reqwest { - let response = reqwest - .post(url) - .header("Content-Type", "application/json") - .json(&json!({ - "method": method, - "params": params, - })) - .send() - .await?; - return Ok(response.json::().await?); - }; - - Ok(serde_json::Value::Null) - } } impl MoveFunctionCaller for Client {