cometbft

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataDir          = "data"
	GenesisJSONName  = "genesis.json"
	ConfigTOMLName   = "config.toml"
	AddrBookFileName = "addrbook.json"
)

CometBFT file and folder names. These will be under the chain root directory. e.g. With "abci" a the chain root directory set in cometbft's config, this give the paths "abci/config/genesis.json" and "abci/data".

Variables

This section is empty.

Functions

func AddrBookPath

func AddrBookPath(chainRootDir string) string

func ExtractConsensusParams added in v0.8.1

func ExtractConsensusParams(cp *chain.BaseConsensusParams) *cmtTypes.ConsensusParams

ExtractConsensusParams creates cometbft's ConsensusParams from kwild's, which includes a subset of cometbft's and other parameters that pertain to the ABCI application (kwild) rather than the consensus engine (cometbft).

func NodeIDAddressString

func NodeIDAddressString(pubkey ed25519.PubKey, hostPort string) string

NodeIDAddressString makes a full CometBFT node ID address string in the format <nodeID>@hostPort where nodeID is derived from the provided public key.

func ParamUpdatesToComet added in v0.8.1

func ParamUpdatesToComet(up *consensus.ParamUpdates) *cmtproto.ConsensusParams

ParamUpdatesToComet converts the parameter updates to cometBFT's

func ResetState

func ResetState(chainRootDir string) error

ResetState removes address book files plus all blockchain databases. It always returns nil error, only printing errors. (?)

Types

type CometBftNode

type CometBftNode struct {
	Node *cometNodes.Node
}

func NewCometBftNode

func NewCometBftNode(ctx context.Context, app abciTypes.Application, conf *cometConfig.Config,
	genDoc *types.GenesisDoc, privateKey cometEd25519.PrivKey, atomicStore privval.AtomicReadWriter,
	logger *log.Logger) (*CometBftNode, error)

NewCometBftNode creates a new CometBFT node.

func (*CometBftNode) IsCatchup

func (n *CometBftNode) IsCatchup() bool

IsCatchup returns true if the node is operating in catchup / blocksync mode. If the node is caught up with the network, it returns false.

func (*CometBftNode) Start

func (n *CometBftNode) Start() error

Start starts the CometBFT node.

func (*CometBftNode) Stop

func (n *CometBftNode) Stop() error

Stop stops the CometBFT node.

type LogWrapper

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

LogWrapper that implements cometbft's Logger interface.

func NewLogWrapper

func NewLogWrapper(log *log.Logger) *LogWrapper

NewLogWrapper creates a new LogWrapper using the provided Kwil Logger.

func (*LogWrapper) Debug

func (lw *LogWrapper) Debug(msg string, kvs ...any)

func (*LogWrapper) Error

func (lw *LogWrapper) Error(msg string, kvs ...any)

func (*LogWrapper) Info

func (lw *LogWrapper) Info(msg string, kvs ...any)

func (*LogWrapper) With

func (lw *LogWrapper) With(kvs ...any) cometLog.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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