Library
Module
Module type
Parameter
Class
Class type
The way to control behavior of a mockup node.
val on_inject_block :
level:int32 ->
round:int32 ->
block_hash:Tezos_crypto.Block_hash.t ->
block_header:Tezos_base.TzPervasives.Block_header.t ->
operations:Tezos_base.TzPervasives.Operation.t list list ->
protocol_data:
Tezos_protocol_013_PtJakart.Protocol.Alpha_context.Block_header.protocol_data ->
(Tezos_crypto.Block_hash.t
* Tezos_base.TzPervasives.Block_header.t
* Tezos_base.TzPervasives.Operation.t list list
* propagation_vector)
Tezos_base.TzPervasives.tzresult
Lwt.t
This function is called on injection of a block by a particular baker. It allows us to inspect, change, or discard the block. Calling the injection RPC and actually updating the state of the mockup node are two different operations. Normally the first entails the latter, but not always. In particular, the propagation_vector
controls what bakers will see and incorporate the block.
val on_inject_operation :
op_hash:Tezos_crypto.Operation_hash.t ->
op:Tezos_protocol_013_PtJakart.Protocol.Alpha_context.packed_operation ->
(Tezos_crypto.Operation_hash.t
* Tezos_protocol_013_PtJakart.Protocol.Alpha_context.packed_operation
* propagation_vector)
Tezos_base.TzPervasives.tzresult
Lwt.t
This function is called on injection of an operation. It is similar to on_inject_block
, which see.
val on_new_head :
block_hash:Tezos_crypto.Block_hash.t ->
block_header:Tezos_base.TzPervasives.Block_header.t ->
(Tezos_crypto.Block_hash.t * Tezos_base.TzPervasives.Block_header.t) option
Lwt.t
This is called when a new head is going to be sent as the response to a "monitor heads" RPC call. Returning None
here terminates the process for the baker.
val on_new_operation :
(Tezos_crypto.Operation_hash.t
* Tezos_protocol_013_PtJakart.Protocol.Alpha_context.packed_operation) ->
(Tezos_crypto.Operation_hash.t
* Tezos_protocol_013_PtJakart.Protocol.Alpha_context.packed_operation)
option
Lwt.t
This is called when a new operation is going to be sent as the response to a "monitor operations" RPC call. Returning None
here indicates that the node has advanced to the next level.
val check_block_before_processing :
level:int32 ->
round:int32 ->
block_hash:Tezos_crypto.Block_hash.t ->
block_header:Tezos_base.TzPervasives.Block_header.t ->
protocol_data:
Tezos_protocol_013_PtJakart.Protocol.Alpha_context.Block_header.protocol_data ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Check a block before processing it in the mockup.
val check_chain_after_processing :
level:int32 ->
round:int32 ->
chain:chain ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Check the chain after processing a proposal.
val check_mempool_after_processing :
mempool:
(Tezos_crypto.Operation_hash.t
* Tezos_client_013_PtJakart.Mockup.M.Protocol.operation)
list ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Check operations in the mempool after injecting an operation.
val stop_on_event : Tezos_baking_013_PtJakart.Baking_state.event -> bool
This hook is used to decide when the baker is supposed to shut down. It is triggered by receiving an event.
val on_start_baker :
baker_position:int ->
delegates:Tezos_baking_013_PtJakart.Baking_state.delegate list ->
cctxt:Tezos_client_013_PtJakart.Protocol_client_context.full ->
unit Lwt.t
This hook is used to gather information on the baker when it is started (usually recording for later use). The first argument baker_position
, is the position of the baker in the list of bakers that were started for this run.
val check_chain_on_success :
chain:chain ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Check to run on the chain upon successful termination.