config

package
v0.91.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version the version of the node, set at build time.

Functions

This section is empty.

Types

type ApplicationConfiguration

type ApplicationConfiguration struct {
	Address           string                  `yaml:"Address"`
	AttemptConnPeers  int                     `yaml:"AttemptConnPeers"`
	DBConfiguration   storage.DBConfiguration `yaml:"DBConfiguration"`
	DialTimeout       time.Duration           `yaml:"DialTimeout"`
	LogPath           string                  `yaml:"LogPath"`
	MaxPeers          int                     `yaml:"MaxPeers"`
	MinPeers          int                     `yaml:"MinPeers"`
	NodePort          uint16                  `yaml:"NodePort"`
	PingInterval      time.Duration           `yaml:"PingInterval"`
	PingTimeout       time.Duration           `yaml:"PingTimeout"`
	Pprof             metrics.Config          `yaml:"Pprof"`
	Prometheus        metrics.Config          `yaml:"Prometheus"`
	ProtoTickInterval time.Duration           `yaml:"ProtoTickInterval"`
	Relay             bool                    `yaml:"Relay"`
	RPC               rpc.Config              `yaml:"RPC"`
	UnlockWallet      Wallet                  `yaml:"UnlockWallet"`
}

ApplicationConfiguration config specific to the node.

type Config

type Config struct {
	ProtocolConfiguration    ProtocolConfiguration    `yaml:"ProtocolConfiguration"`
	ApplicationConfiguration ApplicationConfiguration `yaml:"ApplicationConfiguration"`
}

Config top level struct representing the config for the node.

func Load

func Load(path string, netMode netmode.Magic) (Config, error)

Load attempts to load the config from the given path for the given netMode.

func LoadFile added in v0.90.0

func LoadFile(configPath string) (Config, error)

LoadFile loads config from the provided path.

func (Config) GenerateUserAgent

func (c Config) GenerateUserAgent() string

GenerateUserAgent creates user agent string based on build time environment.

type ProtocolConfiguration

type ProtocolConfiguration struct {
	Magic       netmode.Magic `yaml:"Magic"`
	MemPoolSize int           `yaml:"MemPoolSize"`
	// SaveStorageBatch enables storage batch saving before every persist.
	SaveStorageBatch bool     `yaml:"SaveStorageBatch"`
	SecondsPerBlock  int      `yaml:"SecondsPerBlock"`
	SeedList         []string `yaml:"SeedList"`
	StandbyCommittee []string `yaml:"StandbyCommittee"`
	ValidatorsCount  int      `yaml:"ValidatorsCount"`
	// Whether to verify received blocks.
	VerifyBlocks bool `yaml:"VerifyBlocks"`
	// Whether to verify transactions in received blocks.
	VerifyTransactions bool `yaml:"VerifyTransactions"`
}

ProtocolConfiguration represents the protocol config.

type Wallet added in v0.90.0

type Wallet struct {
	Path     string `yaml:"Path"`
	Password string `yaml:"Password"`
}

Wallet is a wallet info.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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