Peer-to-peer connection lifecycle · Group scheduler · Crate dependency map
_gpumesh._udp.local — automatic, zero config.GET /v1/peers/{node_id} — requires configured server.
ConnectionMode::DirectGPUMESH_RELAY env is set — ConnectionMode::Relay
Hello → Server replies HelloAck[u32 BE length][UTF-8 JSON], max 64 MiB per frame
outputs.gpk
GroupInvite (Ed25519 signed, TTL-limited).GroupJoinNotify to owner's QUIC endpoint.PeerStore.group specified: intersect with GroupStore member IDs.
PeerInfoMsg — GPU model, free VRAM, utilization, sharing status.+free VRAM mb base score ·
+10 000 if Idle ·
+(100−util)×10 low utilization bonus ·
+50 000 if matches prefer_peer
upload.gpkFileOffer + RunJob requestJobLog back in real-timepull_artifacts downloads outputs.gpk
Message enum · ProtocolHello · JsonFrameCodec (length-prefix, 64 MiB max)gpumesh-common for error types and config structs.gpumesh-security is a zero-dependency leaf crate (only ed25519-dalek + crypto primitives).
| Layer | Crate(s) | Responsibility | Key types / functions |
|---|---|---|---|
| Binary | cli · agent · control · relay | CLI commands (pair, run, share, group), daemon accept-loop, IPC bridge, optional WAN relay forwarder | MeshNode |
| Core | gpumesh-core | Bootstrap, pairing, share/disable, inbound session dispatch, group scheduler, CUDA remote, desktop tunnels | MeshNode · schedule_peer · run_remote_job |
| Network | gpumesh-network | QUIC endpoint (Quinn + TLS 1.3), mDNS LAN discovery, relay fallback dial, HTTP rendezvous signalling, public GPU registry | NetworkEndpoint · PeerConnection · LanDiscovery · RendezvousClient |
| Protocol | gpumesh-protocol | Wire message enum covering all session message types, length-prefixed JSON codec | Message · ProtocolHello · JsonFrameCodec |
| Security | gpumesh-security | Ed25519 identity generation/persistence, Hello/pairing/invite signing & verification, AllowList with three separate permission buckets | NodeIdentity · AllowList · PairingPayload · GroupInvite |
| Storage | gpumesh-storage | JSON-backed peer registry, group membership with roles & invite codes, job log records | PeerStore · GroupStore · GroupRole · JobRecord |
| Runtime | gpumesh-runtime | Docker container execution, GPU memory cap, utilization guard, log streaming, output archive packaging | DockerRuntime · JobRequest · ShareLimits |
| GPU | gpumesh-gpu | GPU enumeration via NVML or nvidia-smi, VRAM total/free/used, utilization, temperature, CUDA version | GpuMonitor · GpuInfo |
| Common | gpumesh-common | Shared types across all crates, error enum, path helpers, protocol constants (version, TTLs, ports) | NodeConfig · GpuMeshError · PeerStatus · JobState |
| Stub | gpumesh-cudart-stub | No-op CUDA runtime shim for builds without a real GPU or CUDA SDK | — |