config

package
v0.2400.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package config implements global configuration options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(cfgFile string) error

InitConfig initializes the global configuration from the given file.

func ParseSizeInBytes

func ParseSizeInBytes(sizeStr string) uint

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.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the 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

func (m NodeMode) HasLocalStorage() bool

HasLocalStorage returns true iff the mode is one that has local storage.

func (NodeMode) IsClientOnly

func (m NodeMode) IsClientOnly() bool

IsClientOnly returns true iff the mode is one that has the node running as a client for all configured runtimes.

Jump to

Keyboard shortcuts

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