Documentation ¶
Index ¶
- type BlockChain
- func (bc *BlockChain) Config() *params.ChainConfig
- func (bc *BlockChain) CurrentBlock() *types.Block
- func (bc *BlockChain) ExecActions(statedb *state.StateDB, actions []*types.Action)
- func (bc *BlockChain) ExecTransaction(author *utils.Address, dposcontext *types.DposContext, gp *utils.GasPool, ...) ([]byte, *types.Receipt, uint64, error)
- func (bc *BlockChain) ExportN(w io.Writer, first uint64, last uint64) error
- func (bc *BlockChain) GetCurrentInfo() (*types.Block, *state.StateDB, error)
- func (bc *BlockChain) InsertChain(blocks types.Blocks) (int, error)
- func (bc *BlockChain) PostEvent(event interface{})
- func (bc *BlockChain) SetAddActionInterface(tp exec.ITxPool)
- func (bc *BlockChain) State() (*state.StateDB, error)
- func (bc *BlockChain) StateAt(root utils.Hash) (*state.StateDB, error)
- func (bc *BlockChain) Stop()
- func (bc *BlockChain) SubscribeChainBlockEvent(ch chan<- feed.BlockAndLogsEvent) feed.Subscription
- func (bc *BlockChain) SubscribeSideBlockEvent(ch chan<- feed.ForkBlockEvent) feed.Subscription
- func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts types.Receipts, state *state.StateDB) (bool, error)
- func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockChain ¶
type BlockChain struct { *ledger.Ledger SideBlockscription feed.Subscription // contains filtered or unexported fields }
BlockChain manages chain imports, reverts, chain reorganisations.
func NewBlockChain ¶
func NewBlockChain(cfg *ledger.Config, chainCfg *params.ChainConfig, statedb state.Database, db db.Database, engine consensus.Engine, vmCfg *vm.Config) (*BlockChain, error)
NewBlockChain returns a fully initialised block chain using information available in the database.
func (*BlockChain) Config ¶
func (bc *BlockChain) Config() *params.ChainConfig
func (*BlockChain) CurrentBlock ¶
func (bc *BlockChain) CurrentBlock() *types.Block
CurrentBlock retrieves the current head block of the canonical chain.
func (*BlockChain) ExecActions ¶
func (bc *BlockChain) ExecActions(statedb *state.StateDB, actions []*types.Action)
ExecActions execute actions
func (*BlockChain) ExecTransaction ¶
func (bc *BlockChain) ExecTransaction(author *utils.Address, dposcontext *types.DposContext, gp *utils.GasPool, statedb *state.StateDB, header *types.BlockHeader, tx *types.Transaction, usedGas *uint64, cfg vm.Config) ([]byte, *types.Receipt, uint64, error)
ExecTransaction execute transaction and return receipts
func (*BlockChain) GetCurrentInfo ¶
GetCurrentInfo return current info
func (*BlockChain) InsertChain ¶
func (bc *BlockChain) InsertChain(blocks types.Blocks) (int, error)
func (*BlockChain) PostEvent ¶
func (bc *BlockChain) PostEvent(event interface{})
func (*BlockChain) SetAddActionInterface ¶
func (bc *BlockChain) SetAddActionInterface(tp exec.ITxPool)
func (*BlockChain) State ¶
func (bc *BlockChain) State() (*state.StateDB, error)
State returns a new mutable state based on the current HEAD block.
func (*BlockChain) StateAt ¶
StateAt returns a new mutable state based on a particular point in time.
func (*BlockChain) SubscribeChainBlockEvent ¶
func (bc *BlockChain) SubscribeChainBlockEvent(ch chan<- feed.BlockAndLogsEvent) feed.Subscription
SubscribeChainBlockEvent registers a subscription of Blockfeed.
func (*BlockChain) SubscribeSideBlockEvent ¶
func (bc *BlockChain) SubscribeSideBlockEvent(ch chan<- feed.ForkBlockEvent) feed.Subscription
SubscribeSideBlockEvent registers a subscription of Blockfeed.
func (*BlockChain) WriteBlockWithState ¶
func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts types.Receipts, state *state.StateDB) (bool, error)
WriteBlockWithState write the block to the chain and get the status.
func (*BlockChain) WriteBlockWithoutState ¶
WriteBlockWithoutState writes only the block and its metadata to the database, but does not write any state.
Directories ¶
Path | Synopsis |
---|---|
Package state provides a caching layer atop the Ethereum state mtp.
|
Package state provides a caching layer atop the Ethereum state mtp. |
Package vm implements the Ethereum Virtual Machine.
|
Package vm implements the Ethereum Virtual Machine. |
runtime
Package runtime provides a basic execution model for executing EVM code.
|
Package runtime provides a basic execution model for executing EVM code. |