Skip to main content

Crate gpp_sync

Crate gpp_sync 

Source
Expand description

gpp-sync — CRDT-based, offline-first P2P synchronization (layer 8).

Transport is TCP + Noise_XX (mutual static-key auth, TOFU). Peers exchange a state vector (object id set, branch tips, policy set) then transfer only what the other lacks:

  • Objects — content-addressed, add-only set; verified on receipt.
  • Refs — adopt missing branches; divergent same-name branches are preserved as name@peer forks (no silent merge — see gpp merge).
  • Policies — add-only union by name.
  • Graphex — optional zero-knowledge index sync (encrypted blobs ride the object set; metadata merges OR-Set / LWW).

Trust and timeline are never synced (per docs/SYNC_PROTOCOL.md).

Structs§

SyncOptions
SyncReport
Transport
An established, encrypted session.

Enums§

Error

Functions§

connect
Drive a sync as the connecting peer.
ensure_identity
Persistent Noise static keypair for this repo: (private, public).
ensure_repo_id
Stable repository id (shared by all replicas). Created on first use; set_repo_id lets a fresh clone adopt a peer’s id.
generate_keypair
Generate a persistent X25519 static keypair (private, public).
serve
Handle one inbound sync on an accepted stream (responder role). Trust-on-first-use only; see serve_with_auth to additionally gate on an authorized-keys allowlist.
serve_with_auth
Like serve, but reject any peer whose Noise static key is not in allow immediately after the handshake — before the repo-id exchange, TOFU pinning, or any object data. None disables the check (TOFU only).
set_repo_id

Type Aliases§

Result