You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(iroh)!: introduce transport abstraction (#3279)
A first step towards the work of #3276
## Breaking changes
- `iroh::watcher` is now its own crate `n0-watcher`
- `iroh::endpoint::Endpoint::node_addr` now returns `impl Watcher<Value
= Option<NodeAddr>>`
- `iroh::endpoint::Endpoint::home_relay` now returns `impl Watcher<Value
= Vec<RelayUrl>>`
- `iroh::endpoint::Endpoint::bound_sockets` now returns
`Vec<SocketAddr>`
- `iroh-quinn` is updated to `0.14.0`
Depends on
- [x] n0-computer/n0-watcher#1
- [x] n0-computer/net-tools#26
- [x] n0-computer/quinn#67
- [x] n0-computer/n0-watcher#3
---------
Co-authored-by: Franz Heinzmann <[email protected]>
Copy file name to clipboardExpand all lines: iroh/examples/connect.rs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@
8
8
use std::net::SocketAddr;
9
9
10
10
use clap::Parser;
11
-
use iroh::{watcher::Watcheras _,Endpoint,NodeAddr,RelayMode,RelayUrl,SecretKey};
11
+
use iroh::{Endpoint,NodeAddr,RelayMode,RelayUrl,SecretKey};
12
12
use n0_snafu::{Result,ResultExt};
13
+
use n0_watcher::Watcheras _;
13
14
use tracing::info;
14
15
15
16
// An example ALPN that we are using to communicate over the `Endpoint`
@@ -67,6 +68,8 @@ async fn main() -> Result<()> {
67
68
.home_relay()
68
69
.get()
69
70
.unwrap()
71
+
.first()
72
+
.cloned()
70
73
.expect("should be connected to a relay server, try calling `endpoint.local_endpoints()` or `endpoint.connect()` first, to ensure the endpoint has actually attempted a connection before checking for the connected relay server");
71
74
println!("node relay server url: {relay_url}\n");
72
75
// Build a `NodeAddr` from the node_id, relay url, and UDP addresses.
0 commit comments