config

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusConfig

type ConsensusConfig struct {
	RootDir     string `toml:"home"`
	WALPath     string `toml:"wal_file"`
	WALDisabled bool   `toml:"-"`

	TimeoutPropose        time.Duration `toml:"timeout_propose"`
	TimeoutProposeDelta   time.Duration `toml:"timeout_propose_delta"`
	TimeoutPrevote        time.Duration `toml:"timeout_prevote"`
	TimeoutPrevoteDelta   time.Duration `toml:"timeout_prevote_delta"`
	TimeoutPrecommit      time.Duration `toml:"timeout_precommit"`
	TimeoutPrecommitDelta time.Duration `toml:"timeout_precommit_delta"`
	TimeoutCommit         time.Duration `toml:"timeout_commit"`

	// Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
	SkipTimeoutCommit bool `toml:"skip_timeout_commit" comment:"Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)"`

	// EmptyBlocks mode and possible interval between empty blocks
	CreateEmptyBlocks         bool          `toml:"create_empty_blocks" comment:"EmptyBlocks mode and possible interval between empty blocks"`
	CreateEmptyBlocksInterval time.Duration `toml:"create_empty_blocks_interval"`

	// Reactor sleep duration parameters
	PeerGossipSleepDuration     time.Duration `toml:"peer_gossip_sleep_duration" comment:"Reactor sleep duration parameters"`
	PeerQueryMaj23SleepDuration time.Duration `toml:"peer_query_maj23_sleep_duration"`
	// contains filtered or unexported fields
}

ConsensusConfig defines the configuration for the Tendermint consensus service, including timeouts and details about the WAL and the block structure.

func DefaultConsensusConfig

func DefaultConsensusConfig() *ConsensusConfig

DefaultConsensusConfig returns a default configuration for the consensus service

func TestConsensusConfig

func TestConsensusConfig() *ConsensusConfig

TestConsensusConfig returns a configuration for testing the consensus service

func (*ConsensusConfig) Commit

func (cfg *ConsensusConfig) Commit(t time.Time) time.Time

Commit returns the amount of time to wait for straggler votes after receiving +2/3 precommits for a single block (ie. a commit).

func (*ConsensusConfig) Precommit

func (cfg *ConsensusConfig) Precommit(round int) time.Duration

Precommit returns the amount of time to wait for straggler votes after receiving any +2/3 precommits

func (*ConsensusConfig) Prevote

func (cfg *ConsensusConfig) Prevote(round int) time.Duration

Prevote returns the amount of time to wait for straggler votes after receiving any +2/3 prevotes

func (*ConsensusConfig) Propose

func (cfg *ConsensusConfig) Propose(round int) time.Duration

Propose returns the amount of time to wait for a proposal

func (*ConsensusConfig) SetWalFile

func (cfg *ConsensusConfig) SetWalFile(walFile string)

SetWalFile sets the path to the write-ahead log file

func (*ConsensusConfig) ValidateBasic

func (cfg *ConsensusConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

func (*ConsensusConfig) WaitForTxs

func (cfg *ConsensusConfig) WaitForTxs() bool

WaitForTxs returns true if the consensus should wait for transactions before entering the propose step

func (*ConsensusConfig) WalFile

func (cfg *ConsensusConfig) WalFile() string

WalFile returns the full path to the write-ahead log file

Jump to

Keyboard shortcuts

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