package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Storage mapping commitment hashes to the level when they were published by the rollup node. It only contains hashes of commitments published by this rollup node.

type element = {
  1. first_published_at_level : int32;
    (*

    The level at which this commitment was first published.

    *)
  2. published_at_level : int32 option;
    (*

    The level at which we published this commitment. If first_published_at_level <> published_at_level it means that the commitment is republished.

    *)
}
include Tezos_layer2_store.Indexed_store.INDEXABLE_STORE with type key := Octez_smart_rollup.Commitment.Hash.t and type value := element
type +'a t

The type of store built on indexes.

val load : path:string -> index_buffer_size:int -> 'a Tezos_layer2_store.Store_sigs.mode -> 'a t Tezos_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.

Returns true if the key has a value associated in the store.

Returns the value associated to a key in the store, or None otherwise.

val add : ?flush:bool -> [> `Write ] t -> Octez_smart_rollup.Commitment.Hash.t -> element -> unit Tezos_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.

Closes the store. After this call the store cannot be accessed anymore (unless one calls load again).

val readonly : [> `Read ] t -> [ `Read ] t

readonly t returns a read only version of the store 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.

OCaml

Innovation. Community. Security.