config

package
v0.0.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeConfigInputWrapperTOML

func DecodeConfigInputWrapperTOML(data []byte, cw *ConfigInputWrapper) error

DecodeConfigInputWrapperTOML decodes a TOML bytes into a ConfigInputWrapper object.

func LoadChainConfig

func LoadChainConfig(cfgPath string) (chains.ChainProviderConfig, error)

LoadChainConfig reads chain config file from given path and return chain config object

func ParseChainProviderConfig

func ParseChainProviderConfig(w ChainProviderConfigWrapper) (chains.ChainProviderConfig, error)

ParseChainProviderConfig converts a TOMLWrapper object to a ChainProviderConfig object.

Types

type ChainProviderConfigWrapper

type ChainProviderConfigWrapper map[string]interface{}

ChainProviderConfigWrapper is an intermediary type for parsing any object from config.toml file

type ChainProviderConfigs

type ChainProviderConfigs map[string]chains.ChainProviderConfig

ChainProviderConfigs is a collection of ChainProviderConfig interfaces (mapped by chainName)

type Config

type Config struct {
	Global       GlobalConfig         `mapstructure:"global"        toml:"global"`
	BandChain    band.Config          `mapstructure:"bandchain"     toml:"bandchain"`
	TargetChains ChainProviderConfigs `mapstructure:"target_chains" toml:"target_chains"`
}

Config defines the configuration for the falcon tunnel relayer.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration.

func ParseConfig

func ParseConfig(data []byte) (*Config, error)

func ParseConfigInputWrapper

func ParseConfigInputWrapper(wrappedCfg *ConfigInputWrapper) (*Config, error)

ParseConfigInputWrapper converts a ConfigInputWrapper object to a Config object.

type ConfigInputWrapper

type ConfigInputWrapper struct {
	Global       GlobalConfig                          `mapstructure:"global"`
	BandChain    band.Config                           `mapstructure:"bandchain"`
	TargetChains map[string]ChainProviderConfigWrapper `mapstructure:"target_chains"`
}

ConfigInputWrapper is an intermediary type for parsing the config.toml file

type GlobalConfig

type GlobalConfig struct {
	LogLevel               string        `mapstructure:"log_level"                toml:"log_level"`
	CheckingPacketInterval time.Duration `mapstructure:"checking_packet_interval" toml:"checking_packet_interval"`
	SyncTunnelsInterval    time.Duration `mapstructure:"sync_tunnels_interval"    toml:"sync_tunnels_interval"`
	PenaltySkipRounds      uint          `mapstructure:"penalty_skip_rounds"      toml:"penalty_skip_rounds"`
	MetricsListenAddr      string        `mapstructure:"metrics_listen_addr"      toml:"metrics_listen_addr"`
}

GlobalConfig is the global configuration for the falcon tunnel relayer

Jump to

Keyboard shortcuts

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