View Source Baobab (Baobab v0.2.0)

Baobab is a pure Elixir implementation of the Bamboo append-only log.

It is fairly opinionated about the filesystem persistence of the logs. They are considered to be a spool of the logs as retreived.

Consumers of this library may wish to place a local copy of the logs in a store with better indexing and query properties.

configuration

Configuration

config :baobab, spool_dir: "/tmp"

options

Options

  • format: :entry or :binary, default: :entry
  • log_id: the author's log identifier, default 0
  • revalidate: confirm the store contents are unchanged, default: false

Link to this section Summary

Functions

Create and store a new log entry for a stored identity

Create and store a new identity

Retrieve all available entries in a particular log

Retrieve the key for a stored identity.

Import and store a list of log entries from their binary format.

Retrieve the latest entry.

Retrieve an author log at a particular sequence number.

Retrieve the latest entry on a particular log identified by the author key and log number

Retrieve the latest sequence number on a particular log identified by the author key and log number

Link to this section Functions

Link to this function

append_log(payload, identity, options \\ [])

View Source

Create and store a new log entry for a stored identity

Link to this function

create_identity(identity)

View Source

Create and store a new identity

Link to this function

full_log(author, options \\ [])

View Source

Retrieve all available entries in a particular log

Link to this function

identity_key(identity, which)

View Source

Retrieve the key for a stored identity.

Can be either the :public or :secret key

@spec import([binary()]) :: [
  %Baobab.Entry{
    author: term(),
    backlink: term(),
    lipmaalink: term(),
    log_id: term(),
    payload: term(),
    payload_hash: term(),
    seqnum: term(),
    sig: term(),
    size: term(),
    tag: term()
  }
  | :error
]

Import and store a list of log entries from their binary format.

Link to this function

latest_log(author, options \\ [])

View Source

Retrieve the latest entry.

Includes the available certificate pool for its verification.

Link to this function

log_at(author, seq, options \\ [])

View Source

Retrieve an author log at a particular sequence number.

Includes the available certificate pool for its verification.

Link to this function

max_entry(author, options \\ [])

View Source

Retrieve the latest entry on a particular log identified by the author key and log number

Link to this function

max_seqnum(author, options \\ [])

View Source

Retrieve the latest sequence number on a particular log identified by the author key and log number