View Source Baobab (Baobab v0.9.3)
Baobab is a pure Elixir implementation of the Bamboo append-only log.
It is fairly opinionated about the DETS 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, default0
revalidate
: confirm the store contents are unchanged, default:false
replace
: rewrite log contents even if it exists, default:false
Link to this section Summary
Functions
Retrieve the list of sequence numbers on a particular log identified by the author key and log number
Create and store a new log entry for a stored identity
Resolve an identity to its Base62 representation
Compact log contents to only items in the certificate pool for the latest entry. This allows validation while reducing space used
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. Includes the available certificate pool for its verification.
Retrieve an author log over a specified range: {first, last}
.
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
Purges a given log.
A list of {author, log_id, max_seqnum} tuples in the configured store
Link to this section Functions
Retrieve the list of sequence numbers on a particular log identified by the author key and log number
Create and store a new log entry for a stored identity
Resolve an identity to its Base62 representation
Attempts to resolve ~short
using stored logs
Compact log contents to only items in the certificate pool for the latest entry. This allows validation while reducing space used
Create and store a new identity
An optional secret key to be associated with the identity may provided, either raw or base62 encoded. The public key will be derived therefrom.
Retrieve all available entries in a particular log
Retrieve the key for a stored identity.
Can be either the :public
or :secret
key
Import and store a list of log entries from their binary format.
Retrieve the latest entry.
Includes the available certificate pool for its verification.
Retrieve an author log at a particular sequence number. Includes the available certificate pool for its verification.
Retrieve an author log over a specified range: {first, last}
.
Up to the limit of the stored info, a minimal chain between first
and last
is provided.
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
Purges a given log.
:all
may be specified for author
and/or the log_id
option.
Specifying both effectively clears the entire store.
Returns Baobab.stored_info/0
examples
Examples
iex> Baobab.purge(:all, log_id: :all) []
A list of {author, log_id, max_seqnum} tuples in the configured store