A simple implementation of DataStore that works in both the browser and server-side. Leverages LevelDB under the hood.

It has the following structure (+ represents an additional sublevel/partition): 'data' + + + ->

Implements

Constructors

Properties

Methods

Constructors

Properties

blockstore: BlockstoreLevel
config: DataStoreLevelConfig

Methods

  • Deletes the specified data. No-op if the data does not exist.

    Parameters

    • tenant: string
    • recordId: string

      The logical ID of the record that references the data.

    • dataCid: string

      The IPFS CID of the data.

    Returns Promise<void>

  • Fetches the specified data.

    Parameters

    • tenant: string
    • recordId: string

      The logical ID of the record that references the data.

    • dataCid: string

      The IPFS CID of the data.

    Returns Promise<undefined | DataStoreGetResult>

    the data size and data stream if found, otherwise undefined.