node

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: GPL-3.0 Imports: 74 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 WriteGenesisBlock

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

Types

type Node

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

func NewNode

func NewNode(ctx context.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()

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) KeyStoreDir

func (n *Node) KeyStoreDir() string

KeyStoreDir retrieves the key directory

func (*Node) Miner

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

func (*Node) Network

func (n *Node) Network() common.INetwork

func (*Node) ProtocolHandshake

func (n *Node) ProtocolHandshake(peer common.IPeer, genesisHash types.Hash, currentHeight *uint256.Int) (common.Peer, bool)

func (*Node) ProtocolHandshakeInfo

func (n *Node) ProtocolHandshakeInfo() (types.Hash, *uint256.Int, error)

func (*Node) SetupMetrics

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

func (*Node) Start

func (n *Node) Start() error

Jump to

Keyboard shortcuts

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