Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { Header BlockHeader `json:"header"` Transactions []SignedTransaction `json:"transactions"` }
func (Block) JsonEncode ¶
func (Block) ToProto ¶
func (b Block) ToProto() *blockchainpb.Block
type BlockHeader ¶
type Genesis ¶
type Genesis struct { ChainID uint32 `json:"chain_id"` ChainName string `json:"chain_name"` ChainSymbol string `json:"chain_symbol"` Timestamp time.Time `json:"timestamp"` Coinbase common.Address `json:"coinbase"` Allocations map[common.Address]GenesisAllocation `json:"allocs"` }
func LoadGenesisFromPath ¶
type GenesisAllocation ¶
type GenesisAllocation struct {
Balance uint64 `json:"balance"`
}
type SignedTransaction ¶
type SignedTransaction struct { Transaction Transaction `json:"transaction"` Signature []byte `json:"signature"` }
func (*SignedTransaction) ToProto ¶
func (st *SignedTransaction) ToProto() *blockchainpb.Transaction
type Transaction ¶
type Transaction struct { Sender common.Address `json:"sender"` Recipient common.Address `json:"recipient"` Amount uint64 `json:"amount"` Nonce uint64 `json:"nonce"` Gas uint64 `json:"gas"` GasPrice uint64 `json:"gas_price"` Data string `json:"data"` Timestamp time.Time `json:"timestamp"` }
func (Transaction) IsReward ¶
func (t Transaction) IsReward() bool
Click to show internal directories.
Click to hide internal directories.