package octez-smart-rollup-node-lib
type 'a t = [< `Read | `Write Read ] as 'a store
Type of store. The parameter indicates if the store can be written or only read.
type rw = Tezos_layer2_store.Store_sigs.rw t
Read/write store t
.
type ro = Tezos_layer2_store.Store_sigs.ro t
Read only store t
.
val version : Store_version.t
Version supported by this code.
val close : _ t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
close store
closes the store.
val load :
'a Tezos_layer2_store.Store_sigs.mode ->
index_buffer_size:int ->
l2_blocks_cache_size:int ->
string ->
'a store Tezos_base.TzPervasives.tzresult Lwt.t
load mode ~index_buffer_size ~l2_blocks_cache_size directory
loads a store from the data persisted in directory
. If mode
is Store_sigs.Read_only
, then the indexes and irmin store will be opened in readonly mode and only read operations will be permitted. This allows to open a store for read access that is already opened in Store_sigs.Read_write
mode in another process. index_buffer_size
is the maximum cache size in memory before it is flushed to disk. l2_blocks_cache_size
is the number of L2 blocks the rollup node will keep in memory.
val iter_l2_blocks :
?progress:string ->
Metadata.t ->
_ t ->
(Octez_smart_rollup.Sc_rollup_block.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.t) ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
iter_l2_blocks ?progress metadata store f
iterates f
on all L2 blocks reachable from the head, from newest to oldest. If progress
is provided, a progress bar is displayed with the progress messages during the iteration.
val gc : rw -> level:int32 -> unit Tezos_base.TzPervasives.tzresult Lwt.t
gc store ~level
asynchronously garbage collects everything from the store that concerns blocks for levels below level
.