config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "SYG"

Variables

View Source
var (
	// Flags for running the app
	ConfigFlagName      = "config"
	KeystoreFlagName    = "keystore"
	BlockstoreFlagName  = "blockstore"
	FreshStartFlagName  = "fresh"
	LatestBlockFlagName = "latest"
)

Functions

func BindFlags

func BindFlags(rootCMD *cobra.Command)

Types

type Config

type Config struct {
	RelayerConfig relayer.RelayerConfig
	ChainConfigs  []map[string]interface{}
}

func GetConfigFromENV

func GetConfigFromENV(config *Config) (*Config, error)

GetConfigFromENV reads config from Env variables, validates it and parses it into config suitable for application

Properties of RelayerConfig are expected to be defined as separate Env variables where Env variable name reflects properties position in structure. Each Env variable needs to be prefixed with SYG.

For example, if you want to set Config.RelayerConfig.MpcConfig.Port this would translate to Env variable named SYG_RELAYER_MPCCONFIG_PORT.

func GetConfigFromFile

func GetConfigFromFile(path string, config *Config) (*Config, error)

GetConfigFromFile reads config from file, validates it and parses it into config suitable for application

func GetSharedConfigFromNetwork

func GetSharedConfigFromNetwork(url string) (*Config, error)

GetSharedConfigFromNetwork fetches shared configuration from URL and parses it.

type RawConfig

type RawConfig struct {
	RelayerConfig relayer.RawRelayerConfig `mapstructure:"relayer" json:"relayer"`
	ChainConfigs  []map[string]interface{} `mapstructure:"domains" json:"domains"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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