blockchain-0.0.3: Generic blockchain implementation.

Safe HaskellNone
LanguageHaskell2010

Data.Blockchain.Mining

Synopsis

Documentation

mineBlock Source #

Arguments

:: PublicKey

PublicKey address where coinbase reward will be sent

-> [Transaction]

List of transactions to include in transaction

-> Blockchain Validated

Validated blockchain

-> IO (Either MineBlockException Block) 

Finds the next block of a blockchain. Depending on blockchain configuration, this function may take a long time to complete.

mineEmptyBlock Source #

Arguments

:: PublicKey

PublicKey address where coinbase reward will be sent

-> Blockchain Validated

Validated blockchain

-> IO (Either MineBlockException Block) 

Finds the next block of a blockchain, without including any transactions. Most useful for testing - removes the invariant of an invalid transaction list. Depending on blockchain configuration, this function may take a long time to complete.

mineGenesisBlock :: BlockchainConfig -> IO Block Source #

Finds the first block of a blockchain. Depending on blockchain configuration, this function may take a long time to complete. Note: this generates a keypair but throws away the private key. Coinbase reward in genesis block cannot never be spent.

mineBlockchain :: BlockchainConfig -> IO (Blockchain Validated) Source #

Creates a blockchain from the given config. This includes mining a genesis block.