config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 13 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"`
	// CCTPAddress is the address of the CCTP contract.
	// This will correspond to SynapseCCTP or TokenMessenger depending on the CCTPType.
	CCTPAddress string `yaml:"cctp_address"`
	// CCTP start block is the block at which the chain listener will listen for CCTP events.
	CCTPStartBlock uint64 `yaml:"cctp_start_block"`
}

ChainConfig defines the config for a specific chain.

func (ChainConfig) GetCCTPAddress added in v0.11.0

func (c ChainConfig) GetCCTPAddress() common.Address

GetCCTPAddress returns the CCTP 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"`
	// CCTPType is the method for executing CCTP transactions.
	CCTPType string `yaml:"cctp_type"`
	// Chains stores all chain information
	Chains ChainConfigs `yaml:"chains"`
	// BaseOmnirpcURL is the base url for omnirpc.
	// The format is "https://omnirpc.url/".
	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 is the config for the transaction submitter
	SubmitterConfig submitterConfig.Config `yaml:"submitter_config"`
	// ScreenerAPIUrl is the TRM API url.
	ScreenerAPIUrl string `yaml:"screener_api_url"`
}

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) GetCCTPType added in v0.2.0

func (c Config) GetCCTPType() (types.MessageType, error)

GetCCTPType returns the CCTP method.

func (Config) GetChainConfig added in v0.2.0

func (c Config) GetChainConfig(chainID uint32) (cfg ChainConfig, err error)

GetChainConfig returns the chain config for a given chain id.

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