Skip to main content

Module sync_node

Module sync_node 

Source
Expand description

libp2p sync node (T3.1) — a standalone, noise-encrypted request-response node that drives the super::sync_ops op-transfer protocol between peers. This is the swarm behind the sync transport: it serves a local SyncOpRelay to inbound peers and exposes async publish/pull to a peer.

Standalone by design — it does not touch the daemon’s swarm (whose QualiaRequest enum is matched exhaustively). The blocking SyncTransport adapter (client-core) is a thin block_on wrapper over the async methods here; kept separate so libp2p stays out of the wasm-facing client crate.

A dumb pipe: it moves opaque, already-signed operation frames and validates nothing — all trust stays in the consuming node’s fail-closed inbox, exactly as the in-memory and HTTP relay transports.

Structs§

BlockingSyncClient
A blocking libp2p sync client — the thin block_on wrapper the module docs promise. It owns a tokio runtime and a Libp2pSyncNode, pins a single target peer, and exposes blocking publish_frames/pull_frames over opaque op frames. Keeping the runtime + libp2p types here lets the client-core SyncTransport adapter stay a plain synchronous caller (and keeps libp2p out of the wasm-facing crate). A dumb pipe like the async node beneath it: it moves already-signed frames and validates nothing — all trust stays in the consuming node’s fail-closed inbox.
Libp2pSyncNode
A running libp2p sync node. Spawn it on a tokio runtime; drive it with the async methods.