Skip to main content

Module protocol

Module protocol 

Source
Expand description

weirdnet-sync/v1 messages and length-prefixed CBOR framing.

After the authenticated channel is up, payloads that carry records, cursors or certificates are sealed under crate::sync_key. An Envelope carries the type and epoch in the clear so the receiver can pick the key; the body is sealed.

Structs§

Ack
Envelope
What goes on the request-response wire: type and epoch in the clear, body sealed.
Hello
HelloOk
Page
Pull
Refuse
RosterMsg

Enums§

Message
Application-level message, before sealing.

Constants§

PAGE_MAX
Largest sealed page (and the reply cap to set on a sync node). Still under weirdnet-net’s 8 MiB default.
PROTOCOL
Request-response protocol id, same style as /weirdnet/link/1.

Statics§

SYNC_PROFILE
Identifier profile: /weirdnet/sync/1 for request-response, otherwise WEIRDNET.

Functions§

decode
decode_framed
encode
Length-prefixed CBOR (u32 big-endian length, then the item). For a raw stream; Node::request already frames Envelope as CBOR through libp2p.
encode_framed
page_for_type
Build a Page message from a log page, dropping ops whose typ does not match (they stay in the log for a later pull of that type).

Type Aliases§

Cursors
Last seq applied from each node, as sent in Hello.
RefuseReason