@@ -247,17 +247,17 @@ Running the accept side prints a ticket that we need to connect. We want this to
247
247
```
248
248
Listening on: NodeAddr { node_id: PublicKey(e7c3b8c21ad4393c1d21c2ca05c5e9fdb6492aa2f077ae776a6fe6d0c5ff3dd7), relay_url: None, direct_addresses: {5.223.43.41:34981, [2a01:4ff:2f0:14d4::1]:34982} }
249
249
Node ID: PublicKey(e7c3b8c21ad4393c1d21c2ca05c5e9fdb6492aa2f077ae776a6fe6d0c5ff3dd7)
250
- Ticket: nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe
250
+ Ticket: nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae
251
251
```
252
252
253
253
## Connect side
254
254
255
255
On the connect side, we just need to specify the node ticket to connect to and optionally the number of rounds.
256
256
257
257
```
258
- ❯ RUST_LOG=0rtt=trace cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe
258
+ ❯ RUST_LOG=0rtt=trace cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae
259
259
Finished `release` profile [optimized + debuginfo] target(s) in 0.17s
260
- Running `target/release/examples/0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe `
260
+ Running `target/release/examples/0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae `
261
261
2025-05-27T11:13:09.846859Z TRACE 0rtt: 0-RTT not possible from our side
262
262
round 0: 537464 us
263
263
2025-05-27T11:13:10.384057Z TRACE 0rtt: 0-RTT possible from our side
@@ -334,10 +334,10 @@ So you would use 0-RTT if communication is in small bursts spaced many minutes t
334
334
So this is the option we ended up implementing. Here is the output after this modification. We now get a 0-rtt connection every time.
335
335
336
336
```
337
- ❯ RUST_LOG=0rtt=trace cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe
337
+ ❯ RUST_LOG=0rtt=trace cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae
338
338
Compiling iroh v0.35.0 (/Users/rklaehn/projects_git/iroh/iroh)
339
339
Finished `release` profile [optimized + debuginfo] target(s) in 16.63s
340
- Running `target/release/examples/0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe `
340
+ Running `target/release/examples/0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae `
341
341
2025-05-27T11:17:11.384959Z TRACE 0rtt: 0-RTT not possible from our side
342
342
round 0: 556011 us
343
343
2025-05-27T11:17:11.941692Z TRACE 0rtt: 0-RTT possible from our side
@@ -440,7 +440,7 @@ cargo run --release --features=examples --example 0rtt <ticket>
440
440
You can also connect to our test node that should be far away from most readers of this blog post:
441
441
442
442
```
443
- cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjuwiqeajkaecp6axqctkaaaaaaaaaaaabu2iqe
443
+ cargo run --release --features examples --example 0rtt nodeadt4hogcdlkdspa5ehbmubof5h63msjkulyhpltxnjx6nugf7465oaacaac56kzjrtxaeajkaecp6axqctkaaaaaaaaaaaabrxxae
444
444
```
445
445
446
446
You can disable 0-rtt using the ` --disable-0rtt ` arg. Since the node above is far away, you should see a noticeable difference.
0 commit comments