import type { Blockstore } from "interface-blockstore"; export interface PkcBlockstore { blockstore: Blockstore; persistent: boolean; defaultMaxBytes: number; close: () => Promise; } export declare const DEFAULT_BLOCKSTORE_MAX_BYTES: number; export declare const DEFAULT_IN_MEMORY_BLOCKSTORE_MAX_BYTES: number; /** * Node block storage for the libp2p-js client: blocks on disk under the pkc data directory so a * restart does not re-fetch everything from the network. * * Falls back to memory when there is no dataPath (`noData`, or a browser-shaped consumer running * under node), since there is nowhere to put a directory. * * Each libp2p-js client key gets its own directory. Two processes pointed at the same dataPath and * the same key share one directory. Unlike the community databases (which take a proper-lock-file * lock, see db-handler.ts) this is deliberately NOT locked: a lock would stop the second process * from running at all, which is the wrong trade for a cache that both can safely use. Measured * behaviour when shared: * - concurrent writes of the same block are safe; blockstore-fs writes via steno (temp file plus * atomic rename) and explicitly tolerates another context having created the file, * - a block one process evicts while another is reading it surfaces as a NotFoundError, which * fails that one load and self-heals on retry (the next `has` misses and refetches), * - the size cap is per process, so N processes sharing a directory can leave up to N times * maxBytes on disk. */ export declare function createBlockstoreForLibp2pJsClient({ dataPath, key }: { dataPath?: string; key: string; }): Promise;