Expand description
The mesh declaration: whether this repository’s servers participate in discovery, and
how. One typed object of the .ai/ layer (kind mesh, schema mesh/v1), parsed
here and nowhere else. No declaration, or enabled: false, means the mesh is off and
not one socket opens — the repository’s default posture (“nothing leaves the
machine”) holds until a person commits the object that says otherwise.
use majordomus_cli::mesh::config::{MeshConfig, BroadcastMode};
// The defaults are the safe ones: multicast prepared, broadcast off, nobody trusted.
let minimal: MeshConfig = serde_json::from_value(serde_json::json!({
"schema": "mesh/v1", "kind": "mesh-declaration", "id": "docs", "enabled": false
})).unwrap();
assert!(!minimal.enabled);
assert_eq!(minimal.broadcast.mode, BroadcastMode::Disabled);
assert!(minimal.trust.allow.is_empty());Structs§
- Broadcast
Config - Broadcast settings: the fallback’s mode, destinations and cadence;
disabledunless a person declared otherwise. - Cooperation
Config - Cooperation settings: whether this runtime links to the trusted runtimes of its repository, how often it proves it is alive, when a silent runtime counts as gone, and which endpoints to dial when discovery cannot find them.
- Mesh
Config - The whole declaration: the master switch and one section per mechanism. Unknown keys are refused, so a typo is an error and not a silently ignored wish.
- Multicast
Config - Multicast settings: the group, the port, how far a datagram travels and how often this node announces.
- Rendezvous
Config - Rendezvous settings: other Majordomus servers to register with. Plain HTTP on a private network; there is no TLS in this executable, and the protocol assumes none — candidates verify end-to-end by signature, a poisoned rendezvous can withhold nodes but not invent them.
- Trust
Config - Trust settings: the policy, and the public keys trusted regardless of it.
Enums§
- Broadcast
Mode - Broadcast mode: off, automatic (the limited broadcast address), or explicit networks.
Constants§
- DEFAULT_
EXPIRY - The default seconds of silence before a runtime expires.
- DEFAULT_
GROUP - The default multicast group: an address in the IPv4 organization-local scope (239.0.0.0/8, RFC 2365), chosen once here.
- DEFAULT_
HEARTBEAT - The default seconds between cooperation heartbeats.
- DEFAULT_
INTERVAL - The default seconds between announcements.
- DEFAULT_
PORT - The default UDP port for multicast and broadcast datagrams.
- KIND
- The kind the declaration is discovered under.
- SCHEMA_
VERSION - The schema version this executable reads.