Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BC = NewBlockchain()
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Hash string `json:"hash"` PreviousHash string `json:"previous_hash"` MerkleRoot string `json:"merkle_root"` Txs []Tx `json:"tx"` Index int `json:"index"` Timestamp int64 `json:"timestamp"` Nonce int `json:"Nonce"` Difficulty int `json:"difficulty"` }
func (*Block) CalculateHash ¶
func (*Block) CalculateMerkleRoot ¶
type Blockchain ¶
type Blockchain struct { Chain []Block `json:"chain"` PendingTransactions []Tx `json:"pending_transactions"` Difficulty int `json:"difficulty"` MiningReward int `json:"mining_reward"` }
func NewBlockchain ¶
func NewBlockchain() *Blockchain
func (*Blockchain) GetLatestBlock ¶
func (bc *Blockchain) GetLatestBlock() Block
func (*Blockchain) Print ¶
func (bc *Blockchain) Print()
Click to show internal directories.
Click to hide internal directories.