Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
107 changes: 62 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ derive_more = { version = "2.0.1", features = ["from", "try_from", "into", "debu
futures-lite = "2.6.0"
quinn = { package = "iroh-quinn", version = "0.14.0" }
n0-future = "0.3.0"
n0-snafu = "0.2.2"
range-collections = { version = "0.4.6", features = ["serde"] }
smallvec = { version = "1", features = ["serde", "const_new"] }
snafu = "0.8.5"
tokio = { version = "1.43.0", features = ["full"] }
tokio-util = { version = "0.7.13", features = ["full"] }
tracing = "0.1.41"
Expand All @@ -33,7 +31,6 @@ serde = "1.0.217"
postcard = { version = "1.1.1", features = ["experimental-derive", "use-std"] }
data-encoding = "2.8.0"
chrono = "0.4.39"
nested_enum_utils = "0.2.1"
ref-cast = "1.0.24"
arrayvec = "0.7.6"
iroh = "0.94"
Expand All @@ -42,9 +39,11 @@ genawaiter = { version = "0.99.1", features = ["futures03"] }
iroh-base = "0.94"
iroh-tickets = "0.1"
irpc = { version = "0.10.0", features = ["rpc", "quinn_endpoint_setup", "spans", "stream", "derive"], default-features = false }
iroh-metrics = { version = "0.36" }
iroh-metrics = { version = "0.37" }
redb = { version = "2.6.3", optional = true }
reflink-copy = { version = "0.1.24", optional = true }
n0-error = "0.1.0"
nested_enum_utils = "0.2.3"

[dev-dependencies]
clap = { version = "4.5.31", features = ["derive"] }
Expand All @@ -69,3 +68,9 @@ hide-proto-docs = []
metrics = []
default = ["hide-proto-docs", "fs-store"]
fs-store = ["dep:redb", "dep:reflink-copy"]

[patch.crates-io]
iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
irpc = { git = "https://github.com/n0-computer/irpc.git", branch = "matheus23/irpc-n0-error" }
n0-error = { git = "https://github.com/n0-computer/n0-error.git", branch = "Frando/arc-stack" }
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ Here is a basic example of how to set up `iroh-blobs` with `iroh`:
```rust,no_run
use iroh::{protocol::Router, Endpoint};
use iroh_blobs::{store::mem::MemStore, BlobsProtocol, ticket::BlobTicket};
use n0_error::{Result, StdResultExt};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we decided to use anyhow in examples, how about we also keep using anyhow in the readme, which is kinda an example?

async fn main() -> Result<()> {
// create an iroh endpoint that includes the standard discovery mechanisms
// we've built at number0
let endpoint = Endpoint::bind().await?;

// create a protocol handler using an in-memory blob store.
let store = MemStore::new();
let tag = store.add_slice(b"Hello world").await?;

let _ = endpoint.online().await;
let addr = endpoint.addr();
let ticket = BlobTicket::new(addr, tag.hash, tag.format);
Expand All @@ -62,7 +63,7 @@ async fn main() -> anyhow::Result<()> {
tokio::signal::ctrl_c().await;

// clean shutdown of router and store
router.shutdown().await?;
router.shutdown().await.anyerr()?;
Ok(())
}
```
Expand All @@ -86,4 +87,4 @@ at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
shall be dual licensed as above, without any additional terms or conditions.
Loading
Loading