ethereum

package
v0.0.0-...-bc2dafa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL