auki-network
This page mirrors crates/auki-network/README.md in the auki-sdk repo (branch develop).
The repository is the source of truth.
The libp2p substrate for the SDK and the Discovery HTTP client. Behind the swarm feature: TCP/QUIC transport, Noise, Yamux, Circuit Relay v2, identify, ping, and a native helper for reserving a relay-mediated Manager address through a Domain Relay. On top: the typed /auki/stream/0.2.0 stream protocol and the peer-to-peer control protocols (join, heartbeat, membership, info, resources, registries). The Discovery client carries both Manager multiaddrs and optional Relay multiaddrs for browser-compatible reachability hints.
Peer identity is derived from a wallet: Wallet::derive_child("peer/v1"). The app_instance value is MAC-derived per machine.
Status: Shipped.
Public surface
- Types:
PeerIdentity,ParticipantInfo,ReachabilityRecord,Capability - Modules:
swarm,network_runtime,join_protocol,heartbeat_protocol,membership_protocol,info_protocol,resources_protocol,stream_protocol,stream_runtime,app_instance,discovery_client SessionHandletrait — implemented byauki_session::Session; called by the resources protocol handler to serve catalog rows to remote peers. Defined here to break the potentialauki-domain↔auki-sessioncycle.- Resource catalog protocol
/auki/resources/0.2.0:ResourceEntryrows discriminated byvariant(sensor_log|pose_log|time_transform_log|detection_log). Each row hassource_peer_id,writer_peer_id,resource_id,state,head|extent,available, optionalsensorblock (only onsensor_log:kind/type/sensor_id/sensor_hash), optionalposeblock (only onpose_log:writer_mode), and a variant-specificmanifestpointer. Replaces the oldSensorStreamResource/TransformEdgeResource/PoseStreamResourcetypes. /auki/resources/0.2.0is a live, pollable snapshot of currently requestable resources. Peers may join before resources are ready; producers omit resources that cannot currently accept stream opens; consumers poll and reconcile row additions/removals.resource_idvalues stay stable across temporary outages. The current schema has no unavailable/degraded state, so absence from the catalog is the unavailability signal.- Stream request type
StreamRequest { source_peer_id, resource_id, read_from }whereread_fromis aoneof(latest,from_start,from_timestamp(i64)). - Typed stream payloads: camera, point cloud, joint encoders, audio, and pose
SpatialTransform - Relay reachability:
swarm::reserve_relay_circuit_addrreserves/p2p-circuiton a relay and returns the Manager circuit address to publish;discovery_clientderivesrelay_multiaddrsfrom circuit Manager addresses when creating or rotating Discovery entries. - Runtime relay reachability:
NetworkRuntimeHandle::reserve_relay_circuit_addrlets a runtime-owned swarm reserve a Manager circuit address after spawn, for promotion/rotation flows. - Discovery:
ClusterEntry.relay_multiaddrs,create_cluster_with_relay_multiaddrs,rotate_manager_with_relay_multiaddrs - Constants:
PEER_DERIVATION_LABEL = "peer/v1" - Locked vectors pin
seed → PeerIdand the stream wire bytes across language reimplementations.
Depends on
auki-identity— forWalletand child derivation.auki-datatypes(optional) — for stream payload types.auki-time(optional) — for clock-stamped peer messages.auki-jcs(optional) — for canonical-JSON peer protocol bodies.