Skip to content

Commit 8caa393

Browse files
committed
WIP
1 parent 6e66ef4 commit 8caa393

File tree

10 files changed

+1080
-615
lines changed

10 files changed

+1080
-615
lines changed

Cargo.lock

Lines changed: 1059 additions & 596 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ iroh-test = { path = "./iroh-test" }
5555
iroh-router = { path = "./iroh-router" }
5656

5757
# iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "main" }
58-
iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip", branch = "main" }
58+
iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip", branch = "try-out-new-quicrpc" }
5959
iroh-docs = { git = "https://github.com/n0-computer/iroh-docs", branch = "main" }
60-
iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "add-rpc" }
60+
iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "try-out-new-rpc" }
61+
62+
quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true }
63+
quic-rpc-derive = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true }

iroh-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pkarr = { version = "2.2.0", default-features = false }
4848
portable-atomic = "1"
4949
portmapper = { version = "0.1.0", path = "../net-tools/portmapper" }
5050
postcard = "1.0.8"
51-
quic-rpc = { version = "0.12", features = ["flume-transport", "quinn-transport"] }
51+
quic-rpc = { version = "0.15", features = ["flume-transport", "quinn-transport"] }
5252
rand = "0.8.5"
5353
ratatui = "0.26.2"
5454
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }

iroh/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ futures-lite = "2.3"
2626
futures-util = "0.3"
2727
genawaiter = { version = "0.99", default-features = false, features = ["futures03"] }
2828
hex = { version = "0.4.3" }
29-
iroh-blobs = { version = "0.27.0", features = ["downloader"] }
29+
iroh-blobs = { version = "0.28.1", features = ["downloader"] }
3030
iroh-base = { version = "0.27.0", features = ["key"] }
3131
iroh-io = { version = "0.6.0", features = ["stats"] }
3232
iroh-metrics = { version = "0.27.0", optional = true }
@@ -39,8 +39,8 @@ iroh-docs = { version = "0.27.0" }
3939
iroh-gossip = "0.27.0"
4040
parking_lot = "0.12.1"
4141
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
42-
quic-rpc = { version = "0.13", default-features = false, features = ["flume-transport", "quinn-transport"] }
43-
quic-rpc-derive = { version = "0.13" }
42+
quic-rpc = { version = "0.15", default-features = false, features = ["flume-transport", "quinn-transport"] }
43+
quic-rpc-derive = { version = "0.15" }
4444
quinn = { package = "iroh-quinn", version = "0.11" }
4545
rand = "0.8"
4646
serde = { version = "1", features = ["derive"] }

iroh/src/client/blobs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! Reexport of iroh-blobs rpc client
22
3-
use quic_rpc::client::BoxedServiceConnection;
3+
use quic_rpc::client::BoxedConnector;
44

55
use super::RpcService;
66
/// Reexport of iroh-blobs rpc client
77
pub type Client =
8-
iroh_blobs::rpc::client::blobs::Client<BoxedServiceConnection<RpcService>, RpcService>;
8+
iroh_blobs::rpc::client::blobs::Client<BoxedConnector<RpcService>, RpcService>;
99

1010
pub use iroh_blobs::rpc::client::blobs::{
1111
AddDirOpts, AddFileOpts, AddOutcome, AddProgress, AddReaderOpts, BlobInfo, BlobStatus,

iroh/src/client/docs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl Entry {
476476
/// You can pass either a [`Doc`] or the `Iroh` client by reference as `client`.
477477
pub async fn content_reader(&self, client: impl Into<&RpcClient>) -> Result<blobs::Reader> {
478478
let client: RpcClient = client.into().clone();
479-
let client: quic_rpc::RpcClient<iroh_blobs::rpc::proto::RpcService, _, _> = client.map();
479+
let client: quic_rpc::RpcClient<iroh_blobs::rpc::proto::RpcService, _> = client.map();
480480
blobs::Reader::from_rpc_read(&client, self.content_hash()).await
481481
}
482482

@@ -485,7 +485,7 @@ impl Entry {
485485
/// You can pass either a [`Doc`] or the `Iroh` client by reference as `client`.
486486
pub async fn content_bytes(&self, client: impl Into<&RpcClient>) -> Result<Bytes> {
487487
let client: RpcClient = client.into().clone();
488-
let client: quic_rpc::RpcClient<iroh_blobs::rpc::proto::RpcService, _, _> = client.map();
488+
let client: quic_rpc::RpcClient<iroh_blobs::rpc::proto::RpcService, _> = client.map();
489489

490490
blobs::Reader::from_rpc_read(&client, self.content_hash())
491491
.await?

iroh/src/client/quic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
};
99

1010
use anyhow::{bail, Context};
11-
use quic_rpc::transport::{boxed::Connection as BoxedConnection, quinn::QuinnConnection};
11+
use quic_rpc::transport::{boxed::BoxedConnector, quinn::QuinnConnector};
1212

1313
use super::{Iroh, RpcClient};
1414
use crate::{node::RpcStatus, rpc_protocol::node::StatusRequest};
@@ -43,8 +43,8 @@ pub(crate) async fn connect_raw(addr: SocketAddr) -> anyhow::Result<RpcClient> {
4343
let endpoint = create_quinn_client(bind_addr, vec![RPC_ALPN.to_vec()], false)?;
4444

4545
let server_name = "localhost".to_string();
46-
let connection = QuinnConnection::new(endpoint, addr, server_name);
47-
let connection = BoxedConnection::new(connection);
46+
let connection = QuinnConnector::new(endpoint, addr, server_name);
47+
let connection = BoxedConnector::new(connection);
4848
let client = RpcClient::new(connection);
4949
// Do a status request to check if the server is running.
5050
let _version = tokio::time::timeout(Duration::from_secs(1), client.rpc(StatusRequest))

iroh/src/client/tags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Reexport of iroh-blobs rpc client
2-
use quic_rpc::client::BoxedServiceConnection;
2+
use quic_rpc::server::BoxedListener;
33

44
use super::RpcService;
55
/// Reexport of iroh-blobs rpc client
66
pub type Client =
7-
iroh_blobs::rpc::client::tags::Client<BoxedServiceConnection<RpcService>, RpcService>;
7+
iroh_blobs::rpc::client::tags::Client<BoxedListener<RpcService>, RpcService>;
88

99
pub use iroh_blobs::rpc::client::tags::TagInfo;

iroh/src/node/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,11 @@ where
692692

693693
// Initialize the internal RPC connection.
694694
let (internal_rpc, controller) =
695-
quic_rpc::transport::flume::service_connection::<RpcService>(32);
696-
let internal_rpc = quic_rpc::transport::boxed::ServerEndpoint::new(internal_rpc);
695+
quic_rpc::transport::flume::channel(32);
696+
let internal_rpc = quic_rpc::transport::boxed::BoxedListener::new(internal_rpc);
697697
// box the controller. Boxing has a special case for the flume channel that avoids allocations,
698698
// so this has zero overhead.
699-
let controller = quic_rpc::transport::boxed::Connection::new(controller);
699+
let controller = quic_rpc::transport::boxed::BoxedConnector::new(controller);
700700
let client = crate::client::Iroh::new(quic_rpc::RpcClient::new(controller.clone()));
701701

702702
let inner = Arc::new(NodeInner {

iroh/src/node/rpc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ impl<D: BaoStore> Handler<D> {
161161
chan: RpcChannel<
162162
iroh_blobs::rpc::proto::RpcService,
163163
IrohServerEndpoint,
164-
crate::rpc_protocol::RpcService,
165164
>,
166165
) -> Result<(), RpcServerError<IrohServerEndpoint>> {
167166
self.blobs().handle_rpc_request(msg, chan).await

0 commit comments

Comments
 (0)