backend

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 89 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEthConfigUrfave

func NewEthConfigUrfave(ctx *cli.Context, nodeConfig *nodecfg.Config) *ethconfig.Config

func NewNodConfigUrfave

func NewNodConfigUrfave(ctx *cli.Context) *nodecfg.Config

func NewNodeConfig

func NewNodeConfig() *nodecfg.Config

func RemoveContents

func RemoveContents(dir string) error

RemoveContents is like os.RemoveAll, but preserve dir itself

Types

type Config

type Config = ethconfig.Config

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

type ErigonNode

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

ErigonNode represents a single node, that runs sync and p2p network. it also can export the private endpoint for RPC daemon, etc.

func NewNode

func NewNode(
	nodeConfig *nodecfg.Config,
	ethConfig *ethconfig.Config,
	logger log.Logger,
) (*ErigonNode, error)

New creates a new `ErigonNode`. * ctx - `*cli.Context` from the main function. Necessary to be able to configure the node based on the command-line flags * sync - `stagedsync.StagedSync`, an instance of staged sync, setup just as needed. * optionalParams - additional parameters for running a node.

func (*ErigonNode) Serve

func (eri *ErigonNode) Serve() error

Serve runs the node and blocks the execution. It returns when the node is existed.

type Ethereum

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

Ethereum implements the Ethereum full node service.

func NewBackend

func NewBackend(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*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

func (*Ethereum) ChainConfig

func (s *Ethereum) ChainConfig() *chain.Config

func (*Ethereum) ChainDB

func (s *Ethereum) ChainDB() kv.RwDB

func (*Ethereum) ChainKV

func (s *Ethereum) ChainKV() kv.RwDB

func (*Ethereum) Etherbase

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

func (*Ethereum) IsMining

func (s *Ethereum) IsMining() bool

func (*Ethereum) NetPeerCount

func (s *Ethereum) NetPeerCount() (uint64, error)

func (*Ethereum) NetVersion

func (s *Ethereum) NetVersion() (uint64, error)

func (*Ethereum) NodesInfo

func (s *Ethereum) NodesInfo(limit int) (*remote.NodesInfoReply, error)

func (*Ethereum) Notifications

func (s *Ethereum) Notifications() *shards.Notifications

func (*Ethereum) Peers

func (s *Ethereum) Peers(ctx context.Context) (*remote.PeersReply, error)

func (*Ethereum) Protocols

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

Protocols returns all the currently configured network protocols to start.

func (*Ethereum) SentryControlServer

func (s *Ethereum) SentryControlServer() *sentry.MultiClient

func (*Ethereum) SentryCtx

func (s *Ethereum) SentryCtx() context.Context

func (*Ethereum) StagedSync

func (s *Ethereum) StagedSync() *sync_stages.Sync

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(ctx context.Context, db kv.RwDB, mining *sync_stages.Sync, cfg params.MiningConfig, gasPrice *uint256.Int, quitCh chan struct{}, tmpDir string) 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.Service, terminating all internal goroutines used by the Ethereum protocol.

type Params

type Params struct {
	CustomBuckets kv.TableCfg
}

Params contains optional parameters for creating a node. * GitCommit is a commit from which then node was built. * CustomBuckets is a `map[string]dbutils.TableCfgItem`, that contains bucket name and its properties.

NB: You have to declare your custom buckets here to be able to use them in the app.

Jump to

Keyboard shortcuts

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