Documentation
    Preparing search index...

    Interface that a data store needs to implement to manage blobs by their hashes.

    interface IAuthoredDataSyncStore {
        get(hash: Hash, author: string): IStoredBlob | undefined;
        getByAuthorBefore(author: string, before: number): IStoredBlob[];
        getByAuthorSince(author: string, since: number): IStoredBlob[];
        getLastKnownByAuthor(author: string): IStoredBlob | undefined;
        put(hash: Hash, blob: Blob, author: string, authoredAt: number): void;
    }

    Implemented by

    Index

    Methods

    • The author's most recently authored blob this node holds (max authoredAt), or undefined if none is held.

      Parameters

      • author: string

      Returns IStoredBlob | undefined

    • Put a blob by an author into the store. Blob bytes are content-deduped by hash (written only once). Each (author, hash) association is recorded independently, so the same bytes can be authored by multiple agents.

      Parameters

      • hash: Hash

        The blob's hash

      • blob: Blob

        The blob

      • author: string

        Author of the blob

      • authoredAt: number

        Author-assigned timestamp of the blob

      Returns void