node

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDatadirUsed = errors.New("datadir already used by another process")
	ErrNodeStopped = errors.New("node not started")
	ErrNodeRunning = errors.New("node already running")
)

Functions

func NewHTTPHandlerStack

func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string, jwtSecret []byte) http.Handler

func NewWSHandlerStack

func NewWSHandlerStack(srv http.Handler, jwtSecret []byte) http.Handler

NewWSHandlerStack returns a wrapped ws-related handler.

func OpenDatabase

func OpenDatabase(cfg *conf.Config, logger log2.Logger, name string) (kv.RwDB, error)

func RegisterApisFromWhitelist

func RegisterApisFromWhitelist(apis []jsonrpc.API, modules []string, srv *jsonrpc.Server, exposeAll bool) error

func SplitTagsFlag

func SplitTagsFlag(tagsFlag string) map[string]string

func WriteChainConfig added in v0.1.3

func WriteChainConfig(db kv.RwTx, genesisHash types.Hash, genesis *conf.Genesis) error

func WriteGenesisBlock

func WriteGenesisBlock(db kv.RwTx, genesis *conf.Genesis) (*block.Block, error)

Types

type Node

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

func NewNode

func NewNode(cliCtx *cli.Context, cfg *conf.Config) (*Node, error)

func (*Node) AccountManager

func (n *Node) AccountManager() *accounts.Manager

AccountManager retrieves the account manager used by the protocol stack.

func (*Node) BlockChain

func (n *Node) BlockChain() common.IBlockChain

AccountManager retrieves the account manager used by the protocol stack.

func (*Node) ChainDb

func (n *Node) ChainDb() kv.RwDB

func (*Node) Close

func (n *Node) Close() error

func (*Node) Database

func (n *Node) Database() kv.RwDB

func (*Node) Engine

func (n *Node) Engine() consensus.Engine

func (*Node) Etherbase

func (s *Node) Etherbase() (eb types.Address, err error)

func (*Node) InstanceDir added in v0.1.2

func (n *Node) InstanceDir() string

InstanceDir retrieves the instance directory used by the protocol stack.

func (*Node) KeyStoreDir

func (n *Node) KeyStoreDir() string

KeyStoreDir retrieves the key directory

func (*Node) Miner

func (n *Node) Miner() common.IMiner

func (*Node) SetupMetrics

func (n *Node) SetupMetrics(config conf.MetricsConfig)

func (*Node) Start

func (n *Node) Start() error

func (*Node) Wait added in v0.1.2

func (n *Node) Wait()

Jump to

Keyboard shortcuts

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