Module: Log

Log is a verifiable, append-only log CRDT.

Implemented as a Merkle-CRDT as per the paper "Merkle-CRDTs: Merkle-DAGs meet CRDTs"

Source:

Namespaces

Log

Methods

(async) Log(ipfs, identity, options) → {module:Log~Log}

Create a new Log instance

Parameters:
Name Type Description
ipfs IPFS

An IPFS instance

identity Object

Identity.

options Object
Properties
Name Type Attributes Description
logId string

ID of the log

logHeads Array.<Entry>

Set the heads of the log

access Object

AccessController (./default-access-controller)

entries Array.<Entry>

An Array of Entries from which to create the log

entryStorage module:Storage <optional>

A compatible storage instance for storing log entries. Defaults to MemoryStorage.

headsStorage module:Storage <optional>

A compatible storage instance for storing log heads. Defaults to MemoryStorage.

indexStorage module:Storage <optional>

A compatible storage instance for storing an index of log entries. Defaults to MemoryStorage.

sortFn function

The sort function - by default LastWriteWins

Source:
Returns:

sync An instance of Log

Type
module:Log~Log

Type Definitions

Entry

Type:
  • Object
Properties:
Name Type Description
id string

A string linking multiple entries together.

payload *

An arbitrary chunk of data.

next Array.<string>

One or more hashes pointing to the next entries in a chain of entries.

refs Array.<string>

One or more hashes which reference other entries in the chain.

clock Clock

A logical clock. See module:Log~Clock.

v integer

The version of the entry.

key string

The public key of the identity.

identity string

The identity of the entry's owner.

sig string

The signature of the entry signed by the owner.

Source: