Documentation
¶
Overview ¶
Package config implements global configuration options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
InitConfig initializes the global configuration from the given file.
func ParseSizeInBytes ¶
ParseSizeInBytes converts strings like 1GB or 12 mb into an unsigned integer number of bytes. Note: This function was shamelessly lifted from viper: https://github.com/spf13/viper/blob/master/util.go
Types ¶
type Config ¶
type Config struct { // Oasis node mode (validator, non-validator, compute, keymanager, etc.). Mode NodeMode `yaml:"mode"` Common common.Config `yaml:"common"` Genesis genesis.Config `yaml:"genesis"` Consensus tm.Config `yaml:"consensus"` Runtime runtime.Config `yaml:"runtime"` P2P p2p.Config `yaml:"p2p"` IAS ias.Config `yaml:"ias,omitempty"` Pprof pprof.Config `yaml:"pprof,omitempty"` Metrics metrics.Config `yaml:"metrics,omitempty"` Registration workerRegistration.Config `yaml:"registration,omitempty"` Keymanager workerKM.Config `yaml:"keymanager,omitempty"` Storage workerStorage.Config `yaml:"storage,omitempty"` Sentry workerSentry.Config `yaml:"sentry,omitempty"` }
Config is the top-level configuration structure.
var GlobalConfig Config
GlobalConfig holds the global configuration options.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration settings.
type NodeMode ¶
type NodeMode string
NodeMode is the node mode.
const ( // ModeValidator is the name of the validator node mode. ModeValidator NodeMode = "validator" // ModeCompute is the name of the compute node mode. ModeCompute NodeMode = "compute" // ModeKeyManager is the name of the key manager node mode. ModeKeyManager NodeMode = "keymanager" // ModeClient is the name of the client node mode. ModeClient NodeMode = "client" // ModeStatelessClient is the name of the stateless client node mode. ModeStatelessClient NodeMode = "client-stateless" // ModeSeed is the name of the seed node mode. ModeSeed NodeMode = "seed" // ModeArchive is the name of the archive node mode. ModeArchive NodeMode = "archive" )
func (NodeMode) HasLocalStorage ¶
HasLocalStorage returns true iff the mode is one that has local storage.
func (NodeMode) IsClientOnly ¶
IsClientOnly returns true iff the mode is one that has the node running as a client for all configured runtimes.