Module Store.Slots

A store of slots, indexed by slot id.

type t
val file_layout : root_dir:string -> (Tezos_dal_node_services.Types.slot_id * int) -> (unit, bytes) Tezos_stdlib_unix.Key_value_store.layout

file_layout ~root_dir (slot_id, slot_size) returns the Key_value_store layout for the given slot_id and slot_size in the root directory.

val add_slot : t -> slot_size:int -> bytes -> Tezos_dal_node_services.Types.slot_id -> (unit, [> Errors.other ]) Stdlib.result Lwt.t

add_slot store ~slot_size slot_content slot_id adds a mapping from the given slot id to the given slot content.

val find_slot : t -> slot_size:int -> Tezos_dal_node_services.Types.slot_id -> (bytes, [> Errors.other | Errors.not_found ]) Stdlib.result Lwt.t

find_slot store ~slot_size slot_id returns the slot associated to some slot id or Error `Not_found if no slot is associated.

val remove_slot : t -> slot_size:int -> Tezos_dal_node_services.Types.slot_id -> unit Tezos_base.TzPervasives.tzresult Lwt.t