Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/syncer/syncer_types.ts

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
import * as earthstar from "https://deno.land/x/earthstar@v10.0.0-alpha.4/src/syncer/syncer_types.ts";

Interfaces

Provides a syncer with the means to connect the peer being synced with (the partner).

Options to initialise a Syncer with.

  • peer - The peer to synchronise.
  • partner - Determines who you'll be syncing with (e.g. a remote peer on a server, a local peer)
  • mode - Determines what kind of sync to carry out.
  • formats - An optional array of formats to sync. Defaults to just es.5.

Type Aliases

A short string with a timestamp and hash of the document's path and author.

An event with an Earthstar document and corresponding ID.

A type of message one SyncAgent can send to another.

An event sent when a SyncAgent doesn't want anything anymore, though it'll still serve HAVE requests.

Options used for initialisng a SyncAgent.

  • replica: The replica to represent.
  • mode: Whether to sync only existing docs or keep the connection open for new docs too.

A special event for the implementation of a PlumTree. Asks the recipient to begin lazily messaging us.

An event to be passed on to a RangeMessenger

The current status of a SyncAgent.

Signals that a SyncAgent wants a document/documents from another SyncAgent

A mode which determines when the syncer will stop syncing.

  • once - The syncer will only attempt to sync existing docs and then stop.
  • live - Indefinite syncing, including existing docs and new ones as they are ingested into the replica.

An event for disclosing which shares a Peer has without actually revealing them. Another peer can use the salt to hash their own shares' addresses and see if they match.

An event a Syncer can send or receive.

A map of sync statuses by the share address they're associated with.

A SyncAgentEvent addressed to a specific share address.