diff --git a/Cargo.lock b/Cargo.lock index cb0f8a2..bfb57a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1978,14 +1978,14 @@ checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iroh" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b15215aea8d0367fefb9264521e4a251dc4e113896a3d765f530378518188f" +source = "git+https://github.com/n0-computer/iroh?branch=main#321d8ffd3d2bde2f1a80e78eab1ad83687484fc2" dependencies = [ "anyhow", "axum", "backoff", "base64", "bytes", + "concurrent-queue", "der", "derive_more", "futures-buffered", @@ -2044,7 +2044,7 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tokio-tungstenite 0.24.0", + "tokio-tungstenite", "tokio-tungstenite-wasm", "tokio-util", "tracing", @@ -2060,8 +2060,7 @@ dependencies = [ [[package]] name = "iroh-base" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd98293ce8e85e6b4f0ce09af7c6bb860f2fece8fcf9238d6e628f1e163e27a" +source = "git+https://github.com/n0-computer/iroh?branch=main#321d8ffd3d2bde2f1a80e78eab1ad83687484fc2" dependencies = [ "aead", "anyhow", @@ -2101,8 +2100,7 @@ dependencies = [ [[package]] name = "iroh-blobs" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eaff53d1700758783707690b76973775e593841735739678dc240412e1d040f" +source = "git+https://github.com/n0-computer/iroh-blobs?branch=main#dba7850ae874939bd9a83f97c36dc6eceee7f9bd" dependencies = [ "anyhow", "async-channel", @@ -2209,8 +2207,7 @@ dependencies = [ [[package]] name = "iroh-gossip" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5688dded24660d9d64ab444768b969f8d4c06aae5221d9e2ef619f12873acee" +source = "git+https://github.com/n0-computer/iroh-gossip?branch=main#d5285e7240da4e233be7c8f83099741f6f272bb0" dependencies = [ "anyhow", "async-channel", @@ -2225,15 +2222,11 @@ dependencies = [ "iroh", "iroh-blake3", "iroh-metrics", - "nested_enum_utils", "postcard", - "quic-rpc", - "quic-rpc-derive", "rand", "rand_core", "serde", "serde-error", - "strum", "tokio", "tokio-util", "tracing", @@ -2276,8 +2269,7 @@ dependencies = [ [[package]] name = "iroh-net-report" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b82dc449d537176fc90749ae0711c6f81479053086928a2f2bb87cb52646ba74" +source = "git+https://github.com/n0-computer/iroh?branch=main#321d8ffd3d2bde2f1a80e78eab1ad83687484fc2" dependencies = [ "anyhow", "bytes", @@ -2353,8 +2345,7 @@ dependencies = [ [[package]] name = "iroh-relay" version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a0d0d7317795a01caa47ffdaeec84211d1b394530bdb31dbe15f642e58bcff" +source = "git+https://github.com/n0-computer/iroh?branch=main#321d8ffd3d2bde2f1a80e78eab1ad83687484fc2" dependencies = [ "anyhow", "base64", @@ -2401,7 +2392,7 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-rustls-acme", - "tokio-tungstenite 0.24.0", + "tokio-tungstenite", "tokio-tungstenite-wasm", "tokio-util", "toml", @@ -4978,19 +4969,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.21.0", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.24.0", + "tungstenite", ] [[package]] @@ -5006,7 +4985,7 @@ dependencies = [ "js-sys", "thiserror 1.0.69", "tokio", - "tokio-tungstenite 0.21.0", + "tokio-tungstenite", "wasm-bindgen", "web-sys", ] @@ -5195,24 +5174,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "tungstenite" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.2.0", - "httparse", - "log", - "rand", - "sha1", - "thiserror 1.0.69", - "utf-8", -] - [[package]] name = "typenum" version = "1.17.0" diff --git a/Cargo.toml b/Cargo.toml index f1ed418..e524fdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,8 +110,15 @@ rpc = [ "dep:quic-rpc-derive", "dep:serde-error", "dep:portable-atomic", + "iroh-blobs/rpc", ] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "iroh_docsrs"] + +[patch.crates-io] +iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main" } +iroh = { git = "https://github.com/n0-computer/iroh", branch = "main" } +iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "main" } +iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip", branch = "main" } diff --git a/deny.toml b/deny.toml index 28b26fe..6f93301 100644 --- a/deny.toml +++ b/deny.toml @@ -37,4 +37,8 @@ ignore = [ ] [sources] -allow-git = [] +allow-git = [ + "https://github.com/n0-computer/iroh.git", + "https://github.com/n0-computer/iroh-blobs.git", + "https://github.com/n0-computer/iroh-gossip.git", +] diff --git a/src/protocol.rs b/src/protocol.rs index ed9e4ea..cfbb45d 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,7 +1,5 @@ //! [`ProtocolHandler`] implementation for the docs [`Engine`]. -use std::sync::Arc; - use anyhow::Result; use futures_lite::future::Boxed as BoxedFuture; use iroh::{endpoint::Connecting, protocol::ProtocolHandler}; @@ -9,13 +7,15 @@ use iroh::{endpoint::Connecting, protocol::ProtocolHandler}; use crate::engine::Engine; impl ProtocolHandler for Engine { - fn accept(self: Arc, conn: Connecting) -> BoxedFuture> { - Box::pin(async move { self.handle_connection(conn).await }) + fn accept(&self, conn: Connecting) -> BoxedFuture> { + let this = self.clone(); + Box::pin(async move { this.handle_connection(conn).await }) } - fn shutdown(self: Arc) -> BoxedFuture<()> { + fn shutdown(&self) -> BoxedFuture<()> { + let this = self.clone(); Box::pin(async move { - if let Err(err) = (*self).shutdown().await { + if let Err(err) = this.shutdown().await { tracing::warn!("shutdown error: {:?}", err); } }) diff --git a/tests/util.rs b/tests/util.rs index 228146d..8f92a26 100644 --- a/tests/util.rs +++ b/tests/util.rs @@ -144,13 +144,13 @@ impl Builder { endpoint.clone(), local_pool.handle().clone(), ); - let blobs = Arc::new(iroh_blobs::net_protocol::Blobs::new( + let blobs = iroh_blobs::net_protocol::Blobs::new( store.clone(), local_pool.handle().clone(), Default::default(), downloader.clone(), endpoint.clone(), - )); + ); let gossip = iroh_gossip::net::Gossip::from_endpoint( endpoint.clone(), Default::default(),