config

package
v0.0.0-...-bc2601f Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientVersion    = "libp2p/0.0.1"
	MinClientVersion = "0.0.1"
)

Variables

View Source
var (
	ConfigValues      = DefaultConfig()
	TimeConfigValues  = ConfigValues.TimeConfig
	SwarmConfigValues = ConfigValues.SwarmConfig
)

ConfigValues specifies default values for node config params.

Functions

This section is empty.

Types

type Config

type Config struct {
	PrivateKey      string        `mapstructure:"private-key"`
	FastSync        bool          `mapstructure:"fast-sync"`
	TCPPort         int           `mapstructure:"tcp-port"`
	DialTimeout     time.Duration `mapstructure:"dial-timeout"`
	ConnKeepAlive   time.Duration `mapstructure:"conn-keepalive"`
	NetworkID       uint32        `mapstructure:"network-id"`
	ResponseTimeout time.Duration `mapstructure:"response-timeout"`
	SwarmConfig     SwarmConfig   `mapstructure:"swarm"`
	TimeConfig      TimeConfig
}

Config defines the configuration options for the Spacemesh peer-to-peer networking layer

func DefaultConfig

func DefaultConfig() Config

DefaultConfig deines the default p2p configuration

type SwarmConfig

type SwarmConfig struct {
	Gossip                 bool     `mapstructure:"gossip"`
	Bootstrap              bool     `mapstructure:"bootstrap"`
	RoutingTableBucketSize int      `mapstructure:"bucketsize"`
	RoutingTableAlpha      int      `mapstructure:"alpha"`
	RandomConnections      int      `mapstructure:"randcon"`
	BootstrapNodes         []string `mapstructure:"bootnodes"`
}

SwarmConfig specifies swarm config params.

type TimeConfig

type TimeConfig struct {
	MaxAllowedDrift       time.Duration `mapstructure:"max-allowed-time-drift"`
	NtpQueries            int           `mapstructure:"ntp-queries"`
	DefaultTimeoutLatency time.Duration `mapstructure:"default-timeout-latency"`
	RefreshNtpInterval    time.Duration `mapstructure:"ntp-refresh-interval"`
}

TimeConfig specifies the timesync params for ntp.

Jump to

Keyboard shortcuts

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