package tezos-shell

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

Tezos Shell Module - Managing the current head.

The genesis block of the chain. On a test chain, the test protocol has been promoted as "main" protocol.

The current head of the chain.

type data = {
  1. current_head : State.Block.t;
  2. current_mempool : Tezos_base.Mempool.t;
  3. live_blocks : Tezos_crypto.Block_hash.Set.t;
  4. live_operations : Tezos_crypto.Operation_hash.Set.t;
  5. test_chain : Tezos_crypto.Chain_id.t option;
  6. save_point : Stdlib.Int32.t * Tezos_crypto.Block_hash.t;
  7. caboose : Stdlib.Int32.t * Tezos_crypto.Block_hash.t;
}

All the available chain data.

val data : State.Chain.t -> data Lwt.t

Reading atomically all the chain data.

val known_heads : State.Chain.t -> State.Block.t list Lwt.t

The current head and all the known (valid) alternate heads.

Test whether a block belongs to the current mainchain.

Record a block as the current head of the chain. It returns the previous head.

val test_and_set_head : State.Chain.t -> old:State.Block.t -> State.Block.t -> (bool, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

Atomically change the current head of the chain. This returns true whenever the change succeeded, or false when the current head is not equal to the old argument.

val init_head : State.Chain.t -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

Restores the data about the current head at startup (recomputes the sets of live blocks and operations).

OCaml

Innovation. Community. Security.