Skip to content

Commit 8d4176a

Browse files
ramfox“ramfox”
andauthored
chore: upgrade iroh-examples to latest iroh versions (#137)
* chore: upgrade browser-echo example * chore: upgrade browser-chat * chore: upgrade extism * chore: upgrade iroh-automerge-repo * chore: upgrade iroh-automerge * chore: upgrade iroh-gateway * chore: upgrade tauri-todos * chore: upgrade dumbpipe-web * chore: upgrade framed-messages * chore: fix check * chore: fix wasm builds --------- Co-authored-by: “ramfox” <“[email protected]”>
1 parent 1b03cb6 commit 8d4176a

File tree

31 files changed

+4902
-3854
lines changed

31 files changed

+4902
-3854
lines changed

browser-chat/Cargo.lock

Lines changed: 225 additions & 167 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browser-chat/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ members = ["shared", "cli", "browser-wasm"]
44

55
[workspace.dependencies]
66
# we define iroh dependencies here to make upgrading easier.
7-
iroh = { version = "0.91", default-features = false }
8-
iroh-base = { version = "0.91", default-features = false, features = ["ticket"] }
9-
iroh-gossip = { version = "0.91", default-features = false, features = ["net"] }
7+
iroh = { version = "0.93", default-features = false }
8+
iroh-base = { version = "0.93", default-features = false, features = ["ticket"] }
9+
iroh-gossip = { version = "0.93", default-features = false, features = ["net"] }

browser-chat/browser-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ serde-wasm-bindgen = "0.6.5"
1717
tracing = "0.1.40"
1818
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
1919
tracing-subscriber-wasm = "0.1.0"
20-
wasm-bindgen = "=0.2.100"
20+
wasm-bindgen = "=0.2.104"
2121
wasm-bindgen-futures = "0.4"
2222
wasm-streams = "0.4.2"
2323

browser-chat/browser-wasm/src/lib.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ use std::{
55

66
use anyhow::Result;
77
use chat_shared::{ChatSender, ChatTicket, NodeId, TopicId};
8-
use n0_future::{time::Duration, StreamExt};
8+
use n0_future::{StreamExt, time::Duration};
99
use serde::{Deserialize, Serialize};
1010
use tracing::level_filters::LevelFilter;
1111
use tracing_subscriber_wasm::MakeConsoleWriter;
12-
use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue};
12+
use wasm_bindgen::{JsError, JsValue, prelude::wasm_bindgen};
1313
use wasm_streams::ReadableStream;
1414

1515
#[wasm_bindgen(start)]
@@ -49,15 +49,6 @@ impl ChatNode {
4949
self.0.node_id().to_string()
5050
}
5151

52-
/// Returns information about all the remote nodes this [`Endpoint`] knows about.
53-
pub fn remote_info(&self) -> Vec<JsValue> {
54-
self.0
55-
.remote_info()
56-
.into_iter()
57-
.map(|value| serde_wasm_bindgen::to_value(&value).unwrap())
58-
.collect()
59-
}
60-
6152
/// Opens a chat.
6253
pub async fn create(&self, nickname: String) -> Result<Channel, JsError> {
6354
// let ticket = ChatTicket::new(topic);

browser-chat/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ anyhow = "1.0.95"
88
clap = { version = "4.5.29", features = ["derive"] }
99
iroh = { workspace = true, default-features = false }
1010
n0-future = "0.1.2"
11-
rand = "0.8"
11+
rand = "0.9.2"
1212
chat-shared = { version = "0.1.0", path = "../shared" }
1313
tokio = { version = "1.43.0", features = ["rt", "macros"] }
1414
tracing-subscriber = "0.3.19"

browser-chat/cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async fn main() -> Result<()> {
3434

3535
let secret_key = match std::env::var("IROH_SECRET") {
3636
Err(_) => {
37-
let secret_key = SecretKey::generate(rand::rngs::OsRng);
37+
let secret_key = SecretKey::generate(&mut rand::rng());
3838
println!("* using new secret. to reuse, set this environment variable:");
3939
println!(
4040
"IROH_SECRET={}",

browser-chat/shared/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ iroh-base = { workspace = true, default-features = false, features = ["ticket"]
1212
iroh-gossip = { workspace = true, default-features = false, features = ["net"] }
1313
n0-future = "0.1.2"
1414
postcard = "1.1.1"
15-
rand = "0.8"
15+
rand = "0.9.2"
1616
serde = "1"
1717
tokio = { version = "1", default-features = false, features = ["sync"] }
1818
tracing = "0.1"

browser-chat/shared/src/lib.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ use std::{
55

66
use anyhow::{Context, Result};
77
pub use iroh::NodeId;
8-
use iroh::{endpoint::RemoteInfo, protocol::Router, PublicKey, SecretKey};
9-
use iroh_base::{ticket::Ticket, Signature};
8+
use iroh::{PublicKey, SecretKey, protocol::Router};
9+
use iroh_base::{Signature, ticket::Ticket};
1010
pub use iroh_gossip::proto::TopicId;
1111
use iroh_gossip::{
1212
api::{Event as GossipEvent, GossipSender},
13-
net::{Gossip, GOSSIP_ALPN},
13+
net::{GOSSIP_ALPN, Gossip},
1414
};
1515
use n0_future::{
16+
StreamExt,
1617
boxed::BoxStream,
1718
task::{self, AbortOnDropHandle},
1819
time::{Duration, SystemTime},
19-
StreamExt,
2020
};
2121
use serde::{Deserialize, Serialize};
2222
use tokio::sync::{Mutex as TokioMutex, Notify};
@@ -73,7 +73,7 @@ pub struct ChatNode {
7373
impl ChatNode {
7474
/// Spawns a gossip node.
7575
pub async fn spawn(secret_key: Option<SecretKey>) -> Result<Self> {
76-
let secret_key = secret_key.unwrap_or_else(|| SecretKey::generate(rand::rngs::OsRng));
76+
let secret_key = secret_key.unwrap_or_else(|| SecretKey::generate(&mut rand::rng()));
7777
let endpoint = iroh::Endpoint::builder()
7878
.secret_key(secret_key.clone())
7979
.discovery_n0()
@@ -103,14 +103,6 @@ impl ChatNode {
103103
self.router.endpoint().node_id()
104104
}
105105

106-
/// Returns information about all the remote nodes this [`Endpoint`] knows about.
107-
pub fn remote_info(&self) -> Vec<RemoteInfo> {
108-
self.router
109-
.endpoint()
110-
.remote_info_iter()
111-
.collect::<Vec<_>>()
112-
}
113-
114106
/// Joins a chat channel from a ticket.
115107
///
116108
/// Returns a [`ChatSender`] to send messages or change our nickname

0 commit comments

Comments
 (0)