p2p

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CfgPeers defines the static peers this node should retain a connection to (CLI).
	CfgPeers = "peers"
)

Variables

View Source
var (
	Component *app.Component
)
View Source
var ParamsP2P = &ParametersP2P{}
View Source
var ParamsPeers = &ParametersPeers{}

Functions

This section is empty.

Types

type ParametersP2P

type ParametersP2P struct {
	// Defines the bind addresses of this node.
	BindMultiAddresses []string `default:"/ip4/0.0.0.0/tcp/15600,/ip6/::/tcp/15600" usage:"the bind addresses for this node"`

	ConnectionManager struct {
		// Defines the high watermark to use within the connection manager.
		HighWatermark int `default:"10" usage:"the threshold up on which connections count truncates to the lower watermark"`
		// Defines the low watermark to use within the connection manager.
		LowWatermark int `default:"5" usage:"the minimum connections count to hold after the high watermark was reached"`
	}

	// Defines the private key used to derive the node identity (optional).
	IdentityPrivateKey string `default:"" usage:"private key used to derive the node identity (optional)"`

	Database struct {
		// Defines the path to the p2p database.
		Path string `default:"mainnet/p2pstore" usage:"the path to the p2p database"`
	} `name:"db"`

	// Defines the time to wait before trying to reconnect to a disconnected peer.
	ReconnectInterval time.Duration `default:"30s" usage:"the time to wait before trying to reconnect to a disconnected peer"`
}

ParametersP2P contains the definition of the parameters used by p2p.

type ParametersPeers

type ParametersPeers struct {
	// Defines the static peers this node should retain a connection to (CLI).
	Peers []string `default:"" usage:"the static peers this node should retain a connection to (CLI)"`
	// Defines the aliases of the static peers (must be the same length like CfgP2PPeers) (CLI).
	PeerAliases []string `default:"" usage:"the aliases of the static peers (must be the same amount like \"p2p.peers\""`
}

ParametersPeers contains the definition of the parameters used by peers.

Jump to

Keyboard shortcuts

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