package octez-l2-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-l2-libs.layer2_store/Tezos_layer2_store/Irmin_context/index.html
Module Tezos_layer2_store.Irmin_context
Source
The type of trees stored in the context, i.e. the actual data.
The type of indexed repository for contexts. The parameter indicates if the index can be written or only read.
The type of context with its content.
module Tree :
Tezos_context_sigs.Context.TREE
with type t := rw
and type key := string list
and type value := bytes
and type tree := tree
A context hash is the hash produced when the data of the context is committed to disk, i.e. the commit
hash.
The type of commits for the context.
val load :
cache_size:int ->
'a Store_sigs.mode ->
string ->
'a index Tezos_base.TzPervasives.tzresult Lwt.t
load cache_size path
initializes from disk a context from path
. cache_size
allows to change the LRU cache size of Irmin (100_000 by default at irmin-pack/config.ml
readonly index
returns a read-only version of the index.
raw_commit ?message ctxt tree
commits the tree
in the context repository ctxt
on disk, and return the commit.
commit ?message context
commits content of the context context
on disk, and return the commit hash.
checkout ctxt hash
checkouts the content that corresponds to the commit hash hash
in the repository ctxt
and returns the corresponding context. If there is no commit that corresponds to hash
, it returns None
.
empty ctxt
is the context with an empty content for the repository ctxt
.
is_empty context
returns true
iff the context content of context
is empty.
split ctxt
creates a new suffix file, also called "chunk", into the Irmin's file hierarchy. This split function is expected to be called after committing a commit that will be a future candidate for a GC target.
gc index ?callback hash
removes all data older than hash
from disk. If passed, callback
will be executed when garbage collection finishes.
is_gc_finished index
returns true if a GC is finished (or idle) and false if a GC is running for index
.
wait_gc_completion index
will return a blocking thread if a GC run is currently ongoing.
val export_snapshot :
_ index ->
hash ->
path:string ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
export_snapshot index context_hash ~path
exports the context corresponding to context_hash
, if found in index
, into the given folder path. As the export uses the GC's behaviour to extract a single commit into a standalone fresh store, it is not possible to export a snapshot while a GC is running. This call will hang until the GC has finished.
Note: there is no associated import_snapshot
function as the import consist in copying the exported Irmin store.
Module for generating and verifying proofs for a context