config

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "SYG"

Variables

View Source
var (
	// Flags for running the app
	StagingFlagName     = "staging"
	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

type RawConfig

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

type TokenConfig added in v0.2.0

type TokenConfig struct {
	Address  common.Address
	Decimals uint8
}

type TokenStore added in v0.2.0

type TokenStore struct {
	Tokens map[uint64]map[string]TokenConfig
}

func (*TokenStore) ConfigByAddress added in v0.2.0

func (s *TokenStore) ConfigByAddress(chainID uint64, address common.Address) (string, TokenConfig, error)

func (*TokenStore) ConfigBySymbol added in v0.2.0

func (s *TokenStore) ConfigBySymbol(chainID uint64, symbol string) (TokenConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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