Skip to main content

Module protocol

Module protocol 

Source

Structs§

BelowFloorLine
HandshakeKeys
The sender’s sync identity, carried in plaintext: nothing here is secret, since envelopes are sealed to their recipient and rows are signed.
Hello
What each side of a sync tells the other about its clock and how much of the other’s log it holds, so neither reissues a sequence number or an origin key the other has already seen.
Merging
PushApplied
The last line sb sync-import writes back to the pusher: the highest seq of the pusher’s log it applied without a gap.
RefusedLine
SyncHeader
First line of every sync stream: HEADER_PREFIX, a space, then plaintext JSON, so a peer holding the wrong key still gets a version error. It carries no data, is not a change-log entry and has no sequence number.

Enums§

VersionError

Constants§

SYNC_PROTOCOL_VERSION
Bump whenever the sync wire format or the meaning of a field changes: the record envelope, the header line, the line framing or the crypto frame. wire_format_matches_the_protocol_version pins the current format. Releases up to second-brain 0.10.0 sent no header and count as protocol 1.

Functions§

check_store_header
read_header
Reads the header line that must open a sync stream, skipping blank lines. An empty stream is refused like a header-less one: a current sender always writes the header, even when it has no records.
store_header
The versions this daemon syncs at. A binary older than the database it serves is refused, because applying records it would drop the columns it does not know.