Skip to content

Commit 2578c43

Browse files
author
“ramfox”
committed
adjust code to new iroh apis
1 parent 08e341a commit 2578c43

11 files changed

+40
-42
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,5 @@ incremental = false
187187

188188
[patch.crates-io]
189189
iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
190-
quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "main" }
190+
quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "patch-iroh-main" }
191191
iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }

deny.toml

+30-28
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1+
[advisories]
2+
ignore = [
3+
"RUSTSEC-2024-0370",
4+
"RUSTSEC-2024-0384",
5+
"RUSTSEC-2024-0436",
6+
"RUSTSEC-2023-0089",
7+
]
8+
19
[bans]
2-
multiple-versions = "allow"
310
deny = [
4-
"aws-lc",
5-
"aws-lc-rs",
6-
"aws-lc-sys",
7-
"native-tls",
8-
"openssl",
11+
"aws-lc",
12+
"aws-lc-rs",
13+
"aws-lc-sys",
14+
"native-tls",
15+
"openssl",
916
]
17+
multiple-versions = "allow"
1018

1119
[licenses]
1220
allow = [
13-
"Apache-2.0",
14-
"Apache-2.0 WITH LLVM-exception",
15-
"BSD-2-Clause",
16-
"BSD-3-Clause",
17-
"BSL-1.0", # BOSL license
18-
"ISC",
19-
"MIT",
20-
"Zlib",
21-
"MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/
22-
"Unicode-3.0",
23-
"Unlicense", # https://unlicense.org/
21+
"Apache-2.0",
22+
"Apache-2.0 WITH LLVM-exception",
23+
"BSD-2-Clause",
24+
"BSD-3-Clause",
25+
"BSL-1.0",
26+
"ISC",
27+
"MIT",
28+
"Zlib",
29+
"MPL-2.0",
30+
"Unicode-3.0",
31+
"Unlicense",
2432
]
2533

2634
[[licenses.clarify]]
27-
name = "ring"
2835
expression = "MIT AND ISC AND OpenSSL"
29-
license-files = [
30-
{ path = "LICENSE", hash = 0xbd0eed23 },
31-
]
36+
name = "ring"
3237

33-
[advisories]
34-
ignore = [
35-
"RUSTSEC-2024-0370", # unmaintained, no upgrade available
36-
"RUSTSEC-2024-0384", # unmaintained, no upgrade available
37-
"RUSTSEC-2024-0436", # unmaintained paste
38-
"RUSTSEC-2023-0089", # unmaintained, no upgrade available yet
39-
]
38+
[[licenses.clarify.license-files]]
39+
hash = 3171872035
40+
path = "LICENSE"
4041

4142
[sources]
4243
allow-git = [
4344
"https://github.com/n0-computer/iroh.git",
45+
"https://github.com/n0-computer/quic-rpc.git",
4446
]

examples/custom-protocol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async fn main() -> Result<()> {
9797

9898
// Add our protocol, identified by our ALPN, to the node, and spawn the node.
9999
let builder = builder.accept(ALPN, proto.clone());
100-
let node = builder.spawn().await?;
100+
let node = builder.spawn();
101101

102102
match args.command {
103103
Command::Listen { text } => {

examples/discovery-local-network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async fn main() -> anyhow::Result<()> {
7373
let builder = Router::builder(endpoint);
7474
let blobs = Blobs::memory().build(builder.endpoint());
7575
let builder = builder.accept(iroh_blobs::ALPN, blobs.clone());
76-
let node = builder.spawn().await?;
76+
let node = builder.spawn();
7777
let blobs_client = blobs.client();
7878

7979
match &cli.command {

examples/hello-world-fetch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async fn main() -> Result<()> {
3939
let builder = Router::builder(endpoint);
4040
let blobs = Blobs::memory().build(builder.endpoint());
4141
let builder = builder.accept(iroh_blobs::ALPN, blobs.clone());
42-
let node = builder.spawn().await?;
42+
let node = builder.spawn();
4343
let blobs_client = blobs.client();
4444

4545
println!("fetching hash: {}", ticket.hash());

examples/hello-world-provide.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async fn main() -> anyhow::Result<()> {
2727
let blobs = Blobs::memory().build(builder.endpoint());
2828
let builder = builder.accept(iroh_blobs::ALPN, blobs.clone());
2929
let blobs_client = blobs.client();
30-
let node = builder.spawn().await?;
30+
let node = builder.spawn();
3131

3232
// add some data and remember the hash
3333
let res = blobs_client.add_bytes("Hello, world!").await?;

examples/transfer.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ async fn main() -> Result<()> {
2222
// to the blobs protocol.
2323
let router = Router::builder(endpoint)
2424
.accept(iroh_blobs::ALPN, blobs.clone())
25-
.spawn()
26-
.await?;
25+
.spawn();
2726

2827
// We use a blobs client to interact with the blobs protocol we're running locally:
2928
let blobs_client = blobs.client();

src/rpc/client/blobs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ mod tests {
10831083
router = router.accept(crate::ALPN, blobs.clone());
10841084

10851085
// Build the router
1086-
let router = router.spawn().await?;
1086+
let router = router.spawn();
10871087

10881088
// Setup RPC
10891089
let (internal_rpc, controller) = quic_rpc::transport::flume::channel(32);

tests/gc.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ async fn node<S: Store>(store: S, gc_period: Duration) -> (Node<S>, async_channe
101101
let blobs = Blobs::builder(store.clone()).build(&endpoint);
102102
let router = Router::builder(endpoint)
103103
.accept(iroh_blobs::ALPN, blobs.clone())
104-
.spawn()
105-
.await
106-
.unwrap();
104+
.spawn();
107105
blobs
108106
.start_gc(GcConfig {
109107
period: gc_period,

tests/rpc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ impl Node {
2525
let blobs = Blobs::builder(store).build(&endpoint);
2626
let router = iroh::protocol::Router::builder(endpoint)
2727
.accept(iroh_blobs::ALPN, blobs.clone())
28-
.spawn()
29-
.await?;
28+
.spawn();
3029
let (config, key) = quic_rpc::transport::quinn::configure_server()?;
3130
let endpoint = quinn::Endpoint::server(config, "127.0.0.1:0".parse().unwrap())?;
3231
let local_addr = endpoint.local_addr()?;

0 commit comments

Comments
 (0)