config

package
v0.2403.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package config implements global configuration options.

Index

Constants

View Source
const (
	// PruneStrategyNone is the identifier of the strategy that disables pruning.
	PruneStrategyNone = "none"
	// PruneStrategyKeepN is the identifier of the strategy that keeps the last N versions.
	PruneStrategyKeepN = "keep_n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointerConfig

type CheckpointerConfig struct {
	// Disable the ABCI state checkpointer.
	Disabled bool `yaml:"disabled"`
	// ABCI state checkpointer check interval.
	CheckInterval time.Duration `yaml:"check_interval"`
}

CheckpointerConfig is the CometBFT ABCI state pruning configuration structure.

type Config

type Config struct {
	// Node is a consensus validator.
	// This additional option exists because it is currently possible to
	// run a node that is simultaneously a validator and a compute node.
	Validator bool `yaml:"validator"`

	// CometBFT listen address.
	ListenAddress string `yaml:"listen_address"`
	// CometBFT address advertised to other nodes.
	ExternalAddress string `yaml:"external_address,omitempty"`

	// CometBFT P2P configuration.
	P2P P2PConfig `yaml:"p2p,omitempty"`

	// CometBFT nodes for which we act as sentry of the form pubkey@IP:port.
	SentryUpstreamAddresses []string `yaml:"sentry_upstream_addresses,omitempty"`

	// Minimum gas price for this validator.
	MinGasPrice uint64 `yaml:"min_gas_price,omitempty"`

	// Transaction submission configuration.
	Submission SubmissionConfig `yaml:"submission,omitempty"`

	// Epoch at which to force-shutdown the node (in epochs, zero disables shutdown).
	HaltEpoch uint64 `yaml:"halt_epoch,omitempty"`

	// Height at which to force-shutdown the node (in blocks, zero disables shutdown).
	HaltHeight uint64 `yaml:"halt_height,omitempty"`

	// Average amount of time to delay shutting down the node on upgrade.
	UpgradeStopDelay time.Duration `yaml:"upgrade_stop_delay,omitempty"`

	// ABCI state pruning configuration.
	Prune PruneConfig `yaml:"prune,omitempty"`

	// ABCI state checkpointer configuration.
	Checkpointer CheckpointerConfig `yaml:"checkpointer,omitempty"`

	// Consensus state sync configuration.
	StateSync StateSyncConfig `yaml:"state_sync,omitempty"`

	// Supplementary sanity checks configuration.
	SupplementarySanity SupplementarySanityConfig `yaml:"supplementary_sanity,omitempty"`

	// Enable CometBFT debug logs (very verbose).
	LogDebug bool `yaml:"log_debug,omitempty"`

	// Debug configuration options (do not use).
	Debug DebugConfig `yaml:"debug,omitempty"`
}

Config is the CometBFT configuration structure.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration settings.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration settings.

type DebugConfig

type DebugConfig struct {
	// Allow non-routable addresses in P2P address book.
	P2PAddrBookLenient bool `yaml:"addr_book_lenient,omitempty"`
	// Allow multiple P2P connections from the same IP.
	P2PAllowDuplicateIP bool `yaml:"allow_duplicate_ip,omitempty"`

	// Enable automatic recovery from corrupted WAL during replay (UNSAFE).
	UnsafeReplayRecoverCorruptedWAL bool `yaml:"unsafe_replay_recover_corrupted_wal,omitempty"`

	// Disable populating seed node address book with genesis validators.
	DisableAddrBookFromGenesis bool `yaml:"disable_addr_book_from_genesis,omitempty"`
}

DebugConfig is the debug configuration structure.

type P2PConfig

type P2PConfig struct {
	// Max number of inbound peers.
	MaxNumInboundPeers int `yaml:"max_num_inbound_peers"`
	// Max number of outbound peers (excluding persistent peers).
	MaxNumOutboundPeers int `yaml:"max_num_outbound_peers"`
	// Rate at which P2P packets can be sent (bytes/s).
	SendRate int64 `yaml:"send_rate"`
	// Rate at which P2P packets can be received (bytes/s).
	RecvRate int64 `yaml:"recv_rate"`

	// CometBFT persistent peer(s) of the form pubkey@IP:port.
	PersistentPeer []string `yaml:"persistent_peers"`
	// CometBFT unconditional peer(s) public keys.
	UnconditionalPeer []string `yaml:"unconditional_peers"`
	// Disable CometBFT's peer-exchange reactor.
	DisablePeerExchange bool `yaml:"disable_peer_exchange"`
	// CometBFT max timeout when redialing a persistent peer (default: unlimited).
	PersistenPeersMaxDialPeriod time.Duration `yaml:"persistent_peers_max_dial_period"`
}

P2PConfig is the CometBFT P2P configuration structure.

type PruneConfig

type PruneConfig struct {
	// ABCI state pruning strategy.
	Strategy string `yaml:"strategy"`
	// ABCI state versions kept (when applicable).
	NumKept uint64 `yaml:"num_kept"`
	// ABCI state pruning interval.
	Interval time.Duration `yaml:"interval"`
	// Light blocks kept in trusted store.
	NumLightBlocksKept uint16 `yaml:"num_light_blocks_kept"`
}

PruneConfig is the CometBFT ABCI state pruning configuration structure.

type StateSyncConfig

type StateSyncConfig struct {
	// Enable consensus state sync.
	Enabled bool `yaml:"enabled"`
	// Light client trust period.
	TrustPeriod time.Duration `yaml:"trust_period"`
	// Light client trusted height.
	TrustHeight uint64 `yaml:"trust_height"`
	// Light client trusted consensus header hash.
	TrustHash string `yaml:"trust_hash"`
}

StateSyncConfig is the consensus state sync configuration structure.

type SubmissionConfig

type SubmissionConfig struct {
	// Gas price used when submitting consensus transactions.
	GasPrice uint64 `yaml:"gas_price"`
	// Max transaction fee when submitting consensus transactions.
	MaxFee uint64 `yaml:"max_fee"`
}

SubmissionConfig is the transaction submission configuration.

type SupplementarySanityConfig

type SupplementarySanityConfig struct {
	// Enable supplementary sanity checks (slows down consensus).
	Enabled bool `yaml:"enabled"`
	// Supplementary sanity check interval (in blocks).
	Interval uint64 `yaml:"interval"`
}

SupplementarySanityConfig is the supplementary sanity configuration structure.

Jump to

Keyboard shortcuts

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