ethereum

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEthConfig

func NewEthConfig(ctx *cli.Context, stack *node.Node) *eth.Config

NewEthConfig for the ethereum services #unstable

func NewNodeConfig

func NewNodeConfig(ctx *cli.Context) *node.Config

NewNodeConfig for p2p and network layer #unstable

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend handles the chain database and VM #stable - 0.4.0

func NewBackend

func NewBackend(ctx *node.ServiceContext, ethConfig *eth.Config,
	client rpcClient.HTTPClient) (*Backend, error)

NewBackend creates a new Backend #stable - 0.4.0

func (*Backend) APIs

func (b *Backend) APIs() []rpc.API

APIs returns the collection of RPC services the ethereum package offers. #stable - 0.4.0

func (*Backend) AccumulateRewards

func (b *Backend) AccumulateRewards(strategy *emtTypes.Strategy)

AccumulateRewards accumulates the rewards based on the given strategy #unstable

func (*Backend) BroadcastTx

func (b *Backend) BroadcastTx(tx *ethTypes.Transaction) error

BroadcastTx broadcasts a transaction to tendermint core #unstable

func (*Backend) BroadcastTxSync

func (b *Backend) BroadcastTxSync(tx tmTypes.Tx) (*ctypes.ResultBroadcastTx, error)

func (*Backend) CachedTxInfo added in v1.4.5

func (b *Backend) CachedTxInfo() map[common.Hash]ethTypes.TxInfo

func (*Backend) Commit

func (b *Backend) Commit() (common.Hash, error)

Commit finalises the current block #unstable

func (*Backend) Config

func (b *Backend) Config() *eth.Config

Config returns the eth.Config. #stable

func (*Backend) CurrentTxInfo added in v1.4.5

func (b *Backend) CurrentTxInfo() ethTypes.TxInfo

func (*Backend) DeleteCachedTxInfo added in v1.4.5

func (b *Backend) DeleteCachedTxInfo(txHash common.Hash)

func (*Backend) DeliverTx

func (b *Backend) DeliverTx(tx *ethTypes.Transaction, appVerion uint64, txInfo ethTypes.TxInfo) abciTypes.ResponseDeliverTx

DeliverTx appends a transaction to the current block #stable

func (*Backend) Es

func (b *Backend) Es() *EthState

func (*Backend) Ethereum

func (b *Backend) Ethereum() *eth.Ethereum

Ethereum returns the underlying the ethereum object. #stable

func (*Backend) FetchCachedTxInfo added in v1.4.5

func (b *Backend) FetchCachedTxInfo(txHash common.Hash) (ethTypes.TxInfo, bool)

func (*Backend) GasLimit

func (b *Backend) GasLimit() uint64

GasLimit returns the maximum gas per block #unstable

func (*Backend) InitEthState

func (b *Backend) InitEthState(receiver common.Address) error

InitEthState initializes the EthState #unstable

func (*Backend) InitReceiver

func (b *Backend) InitReceiver() string

func (*Backend) InsertCachedTxInfo added in v1.4.5

func (b *Backend) InsertCachedTxInfo(txHash common.Hash, txInfo ethTypes.TxInfo)

func (*Backend) MemPool added in v1.4.2

func (b *Backend) MemPool() mempl.Mempool

func (*Backend) Protocols

func (b *Backend) Protocols() []p2p.Protocol

Protocols implements node.Service, returning all the currently configured network protocols to start. #stable

func (*Backend) SetMemPool

func (b *Backend) SetMemPool(memPool mempl.Mempool)

func (*Backend) Start

func (b *Backend) Start(_ *p2p.Server) error

Start implements node.Service, starting all internal goroutines needed by the Ethereum protocol implementation. #stable

func (*Backend) Stop

func (b *Backend) Stop() error

Stop implements node.Service, terminating all internal goroutines used by the Ethereum protocol. #stable

func (*Backend) UpdateHeaderWithTimeInfo

func (b *Backend) UpdateHeaderWithTimeInfo(tmHeader *abciTypes.Header)

UpdateHeaderWithTimeInfo uses the tendermint header to update the ethereum header #unstable

type ChainError

type ChainError struct {
	ErrorCode   int    // Describes the kind of error
	Description string // Human readable description of the issue
}

func (ChainError) Error

func (e ChainError) Error() string

Error satisfies the error interface and prints human-readable errors.

type EthState

type EthState struct {
	// contains filtered or unexported fields
}

func NewEthState

func NewEthState() *EthState

After NewEthState, call SetEthereum and SetEthConfig.

func (*EthState) AccumulateRewards

func (es *EthState) AccumulateRewards(strategy *emtTypes.Strategy)

Accumulate validator rewards.

func (*EthState) Commit

func (es *EthState) Commit() (common.Hash, error)

Commit and reset the work.

func (*EthState) DeliverTx

func (es *EthState) DeliverTx(tx *ethTypes.Transaction, appVersion uint64, txInfo ethTypes.TxInfo) abciTypes.ResponseDeliverTx

Execute the transaction.

func (*EthState) GasLimit

func (es *EthState) GasLimit() uint64

func (*EthState) Pending

func (es *EthState) Pending() (*ethTypes.Block, *state.StateDB)

Return a new block and a copy of the state from the latest work. #unstable

func (*EthState) ResetWorkState

func (es *EthState) ResetWorkState(receiver common.Address) error

func (*EthState) SetEthConfig

func (es *EthState) SetEthConfig(ethConfig *eth.Config)

func (*EthState) SetEthereum

func (es *EthState) SetEthereum(ethereum *eth.Ethereum)

func (*EthState) State

func (es *EthState) State() (*state.StateDB, error)

func (*EthState) UpdateHeaderCoinbase

func (es *EthState) UpdateHeaderCoinbase(
	coinbase common.Address)

func (*EthState) UpdateHeaderWithTimeInfo

func (es *EthState) UpdateHeaderWithTimeInfo(
	config *params.ChainConfig, parentTime uint64, numTx uint64)

func (*EthState) WorkState added in v1.4.2

func (es *EthState) WorkState() workState

type NetRPCService

type NetRPCService struct {
	// contains filtered or unexported fields
}

NetRPCService mirrors the implementation of `internal/ethapi` #unstable

func NewNetRPCService

func NewNetRPCService(networkVersion uint64) *NetRPCService

NewNetRPCService creates a new net API instance. #unstable

func (*NetRPCService) Listening

func (n *NetRPCService) Listening() bool

Listening returns an indication if the node is listening for network connections. #unstable

func (*NetRPCService) PeerCount

func (n *NetRPCService) PeerCount() hexutil.Uint

PeerCount returns the number of connected peers #unstable

func (*NetRPCService) Version

func (n *NetRPCService) Version() string

Version returns the current ethereum protocol version. #unstable

type Node

type Node struct {
	node.Node
}

Node is the main object.

func New

func New(conf *node.Config) (*Node, error)

New creates a new node.

func (*Node) Start

func (n *Node) Start() error

Start starts base node and stop p2p server

type NullBlockProcessor

type NullBlockProcessor struct{}

NullBlockProcessor does not validate anything #unstable

func (*NullBlockProcessor) ValidateBody

func (v *NullBlockProcessor) ValidateBody(block *ethTypes.Block) error

ValidateBody does not validate anything #unstable

func (*NullBlockProcessor) ValidateState

func (v *NullBlockProcessor) ValidateState(block, parent *ethTypes.Block, state *state.StateDB, receipts ethTypes.Receipts, usedGas uint64) error

ValidateState does not validate anything #unstable

type TxFrom added in v1.4.2

type TxFrom struct {
	TxHash common.Hash
	From   common.Address
}

Jump to

Keyboard shortcuts

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