Skip to content

CoordinatedDocument

Defined in: packages/core/src/coordinated-document.ts:763

Coordinator-backed mutation path, deliberately separate from the BeeKEM wire protocol.

Document

Changes

Change

PrivateKey

PublicKey

DocumentKey

new CoordinatedDocument<Document, Changes, Change, PrivateKey, PublicKey, DocumentKey>(documentId, initial, crdt, serializer, auth, privateKey, publicKey, options): CoordinatedDocument<Document, Changes, Change, PrivateKey, PublicKey, DocumentKey>

Defined in: packages/core/src/coordinated-document.ts:889

string

Document

CRDTProvider<Document, Changes, Change>

ChangesSerializer<Changes>

AuthProvider<PrivateKey, PublicKey, DocumentKey>

PrivateKey

PublicKey

CoordinatedDocumentOptions

CoordinatedDocument<Document, Changes, Change, PrivateKey, PublicKey, DocumentKey>

readonly documentId: string

Defined in: packages/core/src/coordinated-document.ts:890

get document(): Document

Defined in: packages/core/src/coordinated-document.ts:992

Document


get heldGeneration(): number

Defined in: packages/core/src/coordinated-document.ts:1878

Increases each time a frame starts waiting for its predecessors.

number


get heldProgress(): number

Defined in: packages/core/src/coordinated-document.ts:2817

Increases each time a held frame applies, or a frame applies from an author whose later frames are held, closing part of the gap before them.

number


get routingId(): string

Defined in: packages/core/src/coordinated-document.ts:999

string


get staleCatchUpRequests(): number

Defined in: packages/core/src/coordinated-document.ts:2825

Topic catch-up requests ignored, before their signature check, because their issue time was over 60 s from this clock.

number


get staleRedeliveryRequests(): number

Defined in: packages/core/src/coordinated-document.ts:2603

Requests sealed under the current epoch key and ignored, before their signature check, because their issue time was over 60 s from this clock.

number


get topicCatchUpEnabled(): boolean

Defined in: packages/core/src/coordinated-document.ts:2809

boolean

activate(): Promise<void>

Defined in: packages/core/src/coordinated-document.ts:1148

Promise<void>


answerRedelivery(frame, from): Promise<CoordinatedRedeliveryAnswer>

Defined in: packages/core/src/coordinated-document.ts:2220

Authenticate a current member’s request that GossipSub delivered from from, and choose the retained frames past its heads to resend. The request is authenticated outside the document queue and charged against the received bounds and the sender’s share, never the local edit budget. Requests are answered once, at most every 2 s per member, and within a shared per-replica frame budget.

Uint8Array

string | undefined

Promise<CoordinatedRedeliveryAnswer>


answerTopicCatchUp(frame, from): Promise<Uint8Array<ArrayBufferLike> | undefined>

Defined in: packages/core/src/coordinated-document.ts:2884

Answer a current member’s topic request, which GossipSub delivered from from, with an encrypted checkpoint for the topic. Only the unrestricted current controller answers; other replicas drop the request before decrypting it. The request is authenticated outside the document queue and charged against the received bounds and the sender’s share. A fresh issue time newer than the member’s last is required, a member gets at most one checkpoint every 10 s, and all documents in the process share a budget.

Uint8Array

string | undefined

Promise<Uint8Array<ArrayBufferLike> | undefined>


applyAuthorityUpdate(encoded): Promise<CoordinatedAuthorityUpdateResult>

Defined in: packages/core/src/coordinated-document.ts:4512

A role transition is acknowledged only after its checkpoint is durable. When it starts a new group context, this author’s frames from the retired context are re-signed in the new one while its roles and recorded operation paths allow them. A re-sign failure does not fail the update.

Uint8Array

Promise<CoordinatedAuthorityUpdateResult>


applyAuthorityUpdateBeforeOpen(encoded): Promise<void>

Defined in: packages/core/src/coordinated-document.ts:4527

Install an authenticated strict role record while leaving activation fenced.

Uint8Array

Promise<void>


applyCatchUpCheckpoint(checkpoint): Promise<void>

Defined in: packages/core/src/coordinated-document.ts:2749

Uint8Array

Promise<void>


assertPublicationDispatchAllowed(binding?, draining?): void

Defined in: packages/core/src/coordinated-document.ts:5232

DocumentGroupRosterBinding | undefined = ...

boolean = true

void


canRequestCatchUp(): boolean

Defined in: packages/core/src/coordinated-document.ts:2782

Whether this open replica may ask the controller for a checkpoint: it is a current member other than the controller, and the controller has not refused it since the last explicit request.

boolean


captureStrictNotificationGuard(): (() => boolean) | undefined

Defined in: packages/core/src/coordinated-document.ts:5243

Capture the installed strict roster for a delayed application notification.

(() => boolean) | undefined


change(change, message?): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/coordinated-document.ts:1189

Change

string = ''

Promise<Uint8Array<ArrayBufferLike>>


close(): Promise<void>

Defined in: packages/core/src/coordinated-document.ts:5568

Promise<void>


continueResend(): Promise<boolean>

Defined in: packages/core/src/coordinated-document.ts:5215

Re-sign queued retired frames into outbox space freed by publication.

Promise<boolean>


createCatchUpCheckpoint(request): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/coordinated-document.ts:2635

Uint8Array

Promise<Uint8Array<ArrayBufferLike>>


createCatchUpRequest(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/coordinated-document.ts:2607

Promise<Uint8Array<ArrayBufferLike>>


createRedeliveryRequest(requesterPeer): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/coordinated-document.ts:2172

Seal this member’s accepted heads for peers to resend what it lacks.

string

Promise<Uint8Array<ArrayBufferLike>>


createTopicCatchUpRequest(requesterPeer): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/coordinated-document.ts:2834

Seal a request for the current controller to answer on the document topic, bound to this node’s libp2p PeerId. Up to four requests stay outstanding; the first checkpoint merged for any of them retires all.

string

Promise<Uint8Array<ArrayBufferLike>>


dispatchablePublications(): Promise<{ dropped: number; publications: readonly object[]; undelivered: boolean; waiting: boolean; }>

Defined in: packages/core/src/coordinated-document.ts:5404

Read publications to send now: of each current publication, its frames from the first one not yet handed to a peer in this session. A publication whose frames all reached a member leaves the outbox. One whose frames were all handed only to peers that never proved membership stays queued, unsent, and undelivered reports it. A publication sealed for an earlier group context or authority head would be rejected by every current member. It stays queued, unsent, while it holds a frame its author can still re-sign into the current context, and waiting reports it; otherwise it is removed and its frames are counted as dropped. A diverged document still drains what it committed before diverging.

Promise<{ dropped: number; publications: readonly object[]; undelivered: boolean; waiting: boolean; }>


hasHeldFrames(): boolean

Defined in: packages/core/src/coordinated-document.ts:2107

boolean


hasQueuedPublications(): Promise<boolean | undefined>

Defined in: packages/core/src/coordinated-document.ts:5489

Whether publications are queued, from the known outbox tail without reading the outbox; undefined when it must be read.

Promise<boolean | undefined>


hasReceivedBacklog(): boolean

Defined in: packages/core/src/coordinated-document.ts:2112

Whether received frames or requests are waiting to be processed.

boolean


needsJoinCatchUp(): boolean

Defined in: packages/core/src/coordinated-document.ts:2773

Whether this replica opened, or a role update reached it, without content, and no checkpoint merged since.

boolean


pendingPublications(): Promise<readonly Uint8Array<ArrayBufferLike>[]>

Defined in: packages/core/src/coordinated-document.ts:5257

Promise<readonly Uint8Array<ArrayBufferLike>[]>


publicationDispatched(row, sent, recipients): Promise<boolean>

Defined in: packages/core/src/coordinated-document.ts:5282

Record that GossipSub handed sent, the frames of row not handed to a peer before, to recipients. They are not sent again in this session. They reached a member when a recipient proved it serves one, when the transport lists no recipients, or when no other member exists. row leaves the outbox, returning true, once every frame it holds reached a member or a member’s signed request shows it holds them.

Uint8Array

Uint8Array

readonly string[] | undefined

Promise<boolean>


publicKeys(writersOnly): Promise<PublicKey[]>

Defined in: packages/core/src/coordinated-document.ts:1003

boolean

Promise<PublicKey[]>


receive(frame, sender?): Promise<boolean>

Defined in: packages/core/src/coordinated-document.ts:1218

Apply a publication of consecutive frames from one author. Every frame is charged against the received bounds; a sender names the network peer, whose share holds one full outbox backlog plus live edits. Each frame must decrypt under the current epoch before the publication waits for its turn. Frames the author already delivered, and copies of frames already waiting or held, are dropped then, so unauthenticated input and replays cost no signature check.

Uint8Array

string

Promise<boolean>


receiveTopicCatchUp(frame, from): Promise<boolean>

Defined in: packages/core/src/coordinated-document.ts:3010

Merge a checkpoint carried on the topic that answers one of this replica’s outstanding requests. A replica with none drops it unread.

Uint8Array

string | undefined

Promise<boolean>


receiveTopicCatchUpRefusal(frame, from): Promise<boolean>

Defined in: packages/core/src/coordinated-document.ts:3085

Accept the controller’s signed refusal of one of this replica’s outstanding requests. The replica then stops requesting until the application asks again, and reports the refusal.

Uint8Array

string | undefined

Promise<boolean>


resumeCatchUp(): void

Defined in: packages/core/src/coordinated-document.ts:2805

Ask again after the controller refused; the application decides when.

void


unansweredRedeliveries(answer): Uint8Array<ArrayBufferLike>[]

Defined in: packages/core/src/coordinated-document.ts:2585

Frames from an answer that no other replica has resent since since.

CoordinatedRedeliveryAnswer

Uint8Array<ArrayBufferLike>[]