Hierarchy (View Summary)

Implements

Constructors

Properties

exclusive: boolean = false

if true, lock the file until closing store, otherwise only lock as-needed.

fileHandle: FileHandle
fileLocked: boolean = false
filename: string

file to store transactions and chain ownership information

Accessors

  • get ready(): Promise<void>
  • Can be awaited on for the underlying store to be ready for operations. Methods of the store should await on this, so if initialization fails then no other method will work either.

    Returns Promise<void>

Methods

  • Tries to see if there's a free chain available with the given identity that's not currently being used by another processes, and if so, adds a claim to it and returns the final link of that chain.

    Parameters

    • identity: string

    Returns Promise<BundleInfo>

  • Tries to add a bundle to this store; returns truthy if actually added, false if not (e.g. if already has it). Will throw if passed a bundle without the proceeding ones in the associated chain.

    Optionally can reuse/start a new chain.

    Implicitly awaits on this.ready;

    Parameters

    Returns Promise<Boolean>

  • Attempts to get the identity of the user who started the chain.

    Parameters

    • chainInfo: [number, number]

      [Medallion, ChainStart]

    Returns Promise<string>

    a string of the identity of the user who started the chain.

  • Get the properties corresponding to a container.

    Parameters

    • containerMuid: Muid

      the Muid of the container to get the properties of

    • OptionalasOf: AsOf

      optional timestamp to look back to

    Returns Promise<Map<string, Value>>

    a Map of string Muid (of the Property Container) to Value

  • In ordered container types (Sequence and EdgeType), entries may be moved around. This method returns information about the current effective time, which may be different from the timestamp of the entry itself.

    Parameters

    • entry: Muid

      the muid of the entry

    • OptionalasOf: AsOf

      optional timestamp to look back to

    Returns Promise<Placement>

    an object with the container muid, key, and the placement id.