Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Header Hash []byte Transactions []transaction.Transaction }
Block represents a simple block
func New ¶
func New(previousBlockHash []byte, txs []transaction.Transaction) Block
New creates new block with given transactions. New block points to a previous block.
func NewGenesis ¶
func NewGenesis(txs []transaction.Transaction) Block
NewGenesis creates genesis block with given transactions It's used for test only. You can get generated genesis block with blockchain.ReadGenesisBlock
type Header ¶
type Header struct { PreviousBlockHash []byte MerkleRootHash []byte Timestamp int64 Target []byte Nonce uint64 }
Header represents a block header
type Solver ¶
Solver represents a simple interface that knows how to hash a given block You can read more about different hashing algorithms here: https://en.bitcoin.it/wiki/Proof_of_work
func NewDSHA256Solver ¶
NewDSHA256Solver return a double sha256 solver implementation
Click to show internal directories.
Click to hide internal directories.