Documentation ¶
Index ¶
Constants ¶
View Source
const BENEFICIARY = 100
View Source
const DIFFICULTY = 14
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { Hash []byte ParentHash []byte StateRoot []byte TxRoot []byte ReceiptRoot []byte Difficulty int Timestamp int64 Height int Transactions []*Transaction Nonce int }
func CreateBlock ¶
type BlockChain ¶
func InitBlockChain ¶
func InitBlockChain() *BlockChain
type Transaction ¶
type Transaction struct { Id []byte From []byte To []byte Value int Data []byte Sign []byte Type TxType Signature []byte // contains filtered or unexported fields }
func CoinbaseTx ¶
func CoinbaseTx(to []byte, value int) *Transaction
func ContractCreateTx ¶
func ContractCreateTx() *Transaction
func CreateTx ¶
func CreateTx(from, to []byte, value int) *Transaction
func DeserializeTransaction ¶
func DeserializeTransaction(data []byte) Transaction
func (Transaction) Serialize ¶
func (tx Transaction) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.