node

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

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

Documentation

Overview

Package node contains classes for running a Erigon node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEthConfigUrfave

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

func NewNodConfigUrfave

func NewNodConfigUrfave(ctx *cli.Context, logger log.Logger) *nodecfg.Config

func NewNodeConfig

func NewNodeConfig() *nodecfg.Config

Types

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 New

func New(
	ctx context.Context,
	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) Backend

func (eri *ErigonNode) Backend() *eth.Ethereum

func (*ErigonNode) Close

func (eri *ErigonNode) Close()

func (*ErigonNode) Node

func (eri *ErigonNode) Node() *node.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 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