eth

package
v0.0.0-...-10c1c44 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Overview

Package eth implements the Ethereum protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config = ethconfig.Config

Config contains the configuration options of the ETH protocol. Deprecated: use ethconfig.Config instead.

type Ethereum

type Ethereum struct {
	APIBackend *EthAPIBackend
	// contains filtered or unexported fields
}

Ethereum implements the Ethereum full node service.

func New

func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error)

New creates a new Ethereum object (including the initialisation of the common Ethereum object)

func (*Ethereum) APIs

func (s *Ethereum) APIs() []rpc.API

APIs return the collection of RPC services the ethereum package offers. NOTE, some of these services probably need to be moved to somewhere else.

func (*Ethereum) AccountManager

func (s *Ethereum) AccountManager() *accounts.Manager

func (*Ethereum) ArchiveMode

func (s *Ethereum) ArchiveMode() bool

func (*Ethereum) BlockChain

func (s *Ethereum) BlockChain() *core.BlockChain

func (*Ethereum) BloomIndexer

func (s *Ethereum) BloomIndexer() *core.ChainIndexer

func (*Ethereum) BroadcastBlockToAll

func (s *Ethereum) BroadcastBlockToAll(block *types.Block)

func (*Ethereum) ChainDb

func (s *Ethereum) ChainDb() ethdb.Database

func (*Ethereum) Downloader

func (s *Ethereum) Downloader() *downloader.Downloader

func (*Ethereum) EcConnector

func (s *Ethereum) EcConnector() *ecconnector.EcConnector

for accessing ecconnector: by yim, etri

func (*Ethereum) Engine

func (s *Ethereum) Engine() consensus.Engine

func (*Ethereum) Etherbase

func (s *Ethereum) Etherbase() (eb common.Address, err error)

func (*Ethereum) EventMux

func (s *Ethereum) EventMux() *event.TypeMux

func (*Ethereum) IsListening

func (s *Ethereum) IsListening() bool

func (*Ethereum) IsMining

func (s *Ethereum) IsMining() bool

func (*Ethereum) Miner

func (s *Ethereum) Miner() *miner.Miner

func (*Ethereum) Protocols

func (s *Ethereum) Protocols() []p2p.Protocol

Protocols returns all the currently configured network protocols to start.

func (*Ethereum) ResetWithGenesisBlock

func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block)

func (*Ethereum) SendNewBlock

func (s *Ethereum) SendNewBlock(pidList []string, block *types.Block, td *big.Int)

func (*Ethereum) SetEtherbase

func (s *Ethereum) SetEtherbase(etherbase common.Address)

SetEtherbase sets the mining reward address.

func (*Ethereum) Start

func (s *Ethereum) Start() error

Start implements node.Lifecycle, starting all internal goroutines needed by the Ethereum protocol implementation.

func (*Ethereum) StartMining

func (s *Ethereum) StartMining(threads int) error

StartMining starts the miner with the given number of CPU threads. If mining is already running, this method adjust the number of threads allowed to use and updates the minimum price required by the transaction pool.

func (*Ethereum) Stop

func (s *Ethereum) Stop() error

Stop implements node.Lifecycle, terminating all internal goroutines used by the Ethereum protocol.

func (*Ethereum) StopMining

func (s *Ethereum) StopMining()

StopMining terminates the miner, both at the consensus engine level as well as at the block creation level.

func (*Ethereum) Synced

func (s *Ethereum) Synced() bool

func (*Ethereum) TxPool

func (s *Ethereum) TxPool() *core.TxPool

type PublicEcConnectorAPI

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

PublicEcConnectorAPI provides an API to access ecconnector in order to interconnect with External consensu Engine this time, it is implemented as Public, later I'll consider to change it as Private

func NewPublicEcConnectorAPI

func NewPublicEcConnectorAPI(e *Ethereum) *PublicEcConnectorAPI

NewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.

func (*PublicEcConnectorAPI) BuildBlock

func (api *PublicEcConnectorAPI) BuildBlock(cBlkNo uint64) (string, error)

func (*PublicEcConnectorAPI) GetLastBlockNum

func (api *PublicEcConnectorAPI) GetLastBlockNum() uint64

func (*PublicEcConnectorAPI) HeartBeat

func (api *PublicEcConnectorAPI) HeartBeat() string

let's implement dummy API

func (*PublicEcConnectorAPI) SealBlock

func (api *PublicEcConnectorAPI) SealBlock(blockno uint64, bhash string, proof *ecpon.BlockProof) error

Directories

Path Synopsis
Package ethconfig contains the configuration of the ETH and LES protocols.
Package ethconfig contains the configuration of the ETH and LES protocols.
Package filters implements an ethereum filtering system for block, transactions and log events.
Package filters implements an ethereum filtering system for block, transactions and log events.
protocols
eth

Jump to

Keyboard shortcuts

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