status shows each home relay: connected, down with the error, or denied

iroh 1.3's home_relay_status, on GlobalStatus as relays (absent when
empty, so older clients parse it). The thing we lacked when fetches
timed out: whether this daemon can be reached through a relay at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Bendik Aagaard Lynghaug
2026-10-03 14:08:41 +02:00
co-authored by Claude Fable 5.1
parent 7916e59acb
commit 7322812524
4 changed files with 57 additions and 1 deletions
+9
View File
@@ -272,6 +272,15 @@ fn print_human(data: Option<&ResponseData>) {
println!("store: {}", s.store_path);
println!("pins: {}", s.pins);
println!("peers: {} connected", s.connected_peers);
for r in &s.relays {
let how = match (&r.auth_denied, &r.last_error, r.connected) {
(Some(reason), _, _) => format!("denied: {reason}"),
(None, Some(err), false) => format!("down: {err}"),
(None, None, false) => "connecting".to_string(),
(None, _, true) => "connected".to_string(),
};
println!("relay: {} {how}", r.url);
}
}
ResponseData::HashStatus(h) => {
println!("hash: {}", h.hash);