File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
- use std:: sync:: Arc ;
1
+ use std:: { sync:: Arc } ;
2
2
3
3
use anyhow:: Result ;
4
4
use futures:: future:: { BoxFuture , FutureExt } ;
Original file line number Diff line number Diff line change @@ -36,12 +36,16 @@ impl Config {
36
36
}
37
37
38
38
/// Publish node announces to a pkarr relay.
39
- #[ derive( Debug ) ]
39
+ #[ derive( derive_more :: Debug ) ]
40
40
pub struct Publisher {
41
41
node_id : NodeId ,
42
+ #[ debug( "SigningKey" ) ]
42
43
signing_key : SigningKey ,
44
+ #[ debug( "{}" , self . pkarr_relay) ]
43
45
pkarr_relay : Url ,
46
+ #[ debug( "PkarrClient" ) ]
44
47
pkarr_client : PkarrClient ,
48
+ #[ debug( skip) ]
45
49
last_announce : RwLock < Option < NodeAnnounce > >
46
50
}
47
51
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use hickory_resolver::{
8
8
AsyncResolver , Name ,
9
9
} ;
10
10
use iroh_net:: { AddrInfo , NodeAddr , NodeId } ;
11
+ use tracing:: debug;
11
12
12
13
use crate :: packet:: { NodeAnnounce , IROH_NODE_TXT_LABEL } ;
13
14
@@ -60,9 +61,10 @@ impl Config {
60
61
}
61
62
62
63
/// Resolve iroh nodes through DNS
63
- #[ derive( Debug , Clone ) ]
64
+ #[ derive( derive_more :: Debug , Clone ) ]
64
65
pub struct Resolver {
65
66
default_node_origin : Name ,
67
+ #[ debug( "HickoryResolver" ) ]
66
68
dns_resolver : HickoryResolver ,
67
69
}
68
70
@@ -90,8 +92,11 @@ impl Resolver {
90
92
}
91
93
92
94
pub async fn resolve_node_by_id ( & self , node_id : NodeId ) -> Result < AddrInfo > {
95
+ debug ! ( ?node_id, "resolve node by id" ) ;
93
96
let name = Name :: parse ( & node_id. to_string ( ) , Some ( & self . default_node_origin ) ) ?;
94
- let addr = self . resolve_node ( name) . await ?;
97
+ let addr = self . resolve_node ( name) . await ;
98
+ debug ! ( ?node_id, ?addr, "resolved" ) ;
99
+ let addr = addr?;
95
100
Ok ( addr. info )
96
101
}
97
102
You can’t perform that action at this time.
0 commit comments