Documentation ¶
Index ¶
- func ReadBlockConfigDir() string
- type EthereumWorkState
- func (es *EthereumWorkState) BeginBlock(blockHash []byte, parentTime uint64, numTx uint64) error
- func (es *EthereumWorkState) Commit(blockheight uint64) (common.Hash, error)
- func (es *EthereumWorkState) DecodeTx(txBytes []byte) (*ethTypes.Transaction, error)
- func (es *EthereumWorkState) DeliverTx(txBytes []byte) error
- func (es *EthereumWorkState) EndBlock(blockheight uint64) error
- func (es *EthereumWorkState) GetEthBackend() *eth.Ethereum
- func (es *EthereumWorkState) GetFreeGasManager() *core.FreeGasManager
- func (es *EthereumWorkState) GetblockNumber() uint64
- type TxListenPush
- type TxListenPushBroadcastTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBlockConfigDir ¶
func ReadBlockConfigDir() string
Types ¶
type EthereumWorkState ¶
type EthereumWorkState struct { Header *ethTypes.Header State *state.StateDB Transactions []*ethTypes.Transaction Receipts ethTypes.Receipts Mtx *sync.Mutex // contains filtered or unexported fields }
EthereumWorkState EthereumWorkState is used for core business logic such as trading and block packaging
func NewEthereumWorkState ¶
func NewEthereumWorkState(ethereum *eth.Ethereum) *EthereumWorkState
NewEthereumWorkState Create and return an EthereumWorkState object pointer
func (*EthereumWorkState) BeginBlock ¶
func (es *EthereumWorkState) BeginBlock(blockHash []byte, parentTime uint64, numTx uint64) error
BeginBlock starts a new Ethereum block
func (*EthereumWorkState) Commit ¶
func (es *EthereumWorkState) Commit(blockheight uint64) (common.Hash, error)
Commit Callback is done after the completion of the Tendermint consensus, mainly used to create blocks and insert blocks into the blockchain
func (*EthereumWorkState) DecodeTx ¶
func (es *EthereumWorkState) DecodeTx(txBytes []byte) (*ethTypes.Transaction, error)
rlp decode an etherum transaction
func (*EthereumWorkState) DeliverTx ¶
func (es *EthereumWorkState) DeliverTx(txBytes []byte) error
DeliverTx is called back by the tendermint memory pool, as long as it is used to execute the transaction
func (*EthereumWorkState) EndBlock ¶
func (es *EthereumWorkState) EndBlock(blockheight uint64) error
EndBlock starts a new Ethereum block
func (*EthereumWorkState) GetEthBackend ¶
func (es *EthereumWorkState) GetEthBackend() *eth.Ethereum
func (*EthereumWorkState) GetFreeGasManager ¶
func (es *EthereumWorkState) GetFreeGasManager() *core.FreeGasManager
func (*EthereumWorkState) GetblockNumber ¶
func (es *EthereumWorkState) GetblockNumber() uint64
type TxListenPush ¶
type TxListenPush struct {
// contains filtered or unexported fields
}
TxListenPush Used to subscribe to the transaction in the Ethereum txpool and push the transaction to the tendermint txpool
func NewTxListenPush ¶
func NewTxListenPush(eth *eth.Ethereum, hook TxListenPushBroadcastTransaction) *TxListenPush
NewTxListenPush Create and return a TxListenPush object pointer
func (*TxListenPush) Start ¶
func (e *TxListenPush) Start()
Start Subscribe to the new deal in Ethereum TXpool and launch a go coroutine
type TxListenPushBroadcastTransaction ¶
type TxListenPushBroadcastTransaction interface {
BroadcastTransaction([]byte)
}