Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
Header Header
Transactions []Transaction
}
Block is a struct that represents a block in the blockchain.
func NewBlock ¶
func NewBlock(header Header, transactions []Transaction) Block
type Header ¶
type Header struct {
Hash string `json:"hash"`
PrevHash string `json:"prev_hash"`
Timestamp int64 `json:"timestamp"`
Size int `json:"size"`
Data string `json:"data"`
Nonce string `json:"nonce"`
MerkleRoot string `json:"merkle_root"`
Height *big.Int `json:"height"`
Confirmations *big.Int `json:"confirmations"`
Difficulty *big.Int `json:"difficulty"`
Bits string `json:"bits"`
Reward *big.Int `json:"reward"`
FeeReward *big.Int `json:"fee_reward"`
}
Header is a struct that represents a Header of block in the blockchain.
type Transaction ¶
type Transaction struct {
Input account.Address `json:"input"`
Output account.Address `json:"output"`
Description string `json:"description"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
}
Transaction is a struct that represents a transaction in the blockchain.
func (*Transaction) Hash ¶
func (t *Transaction) Hash() string
func (*Transaction) Validate ¶
func (t *Transaction) Validate() bool
type Transactions ¶
type Transactions []Transaction
func (*Transactions) MerkleRoot ¶
func (t *Transactions) MerkleRoot() string
Click to show internal directories.
Click to hide internal directories.