guardconfig

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package guardconfig contains the config yaml object for the relayer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConfig

type ChainConfig struct {
	// Bridge is the rfq bridge contract address.
	RFQAddress string `yaml:"rfq_address"`
	// Confirmations is the number of required confirmations.
	Confirmations uint64 `yaml:"confirmations"`
}

ChainConfig represents the configuration for a chain.

type Config

type Config struct {
	// Chains is a map of chainID -> chain config.
	Chains map[int]ChainConfig `yaml:"chains"`
	// OmniRPCURL is the URL of the OmniRPC server.
	OmniRPCURL string `yaml:"omnirpc_url"`
	// Database is the database config.
	Database DatabaseConfig `yaml:"database"`
	// Signer is the signer config.
	Signer config.SignerConfig `yaml:"signer"`
	// SubmitterConfig is the submitter config.
	SubmitterConfig submitterConfig.Config `yaml:"submitter_config"`
	// DBSelectorInterval is the interval for the db selector.
	DBSelectorInterval time.Duration `yaml:"db_selector_interval"`
}

Config represents the configuration for the relayer.

func LoadConfig

func LoadConfig(path string) (config Config, err error)

LoadConfig loads the config from the given path.

func NewGuardConfigFromRelayer

func NewGuardConfigFromRelayer(relayerCfg relconfig.Config) Config

NewGuardConfigFromRelayer creates a new guard config from a relayer config.

func (Config) GetChains

func (c Config) GetChains() map[int]ChainConfig

GetChains returns the chains config.

func (Config) GetDBSelectorInterval

func (c Config) GetDBSelectorInterval() time.Duration

GetDBSelectorInterval returns the interval for the DB selector.

func (Config) GetRFQAddress

func (c Config) GetRFQAddress(chainID int) (string, error)

GetRFQAddress returns the RFQ address for the given chain.

func (Config) Validate

func (c Config) Validate() (err error)

Validate validates the config.

type DatabaseConfig

type DatabaseConfig struct {
	Type string `yaml:"type"`
	DSN  string `yaml:"dsn"` // Data Source Name
}

DatabaseConfig represents the configuration for the database.

Jump to

Keyboard shortcuts

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