config

package
v0.0.0-...-bcff216 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config contains go-libonomy node configuration definitions

Index

Constants

View Source
const (

	// Genesis indicates the genesis LayerID.
	// Genesis = mesh.Genesis
	// NewBlockProtocol indicates the protocol name for new blocks arriving.
	NewBlockProtocol = "newBlock"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(fileLocation string, vip *viper.Viper) (err error)

LoadConfig load the config file

Types

type BaseConfig

type BaseConfig struct {
	HomeDir string

	DataDir string `mapstructure:"data-folder"`

	ConfigFile string `mapstructure:"config"`

	LogDir string `mapstructure:"log-dir"`

	AccountDir string `mapstructure:"account-dir"`

	TestMode bool `mapstructure:"test-mode"`

	CollectMetrics bool `mapstructure:"metrics"`
	MetricsPort    int  `mapstructure:"metrics-port"`

	OracleServer        string `mapstructure:"oracle_server"`
	OracleServerWorldID int    `mapstructure:"oracle_server_worldid"`

	GenesisTime      string `mapstructure:"genesis-time"`
	LayerDurationSec int    `mapstructure:"layer-duration-sec"`
	LayerAvgSize     int    `mapstructure:"layer-average-size"`
	LayersPerEpoch   int    `mapstructure:"layers-per-epoch"`
	Hdist            int    `mapstructure:"hdist"`

	PoETServer string `mapstructure:"poet-server"`

	MemProfile string `mapstructure:"mem-profile"`

	CPUProfile string `mapstructure:"cpu-profile"`

	PprofHTTPServer bool `mapstructure:"pprof-server"`

	GenesisConfPath string `mapstructure:"genesis-conf"`

	CoinbaseAccount string `mapstructure:"coinbase"`

	GenesisActiveSet int `mapstructure:"genesis-active-size"` // the active set size for genesis

	SyncRequestTimeout int `mapstructure:"sync-request-timeout"` // ms the timeout for direct request in the sync

	SyncInterval int `mapstructure:"sync-interval"` // sync interval in seconds

	SyncValidationDelta int `mapstructure:"sync-validation-delta"` // sync interval in seconds

	PublishEventsURL string `mapstructure:"events-url"`

	StartMining bool `mapstructure:"start-mining"`

	AtxsPerBlock int `mapstructure:"atxs-per-block"`

	BlockCacheSize int `mapstructure:"block-cache-size"`
}

BaseConfig defines the default configuration options for libonomy app

func (*BaseConfig) SetConfigFile

func (cfg *BaseConfig) SetConfigFile(file string)

SetConfigFile overrides the default config file path

type Config

type Config struct {
	BaseConfig `mapstructure:"main"`
	P2P        p2pConfig.Config `mapstructure:"p2p"`
}

Config defines the top level configuration for a libonomy node

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for a libonomy node

type LoggerConfig

type LoggerConfig struct {
	// AppLoggerLevel            string `mapstructure:"app"`
	P2PLoggerLevel string `mapstructure:"p2p"`
}

LoggerConfig holds the logging level for each module.

Jump to

Keyboard shortcuts

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