import { SqliteChainEventCursorStore, SqliteChainEventLogStore, SqliteChangelogCursorStore, SqliteChangelogEraGuard, SqliteContextGraphAuthorityHistoryStore, SqliteContextGraphAuthorityIndexStore, SqliteContextGraphRegistryScanCursorStore, SqliteContextGraphStorageDiscoveryStore, SqliteKaNumberStore, SqliteMessageIdempotencyStore, SqliteProtocolOutboxStore, SqliteSyncCheckpointStore, type NodeStoreDatabaseHandle } from '@origintrail-official/dkg-node-store'; export interface ProtocolStoreOptions { /** * Chain deployment identity that scopes the chain cursors and the * storage-discovery checkpoint, so a node home reused across networks never * replays another deployment's catalog. */ readonly chainCursorScope: string; /** * OT-RFC-59 changelog intent. When on, the durable era guard is built and MUST * back the changelog: it lives in node-ui.db, which survives a `store.nq` RDF * restore, so a restore/rollback rotates the era and forces peers to * full-resync instead of silently skipping. */ readonly changelogEnabled: boolean; } /** Every protocol persistence store the daemon composes, over one shared handle. */ export interface ProtocolStores { /** * Universal Messenger substrate stores (rc.9 PR-2). Wired into the DKGAgent's * Messenger so any caller that opts into `messenger.sendReliable` gets durable * receiver-side idempotency + sender-side outbox retries. */ readonly messengerStores: { readonly idempotencyStore: SqliteMessageIdempotencyStore; readonly outboxStore: SqliteProtocolOutboxStore; }; readonly syncCheckpointStore: SqliteSyncCheckpointStore; readonly changelogCursorStore: SqliteChangelogCursorStore; /** Present only when {@link ProtocolStoreOptions.changelogEnabled}. */ readonly changelogEraGuard: SqliteChangelogEraGuard | undefined; readonly chainEventCursorStore: SqliteChainEventCursorStore; readonly contextGraphRegistryScanCursorStore: SqliteContextGraphRegistryScanCursorStore; readonly contextGraphStorageDiscoveryStore: SqliteContextGraphStorageDiscoveryStore; readonly localContextGraphAuthorityHistoryStore: SqliteContextGraphAuthorityHistoryStore; readonly localContextGraphAuthorityIndexStore: SqliteContextGraphAuthorityIndexStore; /** * THE node's one chain log. Handed to the agent's chain adapter ONLY: that * adapter builds the tick, starts it, and publishes the binding every other * eligible reader consults. Per-wallet publisher adapters receive only a * late-bound binding getter, never this store, because a second store would * be a second scanner, which is what this log exists to delete. */ readonly chainEventLogStore: SqliteChainEventLogStore; /** * OT-RFC-43 Option-1 deterministic KA identity (B2 allocator core). Durable * per-author KA-number sequence backing the off-chain `KaNumberAllocator`. * Constructed here, alongside the other durable substrate stores, so the V20 * `ka_numbers` table is opened and its sequence is co-located with the rest * of the node's persistent state. * * The publisher allocates a deterministic packed reservedKaId per V10 mint * (DKGPublisher.ensureReservedKaId) and lazily reconciles each author's floor * against the chain's highest minted number on first use * (chain.getMaxKaNumberForAuthor), satisfying the RFC ยง4.5 cold-start guard. * (A blocking startup reconciliation sweep + the ongoing * KnowledgeAssetCreated poller->reconcile wiring remain a hardening * follow-up.) */ readonly kaNumberStore: SqliteKaNumberStore; } /** * Compose the protocol persistence stores over ONE database handle. * * Every store is built from the same `database`, so they all read and write the * same connection, transactions included. The construction order and options * are the ones the daemon has always used. * * The daemon passes the `DashboardDB` it constructs once at start-up. That class * still creates and migrates `node-ui.db` (the schema did not move with the * stores), and it stays the handle the shutdown paths close; the stores never * open or close a connection of their own. */ export declare function createProtocolStores(database: NodeStoreDatabaseHandle, options: ProtocolStoreOptions): ProtocolStores; //# sourceMappingURL=protocol-persistence.d.ts.map