Documentation ¶
Index ¶
Constants ¶
View Source
const Difficulty = 12
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
func CreateBlock ¶
type BlockChain ¶
type BlockChain struct {
Blocks []*Block
}
func InitBlockChain ¶
func InitBlockChain() *BlockChain
func (*BlockChain) AddBlock ¶
func (chain *BlockChain) AddBlock(data string)
type ProofOfWork ¶
func NewProofOfWork ¶
func NewProofOfWork(b *Block) *ProofOfWork
func (*ProofOfWork) InitNonce ¶
func (pow *ProofOfWork) InitNonce(nonce int) []byte
func (*ProofOfWork) Run ¶
func (pow *ProofOfWork) Run() (int, []byte)
func (*ProofOfWork) Validate ¶
func (pow *ProofOfWork) Validate() bool
Click to show internal directories.
Click to hide internal directories.