Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type t = {
hash : Tezos_crypto.Block_hash.t;
header : Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.t;
operations : Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed list;
context : Tezos_protocol_environment.Context.t;
Resulting context
*)}
type block = t
val rpc_ctxt : t Tezos_protocol_alpha.Protocol.Environment.RPC_context.simple
type baker_policy =
| By_priority of int
| By_account of Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash
| Excluding of Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash list
Policies to select the next baker:
By_priority p
selects the baker at priority p
By_account pkh
selects the first slot for baker pkh
Excluding pkhs
selects the first baker that doesn't belong to pkhs
val get_next_baker :
?policy:baker_policy ->
t ->
(Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash
* int
* Tezos_base.Time.Protocol.t,
Tezos_error_monad.TzCore.error list)
Stdlib.result
Lwt.t
Returns (account, priority, timestamp) of the next baker given a policy, defaults to By_priority 0.
val get_endorsing_power :
block ->
(int, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
module Forge : sig ... end
val genesis :
?with_commitments:bool ->
?endorsers_per_block:int ->
?initial_endorsers:int ->
?min_proposal_quorum:int32 ->
(Account.t * Tezos_protocol_alpha.Protocol.Alpha_context.Tez.tez) list ->
(block, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
genesis <opts> accounts
: generates an initial block with the given constants <opts>
and initializes accounts
with their associated amounts.
val genesis_with_parameters :
Tezos_protocol_alpha.Protocol.Alpha_context.Parameters.t ->
(block, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
val apply :
Tezos_protocol_alpha.Protocol.Alpha_context.Block_header.block_header ->
?operations:Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed list ->
t ->
(t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
Applies a signed header and its operations to a block and obtains a new block
val bake :
?policy:baker_policy ->
?timestamp:Tezos_protocol_alpha.Protocol.Alpha_context.Timestamp.time ->
?operation:Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
?operations:Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed list ->
t ->
(t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
bake b
returns a block b'
which has as predecessor block b
. Optional parameter policy
allows to pick the next baker in several ways. This function bundles together forge_header
, sign_header
and apply
. These functions should be used instead of bake to craft unusual blocks for testing together with setters for properties of the headers. For examples see seed.ml or double_baking.ml
val bake_n :
?policy:baker_policy ->
int ->
t ->
(block, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
Bakes n
blocks.
val current_cycle :
t ->
(Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t,
Tezos_error_monad.TzCore.error list)
Stdlib.result
Lwt.t
val bake_until_cycle_end :
?policy:baker_policy ->
t ->
(t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
Given a block b
at level l
bakes enough blocks to complete a cycle, that is blocks_per_cycle - (l % blocks_per_cycle)
.
val bake_until_n_cycle_end :
?policy:baker_policy ->
int ->
t ->
(t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
Bakes enough blocks to end n
cycles.
val bake_until_cycle :
?policy:baker_policy ->
Tezos_protocol_alpha.Protocol.Alpha_context.Cycle.t ->
t ->
(t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
Bakes enough blocks to reach the cycle.