package tezos-shell

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
type block = t
module Header : sig ... end

Abstract view over block header storage. This module aims to abstract over block header's read, read_opt and known functions by calling the adequate function depending on the block being pruned or not.

val known : Chain.t -> Tezos_crypto.Block_hash.t -> bool Lwt.t
val known_valid : Chain.t -> Tezos_crypto.Block_hash.t -> bool Lwt.t
val known_invalid : Chain.t -> Tezos_crypto.Block_hash.t -> bool Lwt.t
val list_invalid : Chain.t -> (Tezos_crypto.Block_hash.t * int32 * Tezos_error_monad.TzCore.error list) list Lwt.t
val unmark_invalid : Chain.t -> Tezos_crypto.Block_hash.t -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val read_opt : Chain.t -> Tezos_crypto.Block_hash.t -> t option Lwt.t
val read_predecessor : Chain.t -> pred:int -> Tezos_crypto.Block_hash.t -> t option Lwt.t

Will return the full block if the block has never been cleaned (all blocks for nodes whose history-mode is set to archive), only the header for nodes below the save point (nodes in full or rolling history-mode). Will fail with `Not_found` if the given hash is unknown.

val store : Chain.t -> Tezos_base.Block_header.t -> Stdlib.Bytes.t -> Tezos_base.Operation.t list list -> Stdlib.Bytes.t list list -> Tezos_crypto.Block_metadata_hash.t option -> Tezos_crypto.Operation_metadata_hash.t list list option -> Tezos_validation.Block_validation.validation_store -> forking_testchain:bool -> (block option, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val store_invalid : Chain.t -> Tezos_base.Block_header.t -> Tezos_error_monad.TzCore.error list -> (bool, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val remove : t -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

remove block deletes every occurrence of block in the different stores. If block is the current head, the head is also backtracked to the block predecessor

val compare : t -> t -> int
val equal : t -> t -> bool
val timestamp : t -> Tezos_base.Time.Protocol.t
val fitness : t -> Tezos_base.Fitness.t
val validation_passes : t -> int
val chain_id : t -> Tezos_crypto.Chain_id.t
val chain_state : t -> Chain.t
val level : t -> Stdlib.Int32.t
val message : t -> (string option, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val max_operations_ttl : t -> (int, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val metadata : t -> (Stdlib.Bytes.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val last_allowed_fork_level : t -> (Stdlib.Int32.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val is_genesis : t -> bool
val predecessor : t -> t option Lwt.t
val predecessor_n : t -> int -> Tezos_crypto.Block_hash.t option Lwt.t
val is_valid_for_checkpoint : t -> Tezos_base.Block_header.t -> bool Lwt.t
val context : t -> (Tezos_storage.Context.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val context_opt : t -> Tezos_storage.Context.t option Lwt.t
val context_exn : t -> Tezos_storage.Context.t Lwt.t
val context_exists : t -> bool Lwt.t
val protocol_hash : t -> (Tezos_crypto.Protocol_hash.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val protocol_hash_exn : t -> Tezos_crypto.Protocol_hash.t Lwt.t
val test_chain : t -> (Tezos_base.Test_chain_status.t * t option) Lwt.t
val protocol_level : t -> int
val all_operation_hashes : t -> Tezos_crypto.Operation_hash.t list list Lwt.t
val all_operations : t -> Tezos_base.Operation.t list list Lwt.t
val operations_metadata : t -> int -> Stdlib.Bytes.t list Lwt.t
val all_operations_metadata : t -> Stdlib.Bytes.t list list Lwt.t
val metadata_hash : t -> Tezos_crypto.Block_metadata_hash.t option Lwt.t
val operations_metadata_hashes : t -> int -> Tezos_crypto.Operation_metadata_hash.t list option Lwt.t
val all_operations_metadata_hashes : t -> Tezos_crypto.Operation_metadata_hash.t list list option Lwt.t
val all_operations_metadata_hash : t -> Tezos_crypto.Operation_metadata_list_list_hash.t option Lwt.t
val get_rpc_directory : t -> t Tezos_rpc.RPC_directory.t option Lwt.t
val set_rpc_directory : t -> t Tezos_rpc.RPC_directory.t -> unit Lwt.t
OCaml

Innovation. Community. Security.