Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data MineBlockException = InvalidTransactionList
- mineBlock :: PublicKey -> [Transaction] -> Blockchain Validated -> IO (Either MineBlockException Block)
- mineEmptyBlock :: PublicKey -> Blockchain Validated -> IO (Either MineBlockException Block)
- mineGenesisBlock :: BlockchainConfig -> IO Block
- mineBlockchain :: BlockchainConfig -> IO (Blockchain Validated)
Documentation
data MineBlockException Source #
:: 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.
:: 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.