Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
244 changes: 205 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ chrono = "0.4.31"
derive_more = { version = "1.0.0", features = ["debug", "display", "deref", "deref_mut", "from", "try_into", "into"] }
futures-buffered = "0.2.4"
futures-lite = "2.3"
futures-util = { version = "0.3.30", optional = true }
genawaiter = { version = "0.99.1", features = ["futures03"] }
hashlink = { version = "0.9.0", optional = true }
hex = "0.4.3"
Expand All @@ -29,27 +30,34 @@ iroh-io = { version = "0.6.0", features = ["stats"] }
iroh-metrics = { version = "0.27.0", default-features = false }
iroh-net = { version = "0.27.0" }
iroh-router = "0.27.0"
nested_enum_utils = { version = "0.1.0", optional = true }
num_cpus = "1.15.0"
oneshot = "0.1.8"
parking_lot = { version = "0.12.1", optional = true }
pin-project = "1.1.5"
portable-atomic = { version = "1", optional = true }
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
quic-rpc = { version = "0.13.0", optional = true }
quic-rpc-derive = { version = "0.13.0", optional = true }
quinn = { package = "iroh-quinn", version = "0.11", features = ["ring"] }
rand = "0.8"
range-collections = "0.4.0"
redb = { version = "2.0.0", optional = true }
redb_v1 = { package = "redb", version = "1.5.1", optional = true }
ref-cast = { version = "1.0.23", optional = true }
reflink-copy = { version = "0.1.8", optional = true }
self_cell = "1.0.1"
serde = { version = "1", features = ["derive"] }
serde-error = "0.1.3"
smallvec = { version = "1.10.0", features = ["serde", "const_new"] }
strum = { version = "0.26.3", optional = true }
tempfile = { version = "3.10.0", optional = true }
thiserror = "1"
tokio = { version = "1", features = ["fs"] }
tokio-util = { version = "0.7", features = ["io-util", "io"] }
tracing = "0.1"
tracing-futures = "0.2.5"
walkdir = { version = "2.5.0", optional = true }

[dev-dependencies]
http-body = "0.4.5"
Expand All @@ -65,13 +73,18 @@ rcgen = "0.12.0"
rustls = { version = "0.23", default-features = false, features = ["ring"] }
tempfile = "3.10.0"
futures-util = "0.3.30"
testdir = "0.9.1"

[features]
default = ["fs-store"]
default = ["fs-store", "rpc"]
downloader = ["dep:parking_lot", "tokio-util/time", "dep:hashlink"]
fs-store = ["dep:reflink-copy", "redb", "dep:redb_v1", "dep:tempfile"]
metrics = ["iroh-metrics/metrics"]
redb = ["dep:redb"]
rpc = ["dep:quic-rpc", "dep:quic-rpc-derive", "dep:nested_enum_utils", "dep:strum", "dep:futures-util", "dep:ref-cast", "dep:portable-atomic", "dep:walkdir", "downloader"]
ref-cast = ["dep:ref-cast"]
portable-atomic = ["dep:portable-atomic"]
walkdir = ["dep:walkdir"]

[package.metadata.docs.rs]
all-features = true
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ pub mod metrics;
pub mod net_protocol;
pub mod protocol;
pub mod provider;
#[cfg(feature = "rpc")]
#[cfg_attr(iroh_docsrs, doc(cfg(feature = "rpc")))]
pub mod rpc;
pub mod store;
pub mod util;

Expand Down
11 changes: 11 additions & 0 deletions src/net_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub struct Blobs<S> {
events: EventSender,
downloader: Downloader,
batches: tokio::sync::Mutex<BlobBatches>,
endpoint: Endpoint,
}

/// Name used for logging when new node addresses are added from gossip.
Expand Down Expand Up @@ -135,12 +136,14 @@ impl<S: crate::store::Store> Blobs<S> {
rt: LocalPoolHandle,
events: EventSender,
downloader: Downloader,
endpoint: Endpoint,
) -> Self {
Self {
rt,
store,
events,
downloader,
endpoint,
batches: Default::default(),
}
}
Expand All @@ -149,6 +152,14 @@ impl<S: crate::store::Store> Blobs<S> {
&self.store
}

pub(crate) fn rt(&self) -> LocalPoolHandle {
self.rt.clone()
}

pub(crate) fn endpoint(&self) -> &Endpoint {
&self.endpoint
}

pub async fn batches(&self) -> tokio::sync::MutexGuard<'_, BlobBatches> {
self.batches.lock().await
}
Expand Down
Loading
Loading