package tezos-baking-alpha

  1. Overview
  2. Docs

The baker and endorser rely on this stream to be notified of new blocks.

Returns current and next protocol for a block.

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

operations returns all operations included in the block.

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.

inject_operation is used by the endorser (or the client) to inject operations, including endorsements.

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 endorsements. If there aren't enough endorsements, the baker waits on monitor_operations.

val monitor_operations : applied:bool -> branch_delayed:bool -> branch_refused:bool -> refused:bool -> ((Tezos_crypto.Operation_hash.t * Tezos_client_alpha.Mockup.M.Protocol.operation) * Tezos_error_monad.TzCore.error list option) list Tezos_rpc.RPC_answer.stream

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

val list_blocks : heads:Tezos_crypto.Block_hash.t list -> length:int option -> min_date:Tezos_base.Time.Protocol.t option -> (Tezos_crypto.Block_hash.t list list, Tezos_error_monad.TzCore.error list) Stdlib.result 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.

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.

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 -> (Stdlib.Bytes.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

Return raw protocol data as a block.

val broadcast_block : ?dests:int list -> Tezos_crypto.Block_hash.t -> Tezos_base.Block_header.t -> Tezos_base.Operation.t list list -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result 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_error_monad.TzCore.error list) Stdlib.result Lwt.t

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

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

OCaml

Innovation. Community. Security.