config

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

Package config defines the config for the CCTPRelayer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConfig

type ChainConfig struct {
	ChainID uint32 `yaml:"chain_id"`
	// SynapseCCTPAddress is the address of the SynapseCCTP contract.
	SynapseCCTPAddress string `yaml:"synapse_cctp_address"`
}

ChainConfig defines the config for a specific chain.

func (ChainConfig) GetSynapseCCTPAddress

func (c ChainConfig) GetSynapseCCTPAddress() common.Address

GetSynapseCCTPAddress returns the SynapseCCTP address.

func (ChainConfig) IsValid

func (c ChainConfig) IsValid(ctx context.Context) (ok bool, err error)

IsValid validates the chain config.

type ChainConfigs

type ChainConfigs []ChainConfig

ChainConfigs contains an array of ChainConfigs.

func (ChainConfigs) IsValid

func (c ChainConfigs) IsValid(_ context.Context) (ok bool, err error)

IsValid validates the chain config by asserting no two chains appear twice.

type Config

type Config struct {
	// Port is the RelayerAPIServer port
	Port uint16 `yaml:"port"`
	// Host is the RelayerAPIServer host
	Host string `yaml:"host"`
	// CircleAPIURl is the URL for the Circle API
	CircleAPIURl string `yaml:"circle_api_url"`
	// Chains stores all chain information
	Chains ChainConfigs `yaml:"chains"`
	// BaseOmnirpcURL is the base url for omnirpc.
	// The format is "https://omnirpc.url/". Notice the lack of "confirmations" on the URL
	// in comparison to what `Scribe` uses.
	BaseOmnirpcURL string `yaml:"base_omnirpc_url"`
	// Signer contains the unbonded signer config for agents
	// (this is signer used to submit transactions)
	Signer ethConfig.SignerConfig `yaml:"unbonded_signer"`
	// RetryInterval is the interval for attestation request retries
	RetryIntervalMS int `yaml:"retry_interval_ms"`
	// HTTPBackoffMaxElapsedTime is the max elapsed time for attestation request retries
	HTTPBackoffMaxElapsedTimeMs int                    `yaml:"http_backoff_max_elapsed_time_ms"`
	SubmitterConfig             submitterConfig.Config `yaml:"submitter_config"`
}

Config is used to configure an Executor agent.

func DecodeConfig

func DecodeConfig(filePath string) (cfg Config, err error)

DecodeConfig parses in a config from a file.

func (Config) Encode

func (c Config) Encode() ([]byte, error)

Encode gets the encoded config.yaml file.

func (*Config) IsValid

func (c *Config) IsValid(ctx context.Context) (ok bool, err error)

IsValid makes sure the config is valid. This is done by calling IsValid() on each submodule. If any method returns an error that is returned here and the entirety of IsValid returns false. Any warnings are logged by the submodules respective loggers.

Jump to

Keyboard shortcuts

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