Skip to content

Commit

Permalink
Merge pull request #15 from n0-computer/import-exapmles
Browse files Browse the repository at this point in the history
examples: import examples from main repo
  • Loading branch information
rklaehn authored Nov 26, 2024
2 parents cdcb863 + 3b1029f commit 8ab19fe
Show file tree
Hide file tree
Showing 9 changed files with 1,534 additions and 116 deletions.
406 changes: 368 additions & 38 deletions Cargo.lock

Large diffs are not rendered by default.

63 changes: 55 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ rust-version = "1.76"
[dependencies]
anyhow = { version = "1" }
async-channel = "2.3.1"
bao-tree = { version = "0.13", features = ["tokio_fsm", "validate"], default-features = false }
bao-tree = { version = "0.13", features = [
"tokio_fsm",
"validate",
], default-features = false }
bytes = { version = "1.7", features = ["serde"] }
chrono = "0.4.31"
clap = { version = "4.5.20", features = ["derive"], optional = true }
console = { version = "0.15.8", optional = true }
derive_more = { version = "1.0.0", features = ["debug", "display", "deref", "deref_mut", "from", "try_into", "into"] }
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 }
Expand All @@ -38,14 +48,18 @@ num_cpus = "1.15.0"
oneshot = "0.1.8"
parking_lot = { version = "0.12.1", optional = true }
portable-atomic = { version = "1", optional = true }
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
postcard = { version = "1", default-features = false, features = [
"alloc",
"use-std",
"experimental-derive",
] }
quic-rpc = { version = "0.15.1", optional = true }
quic-rpc-derive = { version = "0.15.0", optional = true }
quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] }
rand = "0.8"
range-collections = "0.4.0"
redb = { version = "2.2.0", optional = true }
redb_v1 = { package = "redb", version = "1.5.1", 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"
Expand All @@ -61,9 +75,14 @@ tracing = "0.1"
tracing-futures = "0.2.5"
walkdir = { version = "2.5.0", optional = true }

# Examples
iroh = { version = "0.28", optional = true }
console = { version = "0.15.8", optional = true }

[dev-dependencies]
http-body = "1.0"
iroh-test = { version = "0.28" }
iroh-net = { version = "0.28", features = ["test-utils"] }
futures-buffered = "0.2.4"
proptest = "1.0.0"
serde_json = "1.0.107"
Expand All @@ -78,14 +97,26 @@ futures-util = "0.3.30"
testdir = "0.9.1"

[features]
default = ["fs-store", "rpc", "net_protocol"]
default = ["fs-store", "rpc", "net_protocol", "example-iroh"]
downloader = ["dep:parking_lot", "tokio-util/time", "dep:hashlink"]
net_protocol = ["downloader"]
fs-store = ["dep:reflink-copy", "redb", "dep:redb_v1", "dep:tempfile"]
metrics = ["iroh-metrics/metrics"]
redb = ["dep:redb"]
cli = ["rpc", "dep:clap", "dep:indicatif", "dep:console"]
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"]
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",
]

example-iroh = ["dep:iroh", "dep:clap", "dep:indicatif", "dep:console"]

[package.metadata.docs.rs]
all-features = true
Expand All @@ -100,6 +131,22 @@ name = "fetch-fsm"
[[example]]
name = "fetch-stream"

[[example]]
name = "hello-world-fetch"
required-features = ["example-iroh"]

[[example]]
name = "hello-world-provide"
required-features = ["example-iroh"]

[[example]]
name = "local-swarm-discovery"
required-features = ["example-iroh"]

[[example]]
name = "custom-protocol"
required-features = ["example-iroh"]

[lints.rust]
missing_debug_implementations = "warn"

Expand Down Expand Up @@ -134,4 +181,4 @@ iroh-router = { git = "https://github.com/n0-computer/iroh", branch = "main" }
iroh-net = { git = "https://github.com/n0-computer/iroh", branch = "main" }
iroh-metrics = { git = "https://github.com/n0-computer/iroh", branch = "main" }
iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main" }

iroh = { git = "https://github.com/n0-computer/iroh", branch = "main" }
Loading

0 comments on commit 8ab19fe

Please sign in to comment.