config

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	NodeName string `yaml:"nodeName" envconfig:"NODE_NAME"`
	Network  string `yaml:"network"  envconfig:"NETWORK"`
	Refresh  uint32 `yaml:"refresh"  envconfig:"REFRESH"`
	Retries  uint32 `yaml:"retries"  envconfig:"RETRIES"`
}

type ByronGenesisConfig

type ByronGenesisConfig struct {
	StartTime   uint64 `yaml:"startTime"   envconfig:"BYRON_GENESIS_START_SEC"`
	EpochLength uint64 `yaml:"epochLength" envconfig:"BYRON_EPOCH_LENGTH"`
	K           uint64 `yaml:"k"           envconfig:"BYRON_K"`
	SlotLength  uint64 `yaml:"slotLength"  envconfig:"BYRON_SLOT_LENGTH"`
}

type Config

type Config struct {
	App        AppConfig        `yaml:"app"`
	Node       NodeConfig       `yaml:"node"`
	Prometheus PrometheusConfig `yaml:"prometheus"`
}

func GetConfig

func GetConfig() *Config

GetConfig returns the global config instance

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

type NodeConfig

type NodeConfig struct {
	ByronGenesis      ByronGenesisConfig `yaml:"byron"`
	Binary            string             `yaml:"binary"           envconfig:"CARDANO_NODE_BINARY"`
	Network           string             `yaml:"network"          envconfig:"CARDANO_NETWORK"`
	SocketPath        string             `yaml:"socketPath"       envconfig:"CARDANO_NODE_SOCKET_PATH"`
	NetworkMagic      uint32             `yaml:"networkMagic"     envconfig:"CARDANO_NODE_NETWORK_MAGIC"`
	Port              uint32             `yaml:"port"             envconfig:"CARDANO_PORT"`
	ShelleyTransEpoch int32              `yaml:"shellyTransEpoch" envconfig:"SHELLEY_TRANS_EPOCH"`
	BlockProducer     bool               `yaml:"blockProducer"    envconfig:"CARDANO_BLOCK_PRODUCER"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Host    string `yaml:"host"    envconfig:"PROM_HOST"`
	Port    uint32 `yaml:"port"    envconfig:"PROM_PORT"`
	Refresh uint32 `yaml:"refresh" envconfig:"PROM_REFRESH"`
	Timeout uint32 `yaml:"timeout" envconfig:"PROM_TIMEOUT"`
}

Jump to

Keyboard shortcuts

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