config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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"`
	// SynapseCCTPAddress is the address of the SynapseCCTP contract.
	SynapseCCTPAddress string `yaml:"synapse_cctp_address"`
	// TokenMessengerAddress is the address of the TokenMessenger contract.
	TokenMessengerAddress string `yaml:"token_messenger_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) GetTokenMessengerAddress added in v0.2.0

func (c ChainConfig) GetTokenMessengerAddress() common.Address

GetTokenMessengerAddress returns the TokenMessenger 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/". Notice the lack of "confirmations" on the URL
	// in comparison to what `Scribe` uses.
	BaseOmnirpcURL string `yaml:"base_omnirpc_url"`
	// ScribePort is the port for the scribe server.
	ScribePort uint `yaml:"scribe_port"`
	// ScribeURL is the URL for the scribe server.
	ScribeURL string `yaml:"scribe_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"`
}

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