node

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDBProvider

func DefaultDBProvider(ctx *DBContext) (dbm.DB, error)

DefaultDBProvider returns a database using the DBBackend and DBDir specified in the ctx.Config.

func DefaultMetricsProvider

func DefaultMetricsProvider() (*cs.Metrics, *mempl.Metrics)

DefaultMetricsProvider returns consensus, p2p and mempool Metrics build using Prometheus client library.

func MakeNodeInfo

func MakeNodeInfo(chainID string, nodeType types.NodeType, moniker string, httpEndpoint string) p2p.NodeInfo

func NopMetricsProvider

func NopMetricsProvider() (*cs.Metrics, *mempl.Metrics)

NopMetricsProvider returns consensus, p2p and mempool Metrics as no-op.

Types

type DBContext

type DBContext struct {
	ID     string
	Config *cfg.Config
}

DBContext specifies config information for loading a new DB.

type DBProvider

type DBProvider func(*DBContext) (dbm.DB, error)

DBProvider takes a DBContext and returns an instantiated DB.

type MetricsProvider

type MetricsProvider func() (*cs.Metrics, *mempl.Metrics)

MetricsProvider returns a consensus, p2p and mempool Metrics.

type Node

type Node struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

Node is the highest level interface to a full node. It includes all configuration information and running services.

func DefaultNewNode

func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error)

DefaultNewNode returns a node with default settings for the PrivValidator, and DBProvider. It implements NodeProvider.

func NewNode

func NewNode(config *cfg.Config,
	privValidator types.PrivValidator,
	dbProvider DBProvider,
	metricsProvider MetricsProvider,
	logger log.Logger) (*Node, error)

NewNode returns a new, ready to go.

func (*Node) BlockStore

func (n *Node) BlockStore() *bc.BlockStore

BlockStore returns the Node's BlockStore.

func (*Node) BlockchainReactor

func (n *Node) BlockchainReactor() *bc.BlockchainReactor

func (*Node) ClearHistoricalData

func (n *Node) ClearHistoricalData()

func (*Node) ConsensusReactor

func (n *Node) ConsensusReactor() *cs.ConsensusReactor

ConsensusReactor returns the Node's ConsensusReactor.

func (*Node) ConsensusState

func (n *Node) ConsensusState() *cs.ConsensusState

ConsensusState returns the Node's ConsensusState.

func (*Node) EventBus

func (n *Node) EventBus() *types.EventBus

EventBus returns the Node's EventBus.

func (*Node) EvidencePool

func (n *Node) EvidencePool() *evidence.EvidencePool

EvidencePool returns the Node's EvidencePool.

func (*Node) MempoolReactor

func (n *Node) MempoolReactor() *mempl.MempoolReactor

MempoolReactor returns the Node's MempoolReactor.

func (*Node) NodeInfo

func (n *Node) NodeInfo() p2p.NodeInfo

NodeInfo returns the Node's Info from the Switch.

func (*Node) OnStart

func (n *Node) OnStart() error

OnStart starts the Node. It implements cmn.Service.

func (*Node) OnStop

func (n *Node) OnStop()

OnStop stops the Node. It implements cmn.Service.

func (*Node) P2PManager

func (n *Node) P2PManager() *p2p.Switch

Switch returns the Node's Switch.

func (*Node) PrivValidator

func (n *Node) PrivValidator() types.PrivValidator

PrivValidator returns the Node's PrivValidator. XXX: for convenience only!

func (*Node) RunForever

func (n *Node) RunForever()

RunForever waits for an interrupt signal and stops the node.

type NodeProvider

type NodeProvider func(*cfg.Config, log.Logger) (*Node, error)

NodeProvider takes a config and a logger and returns a ready to go Node.

Jump to

Keyboard shortcuts

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