node

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{}

DefaultConfig returns a default configuration for a node

Functions

func RegisterAPI

func RegisterAPI(node *Node)

Types

type API

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

func (*API) Status

func (api *API) Status() NodeStatus

type Config

type Config struct {
}

Config defines the top level configuration for a node

type Node

type Node struct {
	service.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 NewNode

func NewNode(logger log.Logger, options ...Option) (*Node, error)

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

func (*Node) Chain

func (n *Node) Chain() *core.BlockChain

func (*Node) OnStart

func (n *Node) OnStart() error

OnStart starts the Node. It implements service.Service.

func (*Node) OnStop

func (n *Node) OnStop()

OnStop stops the Node. It implements service.Service.

type NodeStatus added in v0.2.0

type NodeStatus struct {
	IsRuning  bool `json:"is_runing"`
	NetworkId byte `json:"network_id"`
}

type Option

type Option func(*Node)

Option sets a parameter for the node.

Jump to

Keyboard shortcuts

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