node

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDBProvider added in v0.11.0

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

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

func SetEventSwitch

func SetEventSwitch(evsw types.EventSwitch, eventables ...types.Eventable)

SetEventSwitch adds the event switch to reactors, mempool, etc.

Types

type DBContext added in v0.11.0

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

DBContext specifies config information for loading a new DB.

type DBProvider added in v0.11.0

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

DBProvider takes a DBContext and returns an instantiated DB.

type GenesisDocProvider added in v0.11.0

type GenesisDocProvider func() (*types.GenesisDoc, error)

GenesisDocProvider returns a GenesisDoc. It allows the GenesisDoc to be pulled from sources other than the filesystem, for instance from a distributed key-value store cluster.

func DefaultGenesisDocProviderFunc added in v0.11.0

func DefaultGenesisDocProviderFunc(config *cfg.Config) GenesisDocProvider

DefaultGenesisDocProviderFunc returns a GenesisDocProvider that loads the GenesisDoc from the config.GenesisFile() on the filesystem.

type Node

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

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

func DefaultNewNode added in v0.11.0

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

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

func NewNode

func NewNode(config *cfg.Config,
	privValidator types.PrivValidator,
	clientCreator proxy.ClientCreator,
	genesisDocProvider GenesisDocProvider,
	dbProvider DBProvider,
	logger log.Logger) (*Node, error)

NewNode returns a new, ready to go, Tendermint Node.

func (*Node) AddListener

func (n *Node) AddListener(l p2p.Listener)

AddListener adds a listener to accept inbound peer connections. It should be called before starting the Node. The first listener is the primary listener (in NodeInfo)

func (*Node) BlockStore

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

BlockStore returns the Node's BlockStore.

func (*Node) ConfigureRPC added in v0.9.0

func (n *Node) ConfigureRPC()

ConfigureRPC sets all variables in rpccore so they will serve rpc calls from this node

func (*Node) ConsensusReactor

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

ConsensusReactor returns the Node's ConsensusReactor.

func (*Node) ConsensusState

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

ConsensusState returns the Node's ConsensusState.

func (*Node) DialSeeds

func (n *Node) DialSeeds(seeds []string) error

DialSeeds dials the given seeds on the Switch.

func (*Node) EventSwitch

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

EventSwitch returns the Node's EventSwitch.

func (*Node) GenesisDoc added in v0.7.3

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

GenesisDoc returns the Node's GenesisDoc.

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 added in v0.9.0

func (n *Node) OnStart() error

OnStart starts the Node. It implements cmn.Service.

func (*Node) OnStop added in v0.9.0

func (n *Node) OnStop()

OnStop stops the Node. It implements cmn.Service.

func (*Node) PrivValidator

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

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

func (*Node) ProxyApp added in v0.7.3

func (n *Node) ProxyApp() proxy.AppConns

ProxyApp returns the Node's AppConns, representing its connections to the ABCI application.

func (*Node) RunForever added in v0.9.0

func (n *Node) RunForever()

RunForever waits for an interupt signal and stops the node.

func (*Node) Switch

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

Switch returns the Node's Switch.

type NodeGreeting

type NodeGreeting struct {
	NodeID
	Version string
	ChainID string
	Message string
	Time    time.Time
}

type NodeID

type NodeID struct {
	Name   string
	PubKey crypto.PubKey
}

type NodeProvider added in v0.11.0

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

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

type PrivNodeID

type PrivNodeID struct {
	NodeID
	PrivKey crypto.PrivKey
}

func (*PrivNodeID) SignGreeting

func (pnid *PrivNodeID) SignGreeting() *SignedNodeGreeting

type SignedNodeGreeting

type SignedNodeGreeting struct {
	NodeGreeting
	Signature crypto.Signature
}

Jump to

Keyboard shortcuts

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