Skip to main content

Module sync_relay_server

Module sync_relay_server 

Source
Expand description

A minimal HTTP relay for the sync transport (T3.1) — the server counterpart to HttpRelayTransport.

A dumb op bus: it stores published operations (append-only, dedup by operation id) and serves pulls from a cursor. It does no validation — trust is the receiving node’s inbox (validate_operation), so a compromised relay can only ever cause rejections, never admission of bad data. Peers rendezvous through it.

Endpoints:

  • POST /sync/publish — body {"ops":[...]}; stores new ops, returns {"ops":[]}.
  • GET /sync/pull?since={n} — returns {"ops":[...]} for ops at index >= n (relay order).

Native-only (tiny_http). Runs a background accept loop with graceful shutdown on drop.

Structs§

SyncRelayServer
A running relay. Stop it explicitly with SyncRelayServer::stop or let Drop do it.