Simulator.Blocktype balances = (node_id * float) listtype block_header = {id : block_id; | (* id of the block *) |
height : int; | (* height of the block in the chain *) |
minter : node_id; | (* id of the node who minted the block *) |
parent : node_id option; | (* parent of the block *) |
timestamp : Clock.t; | (* timestamp when the block was created *) |
balances : balances; | (* the balance of each node *) |
difficulty : int; | (* difficulty of creating the block *) |
total_difficulty : int; | (* total difficulty of creating the chain up to this block *) |
}Mandatory information that every block possesses.
Type of a block: header + user-defined information
module type BlockRewards = sig ... endModule that contains the reward function to be called when creating a new block.
module NoRewards : sig ... endModule for non-varying balances throughout the simulation.
module BaseRewards : sig ... endBase module for rewarding the minter of a block.
module type BlockSig = sig ... endThe signature for a block module.
module type BlockContent = sig ... endWrapper for the type of a block's contents.
module Make (Logger : Logging.Logger) (BlockContent : BlockContent) (Rewards : BlockRewards) : BlockSig with type block_contents = BlockContent.t and type block = BlockContent.t tFunctor for creating the implementation for a Block, given the Logger, BlockContent and BlockRewards modules.