config

package
v0.0.69 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config defines the config for the Executor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConfig

type ChainConfig struct {
	// ChainID is the ID of the chain.
	ChainID uint32 `yaml:"chain_id"`
	// OriginAddress is the address of the origin contract.
	OriginAddress string `yaml:"origin_address"`
	// DestinationAddress is the address of the destination contract.
	DestinationAddress string `yaml:"destination_address"`
}

ChainConfig defines the config for a specific chain.

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(ctx context.Context) (ok bool, err error)

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

type Config

type Config struct {
	// Chains stores all chain information
	Chains ChainConfigs `yaml:"chains"`
	// BaseOmnirpcURL is the base url for omnirpc.
	BaseOmnirpcURL string `yaml:"base_omnirpc_url"`
	// UnbondedSigner contains the unbonded signer config for agents
	// (this is signer used to submit transactions)
	UnbondedSigner agentsConfig.SignerConfig `toml:"UnbondedSigner"`
}

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