pub struct SelfNetwork {
pub online: bool,
pub home_relay: Option<String>,
pub relays: Vec<RelayInfo>,
pub direct_addrs: Vec<String>,
pub last_change_epoch: Option<i64>,
pub presence_mode: Option<String>,
pub identity_conflict_epoch: Option<i64>,
}Expand description
The status.self_network block (#90): THIS node’s own reachability posture — the first
question in every “my message never arrived” investigation, previously unanswerable from
either side of the API. Self-facing only: everything here is the node’s own information
(relay URLs come from its own config, sanitized; direct addresses already ride its invites).
online is iroh’s own semantics — a home-relay connection is established. In
relay_mode = "disabled" it is ALWAYS false with an empty relays list: that is a
configuration, not an outage — render it as “LAN-only”, never as a health warning.
Additive-only.
Default is {online: false, relays: []} — which is exactly the shape above meaning
“deliberately LAN-only” (#148). The porcelain reads it that way and SUPPRESSES the “no relay
connection” line for it. So a fixture built with ..Default::default() claims a healthy
LAN-only posture, not an unknown one. There is no third value for a bool; the honest way to
say “nobody looked” is StatusResult.self_network: None, which is what a defaulted
StatusResult gives you.
Fields§
§online: boolA home-relay connection is established (iroh’s online definition). The signal #53’s
set_relays never had: when this goes false on a relay-enabled node, the relay set is
the thing to look at.
home_relay: Option<String>The CONNECTED home relay’s URL, sanitized to scheme + host + port (operator-supplied
relay URLs can carry userinfo tokens; status output gets screenshotted). None when
no relay is connected.
relays: Vec<RelayInfo>Every known home relay and its current connection state. Empty when no relays are configured, or before the endpoint has selected any.
direct_addrs: Vec<String>This endpoint’s direct (non-relay) socket addresses — its own dialable coordinates.
last_change_epoch: Option<i64>When the daemon’s watcher last observed a TRANSITION (epoch seconds) — a change of
online, home_relay, or a relay’s connection state; direct_addrs drift alone does
not stamp (nor emit a frame). OMITTED (not null) until the first observed transition
after boot, and from a point-in-time computation with no watcher running.
presence_mode: Option<String>This node’s [network].presence_mode (#89): "paired" | "granted" | "off" — who
currently gets an answer to the mcpmesh/ping/1 reachability probe.
Reported because the setting was otherwise unobservable: an operator who set it had no
way to confirm it took effect, and a product backing a privacy switch with it could not show
the user its real state. Always present from api_minor >= 38.
It is not “appear offline”. It withholds the pong payload and makes our own probe report
this node unreachable; it does not hide that the node is running (a QUIC application close
implies a completed handshake, and mcpmesh/pair/1 answers any stranger by design). Do not
render it to users as invisibility.
identity_conflict_epoch: Option<i64>When the relay last reported that ANOTHER endpoint is presenting this node’s identity (#134, epoch seconds), or absent if never — the overwhelmingly common case.
Two nodes booted from COPIES of one mesh root share an endpoint id. The relay can serve only one, so the displaced node’s peers simply go unreachable with nothing saying why; diagnosing that cost a downstream real time. This is that missing “why”.
Sticky, and a timestamp rather than a flag. The condition is announced once, as the
displaced connection is dropped — it is not a state the relay keeps reporting — so a
self-clearing flag would read false by the time anyone called status. Judge staleness from
the epoch, exactly as with last_change_epoch.
Absence is not proof of uniqueness. Detection needs an
IdentityConflictLayer in the process’s tracing subscriber: the standalone daemon
installs one at boot, but an EMBEDDED node cannot (a subscriber is global and the host owns
it) and reports None until the host installs it. Never render absence as “identity
verified unique”.
Additive: #[serde(default, skip_serializing_if = "Option::is_none")]. api_minor >= 32.
Trait Implementations§
Source§impl Clone for SelfNetwork
impl Clone for SelfNetwork
Source§fn clone(&self) -> SelfNetwork
fn clone(&self) -> SelfNetwork
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more