package octez-protocol-alpha-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val monitor_validated_blocks : unit -> (Tezos_base.TzPervasives.Chain_id.t * Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Block_header.t * Tezos_base.TzPervasives.Operation.t list list) Tezos_rpc.Answer.stream

The baker relies on this stream to be notified of new valid blocks.

val monitor_heads : unit -> (Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Block_header.t) Tezos_rpc.Answer.stream

The baker relies on this stream to be notified of new heads.

val protocols : Block_services.block -> Block_services.protocols Tezos_base.TzPervasives.tzresult Lwt.t

Returns current and next protocol for a block.

val raw_header : Block_services.block -> bytes Tezos_base.TzPervasives.tzresult Lwt.t

raw_header returns the byte encoded block header of the block associated to the given block specification.

header returns the block header of the block associated to the given block specification.

val resulting_context_hash : Block_services.block -> Tezos_base.TzPervasives.Context_hash.t Tezos_base.TzPervasives.tzresult Lwt.t

resulting_context_hash returns the context resulting hash of the given block.

val operations : Block_services.block -> Tezos_client_alpha.Mockup.M.Block_services.operation list list Tezos_base.TzPervasives.tzresult Lwt.t

operations returns all operations included in the block.

val inject_block : Tezos_base.TzPervasives.Block_hash.t -> Tezos_base.TzPervasives.Block_header.t -> Tezos_base.TzPervasives.Operation.t Tezos_base.TzPervasives.trace Tezos_base.TzPervasives.trace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

inject_block_callback is called when an RPC is performed on Tezos_shell_services.Injection_services.S.block, after checking that the block header can be deserialized.

val inject_operation : Tezos_base.TzPervasives.Operation.t -> Tezos_base.TzPervasives.Operation_hash.t Tezos_base.TzPervasives.tzresult Lwt.t

inject_operation is used by the baker (or the client) to inject operations, including attestations.

val pending_operations : unit -> mempool Lwt.t

pending_operations returns the current contents of the mempool. It is used by the baker to fetch operations to potentially include in the block being baked. These operations might include attestations. If there aren't enough attestations, the baker waits on monitor_operations.

val monitor_operations : version:Block_services.version -> validated:bool -> branch_delayed:bool -> branch_refused:bool -> refused:bool -> (Block_services.version * ((Tezos_base.TzPervasives.Operation_hash.t * Tezos_client_alpha.Mockup.M.Protocol.operation) * Tezos_base.TzPervasives.error Tezos_base.TzPervasives.trace option) list) Tezos_rpc.Answer.stream

Return a stream of list of operations. Used by the baker to wait on attestations. Invariant: the stream becomes empty when the node changes head.

val list_blocks : heads:Tezos_base.TzPervasives.Block_hash.t list -> length:int option -> min_date:Tezos_base.TzPervasives.Time.Protocol.t option -> Tezos_base.TzPervasives.Block_hash.t list list Tezos_base.TzPervasives.tzresult Lwt.t

Lists block hashes from the chain, up to the last checkpoint, sorted with decreasing fitness. Without arguments it returns the head of the chain. Optional arguments allow to return the list of predecessors of a given block or of a set of blocks.

val live_blocks : Block_services.block -> Tezos_base.TzPervasives.Block_hash.Set.t Tezos_base.TzPervasives.tzresult Lwt.t

List the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.

val rpc_context_callback : Block_services.block -> Tezos_protocol_environment.rpc_context Tezos_base.TzPervasives.tzresult Lwt.t

rpc_context_callback is used in the implementations of several RPCs (see local_services.ml). It should correspond to the rpc_context constructed from the context at the requested block.

val raw_protocol_data : Block_services.block -> Tezos_base.TzPervasives.Bytes.t Tezos_base.TzPervasives.tzresult Lwt.t

Return raw protocol data as a block.

val broadcast_block : ?dests:int list -> Tezos_base.TzPervasives.Block_hash.t -> Tezos_base.TzPervasives.Block_header.t -> Tezos_base.TzPervasives.Operation.t Tezos_base.TzPervasives.trace Tezos_base.TzPervasives.trace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Broadcast block manually to nodes dests (given by their number, starting from 0). If dests is not provided, broadcast to all nodes.

val broadcast_operation : ?dests:int list -> Tezos_protocol_alpha.Protocol.Alpha_context.packed_operation -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Broadcast operation manually to nodes dests (given by their number, starting from 0). If dests is not provided, broadcast to all nodes.

val monitor_bootstrapped : unit -> (Tezos_base.TzPervasives.Block_hash.t * Tezos_base.TzPervasives.Time.Protocol.t) Tezos_rpc.Answer.stream

Simulate waiting for the node to be bootstrapped. Because the simulated node is already bootstrapped, returns the current head immediately.

OCaml

Innovation. Community. Security.