node

package
v0.5.1-rc6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package node provides functions to configure, initialize, and execute a Tendermint node. It does not implement an ABCI application - that implementation must be provided by the caller.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInitialized = errors.New("not initialized")

Functions

func Init

func Init(opts InitOptions) (err error)

Init creates the initial configuration for a set of nodes, using the given configuration. Config, remoteIP, and opts.ListenIP must all be of equal length.

Types

type AppFactory

type AppFactory func(*privval.FilePV) (abci.Application, error)

AppFactory creates and returns an ABCI application.

type InitOptions

type InitOptions struct {
	Version    int
	WorkDir    string
	Port       int
	GenesisDoc *types.GenesisDoc
	Config     []*cfg.Config
	RemoteIP   []string
	ListenIP   []string
	Logger     log.Logger
}

type LocalClient

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

LocalClient is a proxy for local.Local that is used when a local client is needed before the node has been started.

func NewLocalClient

func NewLocalClient() *LocalClient

NewLocalClient creates a new LocalClient.

func (*LocalClient) ABCIQueryWithOptions

func (c *LocalClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*core.ResultABCIQuery, error)

ABCIQueryWithOptions implements client.ABCIClient.ABCIQueryWithOptions. Returns ErrNotInitialized if Set has not been called.

func (*LocalClient) BroadcastTxAsync

func (c *LocalClient) BroadcastTxAsync(ctx context.Context, tx tm.Tx) (*core.ResultBroadcastTx, error)

BroadcastTxAsync implements client.ABCIClient.BroadcastTxAsync. If Set has not been called, the transaction is queued and will be sent when Set is called.

func (*LocalClient) BroadcastTxSync

func (c *LocalClient) BroadcastTxSync(ctx context.Context, tx tm.Tx) (*core.ResultBroadcastTx, error)

BroadcastTxSync implements client.ABCIClient.BroadcastTxSync. Returns ErrNotInitialized if Set has not been called.

func (*LocalClient) CheckTx

func (c *LocalClient) CheckTx(ctx context.Context, tx tm.Tx) (*core.ResultCheckTx, error)

CheckTx implements client.MempoolClient.CheckTx. Returns ErrNotInitialized if Set has not been called.

func (*LocalClient) Set

func (c *LocalClient) Set(client *local.Local)

Set sets the local.Local client, transmitting any queued transactions.

func (*LocalClient) Subscribe

func (c *LocalClient) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan core.ResultEvent, err error)

Subscribe implements client.EventsClient.Subscribe. Returns ErrNotInitialized if Set has not been called.

func (*LocalClient) Tx

func (c *LocalClient) Tx(ctx context.Context, hash []byte, prove bool) (*core.ResultTx, error)

BroadcastTxSync implements client.ABCIClient.BroadcastTxSync. Returns ErrNotInitialized if Set has not been called.

type Node

type Node struct {
	service.Service
	Config *config.Config
	ABCI   abci.Application
	// contains filtered or unexported fields
}

Node wraps a Tendermint node.

func New

func New(config *config.Config, app abci.Application, logger log.Logger) (*Node, error)

New initializes a Tendermint node for the given ABCI application.

func (*Node) Start

func (n *Node) Start() error

Start starts the Tendermint node.

Jump to

Keyboard shortcuts

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