Expand description
Edge-side fleet self-registration.
When this node is configured with a control-plane URL (HELDAR_CP_URL), its own reachable URL
(HELDAR_PUBLIC_BASE_URL) and a site id (HELDAR_SITE_ID), it POSTs its identity to the control
plane’s POST /api/v1/fleet/nodes on boot and on a heartbeat cadence. The control plane then drains
this node’s outbox without any static config or restart — “add a node and it joins the fleet”.
Registration is idempotent (the control plane upserts on node id), so the heartbeat also re-teaches a control plane that restarted or lost its registry. The reported token is the bearer the control plane presents when draining this node’s outbox; when this node runs with auth disabled (the LAN default) it can be empty.
This is a pure outbound HTTP client — the kernel has NO code dependency on the control-plane crate;
the only seam is the configurable URL. The fleet is strictly opt-in: with HELDAR_CP_URL unset (the
default) this loop parks forever and the node never phones home.
Functions§
- run
- Edge-side self-registration loop. Parks forever unless fully configured for the fleet (control-plane URL + this node’s site id + this node’s reachable URL); otherwise POSTs its identity on boot and on every heartbeat. Never returns (returning would have the supervisor respawn it).