rag_rat_sync/lib.rs
1//! Peer/p2p transport for the rag-rat op log (phase D, #406).
2//!
3//! Phase C built the stationary machine — a signed, hash-chained op log with a deterministic,
4//! device-independent fold, and ingest seams that verify raw signed bytes from any source. This
5//! crate is the wire: an iroh QUIC session that exchanges those bytes between peers and feeds each
6//! received entry back through the same ingest seam, so a synced entry passes exactly the checks a
7//! local write does. The transport adds movement, never trust.
8//!
9//! Layers, bottom up:
10//! - [`wire`] — the frozen CBOR frame protocol (hello / entries / done).
11//! - [`codec`] — length-prefixed framing over any async byte stream (iroh in production, an
12//! in-memory duplex in tests).
13//! - [`session`] — the symmetric state machine and the [`session::SyncStore`] seam.
14//! - [`store`] — the op-log-backed [`session::SyncStore`].
15//! - [`endpoint`] — the iroh endpoint that binds the ALPN over a pinned relay and runs a session
16//! per connection.
17
18pub mod auth;
19pub mod codec;
20pub mod endpoint;
21pub mod session;
22pub mod store;
23pub mod wire;
24
25pub use auth::{AuthConfig, AuthError, AuthPolicy, AuthRole, NodeAuth, run_auth_phase};
26pub use endpoint::{
27 EndpointError, SyncFailure, accept_and_sync, build_endpoint, connect_and_sync, endpoint_addr,
28};
29pub use session::{
30 DEFAULT_IDLE_TIMEOUT, Ingested, MAX_SESSION_ENTRIES, SessionError, SessionReport, SyncStore,
31 run_session, run_session_with_idle_timeout,
32};
33pub use store::{OplogContentSyncStore, OplogSyncStore};
34pub use wire::{Frame, SYNC_ALPN, WireError};