config

package
v0.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// FuzzModeDrop is a mode in which we randomly drop reads/writes, connections or sleep
	FuzzModeDrop = iota
	// FuzzModeDelay is a mode in which we randomly sleep
	FuzzModeDelay
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FuzzConnConfig

type FuzzConnConfig struct {
	Mode         int
	MaxDelay     time.Duration
	ProbDropRW   float64
	ProbDropConn float64
	ProbSleep    float64
}

FuzzConnConfig is a FuzzedConnection configuration.

func DefaultFuzzConnConfig

func DefaultFuzzConnConfig() *FuzzConnConfig

DefaultFuzzConnConfig returns the default config.

type P2PConfig

type P2PConfig struct {
	RootDir string `json:"rpc" toml:"home"`

	// Address to listen for incoming connections
	ListenAddress string `json:"laddr" toml:"laddr" comment:"Address to listen for incoming connections"`

	// Address to advertise to peers for them to dial
	ExternalAddress string `` /* 232-byte string literal not displayed */

	// Comma separated list of seed nodes to connect to
	Seeds string `json:"seeds" toml:"seeds" comment:"Comma separated list of seed nodes to connect to"`

	// Comma separated list of nodes to keep persistent connections to
	PersistentPeers string `json:"persistent_peers" toml:"persistent_peers" comment:"Comma separated list of nodes to keep persistent connections to"`

	// UPNP port forwarding
	UPNP bool `json:"upnp" toml:"upnp" comment:"UPNP port forwarding"`

	// Maximum number of inbound peers
	MaxNumInboundPeers int `json:"max_num_inbound_peers" toml:"max_num_inbound_peers" comment:"Maximum number of inbound peers"`

	// Maximum number of outbound peers to connect to, excluding persistent peers
	MaxNumOutboundPeers int `` /* 144-byte string literal not displayed */

	// Time to wait before flushing messages out on the connection
	FlushThrottleTimeout time.Duration `` /* 129-byte string literal not displayed */

	// Maximum size of a message packet payload, in bytes
	MaxPacketMsgPayloadSize int `` /* 130-byte string literal not displayed */

	// Rate at which packets can be sent, in bytes/second
	SendRate int64 `json:"send_rate" toml:"send_rate" comment:"Rate at which packets can be sent, in bytes/second"`

	// Rate at which packets can be received, in bytes/second
	RecvRate int64 `json:"recv_rate" toml:"recv_rate" comment:"Rate at which packets can be received, in bytes/second"`

	// Set true to enable the peer-exchange reactor
	PexReactor bool `json:"pex" toml:"pex" comment:"Set true to enable the peer-exchange reactor"`

	// Seed mode, in which node constantly crawls the network and looks for
	// peers. If another node asks it for addresses, it responds and disconnects.
	//
	// Does not work if the peer-exchange reactor is disabled.
	SeedMode bool `` /* 249-byte string literal not displayed */

	// Comma separated list of peer IDs to keep private (will not be gossiped to
	// other peers)
	PrivatePeerIDs string `` /* 144-byte string literal not displayed */

	// Toggle to disable guard against peers connecting from the same ip.
	AllowDuplicateIP bool `` /* 128-byte string literal not displayed */

	// Peer connection configuration.
	HandshakeTimeout time.Duration `json:"handshake_timeout" toml:"handshake_timeout" comment:"Peer connection configuration."`
	DialTimeout      time.Duration `json:"dial_timeout" toml:"dial_timeout"`

	// Testing params.
	// Force dial to fail
	TestDialFail bool `json:"test_dial_fail" toml:"test_dial_fail"`
	// FUzz connection
	TestFuzz       bool            `json:"test_fuzz" toml:"test_fuzz"`
	TestFuzzConfig *FuzzConnConfig `json:"test_fuzz_config" toml:"test_fuzz_config"`
}

P2PConfig defines the configuration options for the Tendermint peer-to-peer networking layer

func DefaultP2PConfig

func DefaultP2PConfig() *P2PConfig

DefaultP2PConfig returns a default configuration for the peer-to-peer layer

func TestP2PConfig

func TestP2PConfig() *P2PConfig

TestP2PConfig returns a configuration for testing the peer-to-peer layer

func (*P2PConfig) ValidateBasic

func (cfg *P2PConfig) ValidateBasic() error

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

Jump to

Keyboard shortcuts

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