Tezos_baking_024_PtTALLiN.Baking_noncestype t = statenonces is a hash map corresponding to the data which can be found in the file from nonces_location
val load :
Tezos_client_base.Client_context.wallet ->
stateful_location:[ `Stateful_nonce ] Baking_files.location ->
nonces Tezos_base.TzPervasives.tzresult Lwt.tload wallet location loads the file corresponding to location and returns a data structure containing the stored information.
val generate_seed_nonce :
?timeout:float ->
Baking_configuration.nonce_config ->
Baking_state_types.Key.t ->
Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Raw_level.t ->
(Tezos_protocol_024_PtTALLiN.Protocol.Nonce_hash.t
* Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Nonce.t)
Tezos_base.TzPervasives.tzresult
Lwt.tgenerate_seed_nonce nonce_config delegate level computes a nonce via a Deterministic or Random approach, depending on the nonce_config argument; the deterministic case uses as parameters delegate and level.
val register_nonce :
Tezos_client_024_PtTALLiN.Protocol_client_context.full ->
chain_id:Tezos_base.TzPervasives.Chain_id.t ->
Tezos_base.TzPervasives.Block_hash.t ->
Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Nonce.t ->
cycle:Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Cycle.t ->
level:Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Raw_level.t ->
round:Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Round.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tregister_nonce cctxt ~chain_id block_hash nonce ~cycle ~level ~round updates the contents from the nonces file located using cctxt and ~chain_id by adding a new entry or replacing an existing one of the form block_hash : nonce * ~cycle * ~level * ~round.
val start_revelation_worker :
Tezos_client_024_PtTALLiN.Protocol_client_context.full ->
Baking_configuration.nonce_config ->
Tezos_base.TzPervasives.Chain_id.t ->
Tezos_protocol_024_PtTALLiN.Protocol.Alpha_context.Constants.t ->
(Lwt_canceler.t
* (Tezos_client_024_PtTALLiN.Protocol_client_context.full ->
Baking_state_types.proposal ->
unit))
Lwt.tstart_revelation_worker cctxt config chain_id constants starts the continuous process of monitoring block proposals to determine when nonces should be revealed. The internal state is created from cctxt, ~extra_nodes, config, chain_id and constants.
The function returns a canceller to stop the worker and a callback function to push new block proposals for processing. The callback takes a cctxt to identify which node the proposal came from, and the proposal itself.
Nonce revelations will be injected to all nodes (cctxt and ~extra_nodes) in parallel.