@@ -5,18 +5,18 @@ use std::{
55
66use anyhow:: { Context , Result } ;
77pub 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 } ;
1010pub use iroh_gossip:: proto:: TopicId ;
1111use iroh_gossip:: {
1212 api:: { Event as GossipEvent , GossipSender } ,
13- net:: { Gossip , GOSSIP_ALPN } ,
13+ net:: { GOSSIP_ALPN , Gossip } ,
1414} ;
1515use n0_future:: {
16+ StreamExt ,
1617 boxed:: BoxStream ,
1718 task:: { self , AbortOnDropHandle } ,
1819 time:: { Duration , SystemTime } ,
19- StreamExt ,
2020} ;
2121use serde:: { Deserialize , Serialize } ;
2222use tokio:: sync:: { Mutex as TokioMutex , Notify } ;
@@ -73,7 +73,7 @@ pub struct ChatNode {
7373impl 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