Documentation
¶
Index ¶
- Variables
- func DefaultEthNodeConfig(dataDir string) ethNode.Config
- func Init(cfg Config, ntw setup.Network, logger log.Logger) error
- type Config
- type Database
- func (db *Database) APIs() []rpc.API
- func (db *Database) Commit(receiver common.Address) (common.Hash, error)
- func (db *Database) Config() *eth.Config
- func (db *Database) DeliverTx(tx *ethTypes.Transaction) tmtAbciTypes.ResponseDeliverTx
- func (db *Database) Ethereum() *eth.Ethereum
- func (db *Database) FlushStateTrieDb() error
- func (db *Database) GasLimit() uint64
- func (db *Database) InitEthState(receiver common.Address) error
- func (db *Database) Protocols() []p2p.Protocol
- func (db *Database) Start(_ *p2p.Server) error
- func (db *Database) Stop() error
- func (db *Database) UpdateHeaderWithTimeInfo(tmHeader *tmtAbciTypes.Header)
- type EthState
- func (es *EthState) Commit(receiver common.Address) (common.Hash, error)
- func (es *EthState) DeliverTx(tx *ethTypes.Transaction) tmtAbciTypes.ResponseDeliverTx
- func (es *EthState) GasLimit() *core.GasPool
- func (es *EthState) Pending() (*ethTypes.Block, *state.StateDB)
- func (es *EthState) ResetWorkState(receiver common.Address) error
- func (es *EthState) SetEthConfig(ethConfig *eth.Config)
- func (es *EthState) SetEthereum(ethereum *eth.Ethereum)
- func (es *EthState) UpdateHeaderWithTimeInfo(config *params.ChainConfig, parentTime uint64, numTx uint64)
- type GethConfig
- type Node
- type NullBlockProcessor
Constants ¶
This section is empty.
Variables ¶
var ( DataDirPath = "database" // IMPORTANT: Following three values needs to correspond to the internal values used by go-ethereum KeystorePath = "keystore" ChainDbPath = "chaindata" // it needs to match to the value passed at go-ethereum/eth/backend.go:CreateDB() GenesisPath = "genesis.json" )
Functions ¶
func DefaultEthNodeConfig ¶
DefaultEthNodeConfig returns the default configuration for a go-ethereum ethereum
Types ¶
type Config ¶
type Config struct {
DataDir string
GethConfig GethConfig
}
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database handles the chain database and VM.
func NewDatabase ¶
func NewDatabase(ctx *node.ServiceContext, ethCfg *eth.Config, consAPI consensusAPI.API) (*Database, error)
func (*Database) APIs ¶
APIs returns the collection of Ethereum RPC services.
Overwrites go-ethereum/eth/backend.go::APIs().
Some of the API methods must be re-implemented to support Ethereum web3 features due to dependency on Tendermint, e.g Syncing().
func (*Database) DeliverTx ¶
func (db *Database) DeliverTx(tx *ethTypes.Transaction) tmtAbciTypes.ResponseDeliverTx
DeliverTx appends a transaction to the current block
func (*Database) FlushStateTrieDb ¶
func (*Database) InitEthState ¶
InitEthState initializes the EthState
func (*Database) UpdateHeaderWithTimeInfo ¶
func (db *Database) UpdateHeaderWithTimeInfo(tmHeader *tmtAbciTypes.Header)
UpdateHeaderWithTimeInfo uses the tendermint header to update the eth header
type EthState ¶
type EthState struct {
// contains filtered or unexported fields
}
func NewEthState ¶
func NewEthState() *EthState
After NewEthState, call SetEthereum and SetEthConfig.
func (*EthState) DeliverTx ¶
func (es *EthState) DeliverTx(tx *ethTypes.Transaction) tmtAbciTypes.ResponseDeliverTx
Execute the transaction.
func (*EthState) Pending ¶
Return a new block and a copy of the ethState from the latest work. #unstable
func (*EthState) SetEthConfig ¶
func (*EthState) SetEthereum ¶
func (*EthState) UpdateHeaderWithTimeInfo ¶
func (es *EthState) UpdateHeaderWithTimeInfo( config *params.ChainConfig, parentTime uint64, numTx uint64)
type GethConfig ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is the main object.
type NullBlockProcessor ¶
type NullBlockProcessor struct{}
We need a block processor that just ignores PoW and uncles and so on.
NullBlockProcessor does not validate anything.
#unstable
func (NullBlockProcessor) ValidateBody ¶
func (NullBlockProcessor) ValidateBody(*ethTypes.Block) error
ValidateBody does not validate anything.
#unstable