Skip to content

refactor!: Port to irpc, remove quic-rpc and cli impl #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 131 additions & 137 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ed25519-dalek = { version = "2.0.0", features = ["serde", "rand_core"] }
hex = "0.4.3"
indexmap = "2.0"
iroh-metrics = { version = "0.34", default-features = false }
iroh-base = { version = "0.35", default-features = false, features = ["key"] }
n0-future = "0.1.2"
postcard = { version = "1", default-features = false, features = [
"alloc",
Expand All @@ -57,7 +58,6 @@ postcard = { version = "1", default-features = false, features = [
rand = { version = "0.8.5", features = ["std_rng"] }
rand_core = "0.6.4"
serde = { version = "1.0.164", features = ["derive"] }
serde-error = "0.1.3"

# net dependencies (optional)
anyhow = { version = "1", optional = true }
Expand All @@ -70,11 +70,17 @@ tokio-util = { version = "0.7.12", optional = true, features = ["codec"] }
tracing = "0.1"
data-encoding = { version = "2.6.0", optional = true }
thiserror = { version = "2.0", optional = true }
irpc = { version = "0.2.3", optional = true, default-features = false, features = [
"stream",
"message_spans",
] }
irpc-derive = { version = "0.2.3", optional = true }

# rpc dependencies (optional)
nested_enum_utils = { version = "0.1.0", optional = true }
quic-rpc = { version = "0.20", optional = true }
quic-rpc-derive = { version = "0.20", optional = true }
quinn = { package = "iroh-quinn", version = "0.13.0", optional = true }
strum = { version = "0.26", optional = true }

# test-utils dependencies (optional)
Expand All @@ -91,6 +97,7 @@ serde_json = { version = "1", optional = true }
rayon = { version = "1.10.0", optional = true }
comfy-table = { version = "7.1.4", optional = true }


[dev-dependencies]
tokio = { version = "1", features = [
"io-util",
Expand All @@ -115,6 +122,8 @@ url = "2.4.0"
[features]
default = ["net", "metrics"]
net = [
"dep:irpc",
"dep:irpc-derive",
"dep:futures-lite",
"dep:iroh",
"dep:tokio",
Expand All @@ -126,12 +135,14 @@ net = [
"dep:thiserror",
]
rpc = [
"dep:nested_enum_utils",
"dep:quic-rpc",
"dep:quic-rpc-derive",
"dep:strum",
"dep:irpc",
"dep:irpc-derive",
"dep:tokio",
"dep:quinn",
"dep:thiserror",
"irpc/rpc",
"irpc/quinn_endpoint_setup",
]
cli = ["rpc", "dep:clap"]
test-utils = ["dep:rand_chacha", "dep:humantime-serde"]
simulator = [
"test-utils",
Expand Down
2 changes: 1 addition & 1 deletion examples/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async fn main() -> Result<()> {
endpoint.add_node_addr(peer)?;
}
};
let (sender, receiver) = gossip.subscribe_and_join(topic, peer_ids).await?.split();
let (mut sender, receiver) = gossip.subscribe_and_join(topic, peer_ids).await?.split();
println!("> connected!");

// broadcast our name, if set
Expand Down
128 changes: 0 additions & 128 deletions src/cli.rs

This file was deleted.

17 changes: 3 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@
#![deny(missing_docs, rustdoc::broken_intra_doc_links)]
#![cfg_attr(iroh_docsrs, feature(doc_auto_cfg))]

pub mod metrics;
#[cfg(feature = "net")]
pub mod net;

#[cfg(feature = "net")]
#[doc(inline)]
pub use net::GOSSIP_ALPN as ALPN;

pub mod metrics;
#[cfg(feature = "net")]
pub mod net;
pub mod proto;

#[cfg(feature = "cli")]
pub mod cli;
#[cfg(feature = "rpc")]
pub mod rpc;
#[cfg(feature = "rpc")]
pub use rpc::{
client::Client as RpcClient,
proto::{Request as RpcRequest, Response as RpcResponse, RpcService},
};
Loading
Loading