Documentation ¶
Index ¶
- Constants
- func ApplyTx(tx SignedTx, s *State) error
- func InitDataDirIfNotExists(dataDir string, genesis []byte) error
- func IsBlockHashValid(hash Hash) bool
- func NewAccount(value string) common.Address
- func ValidateTx(tx SignedTx, s *State) error
- type Block
- type BlockFS
- type BlockHeader
- type Genesis
- type Hash
- type SignedTx
- type State
- func (s *State) AddBlock(b Block) (Hash, error)
- func (s *State) AddBlocks(blocks []Block) error
- func (s *State) Close() error
- func (s *State) Copy() State
- func (s *State) GetNextAccountNonce(account common.Address) uint
- func (s *State) LatestBlock() Block
- func (s *State) LatestBlockHash() Hash
- func (s *State) NextBlockNumber() uint64
- type Tx
Constants ¶
View Source
const BlockReward = 100
View Source
const TxFee = uint(50)
Variables ¶
This section is empty.
Functions ¶
func InitDataDirIfNotExists ¶
func IsBlockHashValid ¶
func NewAccount ¶
func ValidateTx ¶
Types ¶
type Block ¶
type Block struct { Header BlockHeader `json:"header"` TXs []SignedTx `json:"payload"` }
type BlockHeader ¶
type State ¶
type State struct { Balances map[common.Address]uint Account2Nonce map[common.Address]uint // contains filtered or unexported fields }
func NewStateFromDisk ¶
func (*State) GetNextAccountNonce ¶
func (*State) LatestBlock ¶
func (*State) LatestBlockHash ¶
func (*State) NextBlockNumber ¶
Click to show internal directories.
Click to hide internal directories.