CoordinatedDocument
Defined in: packages/core/src/coordinated-document.ts:763
Coordinator-backed mutation path, deliberately separate from the BeeKEM wire protocol.
Type Parameters
Section titled “Type Parameters”Document
Section titled “Document”Document
Changes
Section titled “Changes”Changes
Change
Section titled “Change”Change
PrivateKey
Section titled “PrivateKey”PrivateKey
PublicKey
Section titled “PublicKey”PublicKey
DocumentKey
Section titled “DocumentKey”DocumentKey
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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
Parameters
Section titled “Parameters”documentId
Section titled “documentId”string
initial
Section titled “initial”Document
CRDTProvider<Document, Changes, Change>
serializer
Section titled “serializer”ChangesSerializer<Changes>
AuthProvider<PrivateKey, PublicKey, DocumentKey>
privateKey
Section titled “privateKey”PrivateKey
publicKey
Section titled “publicKey”PublicKey
options
Section titled “options”Returns
Section titled “Returns”CoordinatedDocument<Document, Changes, Change, PrivateKey, PublicKey, DocumentKey>
Properties
Section titled “Properties”documentId
Section titled “documentId”
readonlydocumentId:string
Defined in: packages/core/src/coordinated-document.ts:890
Accessors
Section titled “Accessors”document
Section titled “document”Get Signature
Section titled “Get Signature”get document():
Document
Defined in: packages/core/src/coordinated-document.ts:992
Returns
Section titled “Returns”Document
heldGeneration
Section titled “heldGeneration”Get Signature
Section titled “Get Signature”get heldGeneration():
number
Defined in: packages/core/src/coordinated-document.ts:1878
Increases each time a frame starts waiting for its predecessors.
Returns
Section titled “Returns”number
heldProgress
Section titled “heldProgress”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”number
routingId
Section titled “routingId”Get Signature
Section titled “Get Signature”get routingId():
string
Defined in: packages/core/src/coordinated-document.ts:999
Returns
Section titled “Returns”string
staleCatchUpRequests
Section titled “staleCatchUpRequests”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”number
staleRedeliveryRequests
Section titled “staleRedeliveryRequests”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”number
topicCatchUpEnabled
Section titled “topicCatchUpEnabled”Get Signature
Section titled “Get Signature”get topicCatchUpEnabled():
boolean
Defined in: packages/core/src/coordinated-document.ts:2809
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”activate()
Section titled “activate()”activate():
Promise<void>
Defined in: packages/core/src/coordinated-document.ts:1148
Returns
Section titled “Returns”Promise<void>
answerRedelivery()
Section titled “answerRedelivery()”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.
Parameters
Section titled “Parameters”Uint8Array
string | undefined
Returns
Section titled “Returns”Promise<CoordinatedRedeliveryAnswer>
answerTopicCatchUp()
Section titled “answerTopicCatchUp()”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.
Parameters
Section titled “Parameters”Uint8Array
string | undefined
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike> | undefined>
applyAuthorityUpdate()
Section titled “applyAuthorityUpdate()”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.
Parameters
Section titled “Parameters”encoded
Section titled “encoded”Uint8Array
Returns
Section titled “Returns”Promise<CoordinatedAuthorityUpdateResult>
applyAuthorityUpdateBeforeOpen()
Section titled “applyAuthorityUpdateBeforeOpen()”applyAuthorityUpdateBeforeOpen(
encoded):Promise<void>
Defined in: packages/core/src/coordinated-document.ts:4527
Install an authenticated strict role record while leaving activation fenced.
Parameters
Section titled “Parameters”encoded
Section titled “encoded”Uint8Array
Returns
Section titled “Returns”Promise<void>
applyCatchUpCheckpoint()
Section titled “applyCatchUpCheckpoint()”applyCatchUpCheckpoint(
checkpoint):Promise<void>
Defined in: packages/core/src/coordinated-document.ts:2749
Parameters
Section titled “Parameters”checkpoint
Section titled “checkpoint”Uint8Array
Returns
Section titled “Returns”Promise<void>
assertPublicationDispatchAllowed()
Section titled “assertPublicationDispatchAllowed()”assertPublicationDispatchAllowed(
binding?,draining?):void
Defined in: packages/core/src/coordinated-document.ts:5232
Parameters
Section titled “Parameters”binding?
Section titled “binding?”DocumentGroupRosterBinding | undefined = ...
draining?
Section titled “draining?”boolean = true
Returns
Section titled “Returns”void
canRequestCatchUp()
Section titled “canRequestCatchUp()”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.
Returns
Section titled “Returns”boolean
captureStrictNotificationGuard()
Section titled “captureStrictNotificationGuard()”captureStrictNotificationGuard(): (() =>
boolean) |undefined
Defined in: packages/core/src/coordinated-document.ts:5243
Capture the installed strict roster for a delayed application notification.
Returns
Section titled “Returns”(() => boolean) | undefined
change()
Section titled “change()”change(
change,message?):Promise<Uint8Array<ArrayBufferLike>>
Defined in: packages/core/src/coordinated-document.ts:1189
Parameters
Section titled “Parameters”change
Section titled “change”Change
message?
Section titled “message?”string = ''
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
close()
Section titled “close()”close():
Promise<void>
Defined in: packages/core/src/coordinated-document.ts:5568
Returns
Section titled “Returns”Promise<void>
continueResend()
Section titled “continueResend()”continueResend():
Promise<boolean>
Defined in: packages/core/src/coordinated-document.ts:5215
Re-sign queued retired frames into outbox space freed by publication.
Returns
Section titled “Returns”Promise<boolean>
createCatchUpCheckpoint()
Section titled “createCatchUpCheckpoint()”createCatchUpCheckpoint(
request):Promise<Uint8Array<ArrayBufferLike>>
Defined in: packages/core/src/coordinated-document.ts:2635
Parameters
Section titled “Parameters”request
Section titled “request”Uint8Array
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
createCatchUpRequest()
Section titled “createCatchUpRequest()”createCatchUpRequest():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: packages/core/src/coordinated-document.ts:2607
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
createRedeliveryRequest()
Section titled “createRedeliveryRequest()”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.
Parameters
Section titled “Parameters”requesterPeer
Section titled “requesterPeer”string
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
createTopicCatchUpRequest()
Section titled “createTopicCatchUpRequest()”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.
Parameters
Section titled “Parameters”requesterPeer
Section titled “requesterPeer”string
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
dispatchablePublications()
Section titled “dispatchablePublications()”dispatchablePublications():
Promise<{dropped:number;publications: readonlyobject[];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.
Returns
Section titled “Returns”Promise<{ dropped: number; publications: readonly object[]; undelivered: boolean; waiting: boolean; }>
hasHeldFrames()
Section titled “hasHeldFrames()”hasHeldFrames():
boolean
Defined in: packages/core/src/coordinated-document.ts:2107
Returns
Section titled “Returns”boolean
hasQueuedPublications()
Section titled “hasQueuedPublications()”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.
Returns
Section titled “Returns”Promise<boolean | undefined>
hasReceivedBacklog()
Section titled “hasReceivedBacklog()”hasReceivedBacklog():
boolean
Defined in: packages/core/src/coordinated-document.ts:2112
Whether received frames or requests are waiting to be processed.
Returns
Section titled “Returns”boolean
needsJoinCatchUp()
Section titled “needsJoinCatchUp()”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.
Returns
Section titled “Returns”boolean
pendingPublications()
Section titled “pendingPublications()”pendingPublications():
Promise<readonlyUint8Array<ArrayBufferLike>[]>
Defined in: packages/core/src/coordinated-document.ts:5257
Returns
Section titled “Returns”Promise<readonly Uint8Array<ArrayBufferLike>[]>
publicationDispatched()
Section titled “publicationDispatched()”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.
Parameters
Section titled “Parameters”Uint8Array
Uint8Array
recipients
Section titled “recipients”readonly string[] | undefined
Returns
Section titled “Returns”Promise<boolean>
publicKeys()
Section titled “publicKeys()”publicKeys(
writersOnly):Promise<PublicKey[]>
Defined in: packages/core/src/coordinated-document.ts:1003
Parameters
Section titled “Parameters”writersOnly
Section titled “writersOnly”boolean
Returns
Section titled “Returns”Promise<PublicKey[]>
receive()
Section titled “receive()”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.
Parameters
Section titled “Parameters”Uint8Array
sender?
Section titled “sender?”string
Returns
Section titled “Returns”Promise<boolean>
receiveTopicCatchUp()
Section titled “receiveTopicCatchUp()”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.
Parameters
Section titled “Parameters”Uint8Array
string | undefined
Returns
Section titled “Returns”Promise<boolean>
receiveTopicCatchUpRefusal()
Section titled “receiveTopicCatchUpRefusal()”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.
Parameters
Section titled “Parameters”Uint8Array
string | undefined
Returns
Section titled “Returns”Promise<boolean>
resumeCatchUp()
Section titled “resumeCatchUp()”resumeCatchUp():
void
Defined in: packages/core/src/coordinated-document.ts:2805
Ask again after the controller refused; the application decides when.
Returns
Section titled “Returns”void
unansweredRedeliveries()
Section titled “unansweredRedeliveries()”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.
Parameters
Section titled “Parameters”answer
Section titled “answer”Returns
Section titled “Returns”Uint8Array<ArrayBufferLike>[]