Documentation ¶
Index ¶
- Constants
- func NewBlock(reward *big.Int, coinbase common.Address, chainDB, mptDB *pebble.DB, ...)
- func NewBlock2(reward, nonce, diff, prevNum *big.Int, prevHash []byte, ...)
- func NewGenesisBlock(chainDB *pebble.DB)
- func PreOrderTraversal(root *MerkleNode)
- func PrintNode(node *MerkleNode)
- func PushTxToPool(loc []byte, tx *Transaction, txDB *pebble.DB)
- func TxIsFull(txDB *pebble.DB) (bool, []byte)
- type Block
- type BlockBody
- type BlockHeader
- type MerkleNode
- type MerkleTree
- type State
- type Transaction
Constants ¶
View Source
const PoolSize = 8
Variables ¶
This section is empty.
Functions ¶
func NewGenesisBlock ¶
func PreOrderTraversal ¶ added in v1.4.0
func PreOrderTraversal(root *MerkleNode)
func PrintNode ¶ added in v1.4.0
func PrintNode(node *MerkleNode)
func PushTxToPool ¶ added in v1.4.0
func PushTxToPool(loc []byte, tx *Transaction, txDB *pebble.DB)
Types ¶
type BlockBody ¶
type BlockBody struct {
Txs []*Transaction
}
type BlockHeader ¶
type MerkleNode ¶
type MerkleNode struct { Left *MerkleNode Right *MerkleNode Hash []byte }
func NewMerkleNode ¶
func NewMerkleNode(left, right *MerkleNode, tx *Transaction) *MerkleNode
type MerkleTree ¶
type MerkleTree struct {
RootNode *MerkleNode
}
func NewMerkleTree ¶
func NewMerkleTree(txs []*Transaction) *MerkleTree
type State ¶ added in v1.4.0
type State struct { Nonce uint64 // The number of transactions completed by the wallet Balance *big.Int // Current Account Balance Storage common.Hash // Contract Code Storage Hash CodeHash []byte // Contract Code Hash }
func DeserializeState ¶ added in v1.4.0
type Transaction ¶
type Transaction struct { TxHash common.Hash From common.Address To common.Address Value *big.Int Time uint64 PubKey []byte Signature []byte State int }
func DeserializeTx ¶ added in v1.4.0
func DeserializeTx(b []byte) *Transaction
func NewTransaction ¶
func (*Transaction) Hash ¶ added in v1.4.0
func (tx *Transaction) Hash() []byte
func (*Transaction) Serialize ¶
func (tx *Transaction) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.