Store_v0.Commitments
Storage containing commitments and corresponding commitment hashes that the rollup node has knowledge of.
val load :
path:string ->
index_buffer_size:int ->
'a Mavryk_layer2_store.Store_sigs.mode ->
'a t Mavryk_base.TzPervasives.tzresult Lwt.t
Load (or initializes) a store in the file path
. If readonly
is true
, the store will only be accessed in read only mode.
val mem :
[> `Read ] t ->
Mavkit_smart_rollup.Commitment.Hash.t ->
bool Mavryk_base.TzPervasives.tzresult Lwt.t
Returns true
if the key has a value associated in the store.
val find :
[> `Read ] t ->
Mavkit_smart_rollup.Commitment.Hash.t ->
Mavkit_smart_rollup.Commitment.t option Mavryk_base.TzPervasives.tzresult
Lwt.t
Returns the value associated to a key in the store, or None
otherwise.
val add :
?flush:bool ->
[> `Write ] t ->
Mavkit_smart_rollup.Commitment.Hash.t ->
Mavkit_smart_rollup.Commitment.t ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t
Add an association from a key to a value in the store. If flush
(default to true
) is set, the index is written on disk right away.
val close : _ t -> unit Mavryk_base.TzPervasives.tzresult Lwt.t
Closes the store. After this call the store cannot be accessed anymore (unless one calls load
again).
val gc :
?async:bool ->
Mavryk_layer2_store.Store_sigs.rw t ->
(Mavkit_smart_rollup.Commitment.Hash.t ->
Mavkit_smart_rollup.Commitment.t ->
bool Mavryk_base.TzPervasives.tzresult Lwt.t) ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t
gc ?async t filter
garbage collects data stored in the index t
by keeping only elements that satisfy the predicate filter
. This call runs the GC asynchronously unless async
is false
. If a GC is already ongoing this new request is ignored and this call is a no-op.
val wait_gc_completion : 'a t -> unit Lwt.t
wait_gc_completion t
returns a blocking thread if a GC run is ongoing.
val is_gc_finished : 'a t -> bool
is_gc_finished t
returns true
if there is no GC running.