Skip to main content
Module

x/earthstar/mod.ts>IPeer

A specification and Javascript library for building online tools you can truly call your own.
Go to Latest
interface IPeer
Re-export
import { type IPeer } from "https://deno.land/x/earthstar@v9.3.3/mod.ts";

Holds many shares' replicas and manages their synchronisation with other peers. Recommended as the point of contact between your application and Earthstar shares.

Methods

hasShare(share: ShareAddress): boolean
shares(): ShareAddress[]
replicas(): IReplica[]
size(): number
getReplica(share: ShareAddress): IReplica | undefined
addReplica(replica: IReplica): Promise<void>
removeReplicaByShare(share: ShareAddress): Promise<void>
removeReplica(replica: IReplica): Promise<void>
sync(target: IPeer | string): () => void
stopSyncing(): void
syncUntilCaughtUp(targets: (IPeer | string)[]): Promise<Record<string, Record<ShareAddress, SyncSessionStatus>>>