Skip to main content

Crate rusty_esp_iroh_core

Crate rusty_esp_iroh_core 

Source
Expand description

rusty_esp_iroh-core — the Janus mesh protocols, with no sockets in them.

iroh itself runs on Track A only (rusty_esp_iroh-esp) and on hosts (rusty_esp_iroh-host). What every node, host, bridge and no_std neighbour must agree on lives here, testable on a laptop:

modulewhat
alpnthe ALPN strings and frame limits
ticketthe QR / serial rendezvous ticket: endpoint id, DID, relay, addresses — janus1… text, no heap
bindingthe device key’s signature over its iroh EndpointId — how a DID resolves to an endpoint
assertionthe caller’s mID assertion every RPC carries (the kms nonce-envelope shape)
rpcjanus/rpc/1: postcard requests and responses with length-prefixed framing, and the authorisation rule
mediajanus/media/1: subscribe message and the packet header
sidecarmata-oem-sidecar/rpc/1: the home computer’s existing JSON RPC and mDNS TXT contract, answered by a device

Rules (from the Janus mission plan): no_std by default; alloc is a feature; nothing here allocates on a per-packet path except the postcard codec, which is what alloc is for; every type that crosses to another Janus package comes from rusty_esp_core or rusty_esp_mid-core; forbid(unsafe).

Re-exports§

pub use binding::Binding;
pub use ticket::Ticket;
pub use rusty_esp_core as esp_core;
pub use rusty_esp_mid_core as mid;

Modules§

alpn
The protocol names and the frame limits every side agrees on.
assertion
The caller’s mID assertion every janus/rpc/1 request carries.
base32
RFC 4648 base32, lowercase, unpadded — the alphabet iroh’s own tickets use — over caller buffers.
binding
The DID-to-endpoint binding: the device’s P-256 key signs its ed25519 iroh EndpointId, so anyone holding the DID can check that an endpoint is that device — the mesh notes’ “publish the endpoint on the identity anchor”, and the family’s only use of ed25519 (iroh requires it).
media
janus/media/1: a subscriber opens the connection, sends one Subscribe frame on a bi-stream, and the device answers with packets — each a fixed 24-byte PacketHeader followed by the payload — as QUIC datagrams when they fit crate::alpn::MAX_MEDIA_DATAGRAM and as uni-streams otherwise. The header is what rusty_esp_video’s and rusty_esp_audio’s packets already carry: a sequence number, the device-monotonic timestamp, a codec tag and flags.
ota
OTA over iroh (N5): a maker-signed image manifest, the bytes streamed behind it, and the two-slot sink that makes a bad image harmless.
prelude
The names a firmware or a host wants in scope.
rpc
janus/rpc/1: one request and one response per bi-stream, each a length-prefixed postcard frame; every request may carry the caller’s mID Assertion, and the device’s authorisation rule decides what an unauthenticated caller may ask.
sidecar
mata-oem-sidecar/rpc/1 and _mata-oem-sidecar._tcp.local.: the home computer’s existing contract for a maker’s box, answered by a Janus device so it shows up in the owner app on day one with no home-computer change. Shapes and field names follow mata-oem-sidecar (hardware-deployer-core::wire, hardware-deployer-api::{rpc, mesh}) and what home-computer-pair-client::discovery reads back.
ticket
The rendezvous ticket a device shows as a QR code or prints on serial: how to dial it (iroh endpoint id, optional relay and direct addresses) and who it is (its did:mata). No heap; fixed-size fields.

Constants§

VERSION
Crate version, for capability manifests and logs.