Skip to main content

Module global_registry

Module global_registry 

Source
Expand description

GlobalRegistry — federation membership protocol with two halves.

  • GlobalRegistryClient: bound on every client Node. Records an Announce op whose server_peer input wires the bootstrap-server identity through the graph (no struct field). On dispatch the client ships an envelope carrying ctx.current.self_peer to the server’s well-known GLOBAL_REGISTRY_SERVER_CREF component, then refreshes its TTL/heartbeat state from the server’s Handshake reply.

  • GlobalRegistryServer: bound on the server Node. Accepts inbound Announce envelopes, registers the announcing peer in the runtime AddressBook under a server-assigned TTL, and replies with a Handshake carrying (assigned_ttl_ns, heartbeat_interval_ns). Lazy eviction runs at the top of every Sample / CurrentView read.

The protocol carries no static peer identity on either side: the client wires server_peer via graph input, and the server reads the announcing peer from the inbound payload.

Structs§

GlobalRegistryClient
Client half of GlobalRegistry. Holds TTL / heartbeat state echoed from the server’s most recent Handshake; the server peer is wired through the graph at every Announce and is not a struct field.
GlobalRegistryServer
Server half of GlobalRegistry. Maintains PeerId → (expires_at_ns, source_address) over the announced cohort and exposes the cohort as a bb_runtime::contracts::PeerSelector source. Eviction is lazy: Sample / CurrentView drop entries whose expires_at_ns has elapsed before consulting the registry.
GlobalRegistryServerConfig
Per-deployment knobs for GlobalRegistryServer. All durations are in nanoseconds. Defaults follow the deep-research bound: 90 s TTL, 30 s floor, 5 min ceiling.
Handshake
Handshake payload the server replies with on a successful Announce. The client decodes TTL/heartbeat state and merges server_addresses into its [AddressBook] entry for the server peer so subsequent dial attempts can pick any reachable endpoint.

Constants§

GLOBAL_REGISTRY_CLIENT_CREF
Well-known ComponentRef the server addresses the client’s GlobalRegistryClient component at when delivering Handshake replies. Pinned on both sides.
GLOBAL_REGISTRY_DOMAIN
Atomic-op opset domain shared by both halves.
GLOBAL_REGISTRY_SERVER_CREF
Well-known ComponentRef the client addresses the server’s GlobalRegistryServer component at. Pinned on both sides; a production deployment would resolve via discovery.