Module type Pow.PoW

Abstraction for common operations in proof of work protocols.

val init_mining_power : unit -> unit

Initialize the mining power of the nodes according to the parameters

val start_minting : int -> 'a Simulator.Block.t -> unit

Given a node's ID and a block, starts the minting process by nodeID to extend that block

  • parameter node_id

    the id of the node begining the minting process

  • parameter block

    the head of the chain to be extended

val stop_minting : int -> unit

Given a node's ID, stops its minting process

  • parameter node_id

    the id of the node stopping the minting process

val get_mining_power : int -> int

Get the mining power of a given node.

  • parameter node_id

    the id of the node

val total_mining_power : unit -> int

Get the network's total mining power.