An index store to map L2 block level to L2 block hashes. It is composed of an index only.

include INDEXABLE_STORE with type key := L2block.level with type value := L2block.hash
type t

The type of store build in indexes

val mem : t -> L2block.level -> bool Lwt.t

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

val find : t -> L2block.level -> L2block.hash option Lwt.t

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

val add : ?flush:bool -> t -> L2block.level -> L2block.hash -> unit 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 remove : ?flush:bool -> t -> L2block.level -> unit Lwt.t

Removes an association from the store. Does nothing if the key was not registered.