Skip to content

Commit

Permalink
feat: simple iroh
Browse files Browse the repository at this point in the history
remove the remaining pieces in `iroh` and make it a pure reexport crate
  • Loading branch information
dignifiedquire committed Nov 28, 2024
1 parent c999770 commit 97f08d9
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 2,286 deletions.
284 changes: 1 addition & 283 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions iroh-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ iroh-relay = { version = "0.28", path = "../iroh-relay", features = ["test-utils
name = "key"
harness = false

[build-dependencies]
duct = "0.13.6"

[features]
default = ["metrics", "discovery-pkarr-dht"]
metrics = ["iroh-metrics/metrics"]
Expand Down
1 change: 1 addition & 0 deletions iroh/src/util/fs.rs → iroh-node-util/src/fs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Utilities for filesystem operations.
use std::path::PathBuf;

use anyhow::Context;
Expand Down
2 changes: 2 additions & 0 deletions iroh-node-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub mod config;
pub mod logging;
pub mod rpc;

pub mod fs;

use std::path::PathBuf;

use anyhow::Context;
Expand Down
90 changes: 21 additions & 69 deletions iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,92 +16,44 @@ rust-version = "1.76"
workspace = true

[dependencies]
anyhow = { version = "1" }
async-channel = "2.3.1"
bytes = "1.7"
derive_more = { version = "1.0.0", features = [
"debug",
"display",
"from",
"try_into",
"from_str",
] }
futures-lite = "2.5"
futures-util = "0.3"
iroh-base = { version = "0.28.0", features = ["key"] }
iroh-io = { version = "0.6.0", features = ["stats"] }
iroh-metrics = { version = "0.28.0", optional = true }
iroh-net = { version = "0.28.1", features = ["discovery-local-network"] }
iroh-node-util = { version = "0.28.0", path = "../iroh-node-util" }
iroh-net = { version = "0.28.1", default-features = false }
iroh-router = { version = "0.28.0" }
nested_enum_utils = "0.1.0"
num_cpus = { version = "1.15.0" }
parking_lot = "0.12.1"
postcard = { version = "1", default-features = false, features = [
"alloc",
"use-std",
"experimental-derive",
] }
quic-rpc = { version = "0.15", default-features = false, features = [
"flume-transport",
"quinn-transport",
] }
quic-rpc-derive = { version = "0.15" }
quinn = { package = "iroh-quinn", version = "0.12" }
serde = { version = "1", features = ["derive"] }
strum = { version = "0.26", features = ["derive"] }
thiserror = "2"
tempfile = "3.4"
tokio = { version = "1", features = ["io-util", "rt"] }
tokio-util = { version = "0.7", features = ["codec", "io-util", "io", "time"] }
tracing = "0.1"
iroh-relay = { version = "0.28", path = "../iroh-relay" }
ref-cast = "1.0.23"

# Examples
anyhow = { version = "1", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
indicatif = { version = "0.17", features = ["tokio"], optional = true }
parse-size = { version = "=1.0.0", optional = true } # pinned version to avoid bumping msrv to 1.81
tokio = { version = "1", features = ["full"], optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
futures-lite = { version = "2.5", optional = true }
tracing = { version = "0.1", optional = true }
bytes = { version = "1.8", optional = true }

# Documentation tests
url = { version = "2.5", features = ["serde"] }
serde-error = "0.1.3"

[features]
default = ["metrics"]
metrics = ["iroh-metrics"]
test = []
default = ["metrics", "discovery-pkarr-dht"]
metrics = ["iroh-net/metrics"]
discovery-local-network = ["iroh-net/discovery-local-network"]
discovery-pkarr-dht = ["iroh-net/discovery-pkarr-dht"]
test-utils = ["iroh-net/test-utils"]

examples = ["dep:clap", "dep:indicatif", "dep:parse-size"]

[dev-dependencies]
anyhow = { version = "1" }
bao-tree = { version = "0.13", features = ["tokio_fsm"] }
futures-buffered = "0.2.4"
genawaiter = { version = "0.99", features = ["futures03"] }
iroh = { path = ".", features = ["test-utils"] }
iroh-test = "0.28.0"
proptest = "1.2.0"
rand = "0.8"
rand_chacha = "0.3.1"
regex = { version = "1.7.1", features = ["std"] }
serde_json = "1"
testdir = "0.9.1"
testresult = "0.4.0"
tokio = { version = "1", features = ["macros", "io-util", "rt"] }
tokio-stream = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
examples = [
"dep:anyhow",
"dep:clap",
"dep:indicatif",
"dep:parse-size",
"dep:tokio",
"dep:tracing-subscriber",
"dep:futures-lite",
"dep:tracing",
"dep:bytes",
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "iroh_docsrs"]

[[example]]
name = "rpc"
required-features = ["examples"]

[[example]]
name = "transfer"
required-features = ["examples"]
73 changes: 0 additions & 73 deletions iroh/examples/rpc.rs

This file was deleted.

5 changes: 3 additions & 2 deletions iroh/examples/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use clap::{Parser, Subcommand};
use futures_lite::StreamExt;
use indicatif::HumanBytes;
use iroh_net::{
key::SecretKey, ticket::NodeTicket, Endpoint, NodeAddr, RelayMap, RelayMode, RelayUrl,
endpoint::ConnectionError, key::SecretKey, ticket::NodeTicket, Endpoint, NodeAddr, RelayMap,
RelayMode, RelayUrl,
};
use tracing::info;

Expand Down Expand Up @@ -132,7 +133,7 @@ async fn provide(size: u64, relay_url: Option<String>) -> anyhow::Result<()> {
// it received this message.
let res = tokio::time::timeout(Duration::from_secs(3), async move {
let closed = conn.closed().await;
if !matches!(closed, quinn::ConnectionError::ApplicationClosed(_)) {
if !matches!(closed, ConnectionError::ApplicationClosed(_)) {
println!("node {node_id} disconnected with an error: {closed:#}");
}
})
Expand Down
59 changes: 0 additions & 59 deletions iroh/src/client.rs

This file was deleted.

75 changes: 0 additions & 75 deletions iroh/src/client/quic.rs

This file was deleted.

Loading

0 comments on commit 97f08d9

Please sign in to comment.