Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { Timestamp int64 PrevHash []byte Hash []byte Data []byte Height int64 DiffNum uint Nonce int64 CMAC []byte }
func DeserializeBlock ¶
func NewGenesisBlock ¶
func NewGenesisBlock() *Block
type Blockchain ¶
type Blockchain struct {
// contains filtered or unexported fields
}
func NewBlockchain ¶
func NewBlockchain(dbFile string) *Blockchain
func (*Blockchain) AddBlock ¶
func (bc *Blockchain) AddBlock(data string)
func (*Blockchain) BlockChainIteration ¶
func (bc *Blockchain) BlockChainIteration()
func (*Blockchain) NewIterator ¶
func (bc *Blockchain) NewIterator() *BlockchainIterator
type BlockchainIterator ¶
type BlockchainIterator struct {
// contains filtered or unexported fields
}
func (*BlockchainIterator) Next ¶
func (i *BlockchainIterator) Next() *Block
type ProofOfWork ¶
type ProofOfWork struct {
// contains filtered or unexported fields
}
func NewProofOfWork ¶
func NewProofOfWork(b *Block) *ProofOfWork
func (*ProofOfWork) PrepareData ¶
func (pow *ProofOfWork) PrepareData(nonce int64) []byte
func (*ProofOfWork) Validate ¶
func (pow *ProofOfWork) Validate() bool
Click to show internal directories.
Click to hide internal directories.