Documentation ¶
Overview ¶
Package config contains the config for different kinds of agents
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllSignerTypes []SignerType
AllSignerTypes is a list of all contract types. Since we use stringer and this is a testing library, instead of manually copying all these out we pull the names out of stringer. In order to make sure stringer is updated, we panic on any method called where the index is higher than the stringer array length.
var ErrInvalidChainType error
ErrInvalidChainType indicates chain type was invalid.
var ErrInvalidDomainID = errors.New("domain ID invalid")
ErrInvalidDomainID indicates domain id is invalid.
var ErrRequiredField = errors.New("field is required")
ErrRequiredField indicates a required field was left blank.
var ErrUnsupportedSignerType = errors.New("unsupported signer type")
ErrUnsupportedSignerType indicates the signer type being used is unsupported.
Functions ¶
func SignerFromConfig ¶
func SignerFromConfig(config SignerConfig) (signer.Signer, error)
SignerFromConfig creates a new signer from a signer config. TODO: this needs to be moved to some kind of common package. in the old code configs were split into responsible packages. Maybe something like that works here?
Types ¶
type Config ¶
type Config struct { // Domains stores all domains Domains DomainConfigs `toml:"Domains"` // Signer contains the signer config for agents Signer SignerConfig `toml:"Signer"` // DbConfig is the database config Database DBConfig `toml:"Database"` }
Config is used for configuring the application. It stores the configurations defined in each module.
type DBConfig ¶
type DBConfig struct { // Type of the database to use for sql. This does not affect hte pebble db Type string `toml:"Type"` // DBPath is the db path used for the pebble db DBPath string `toml:"DBPath"` // ConnString is the connection string used for mysql ConnString string `toml:"ConnString"` }
DBConfig is used for configuring the.
type DomainConfig ¶
type DomainConfig struct { // DomainID is the domain of the chain DomainID uint32 `toml:"Domain"` // Type of the chain (e.g. evm) Type string `toml:"Type"` // RequiredConfirmations is the number of confirmations to way RequiredConfirmations uint32 `toml:"Confirmations"` // OriginAddress gets origin contract address OriginAddress string `toml:"OriginAddress"` // AttesationCollectorAddress contains the attestation collector address (if present) AttesationCollectorAddress string `toml:"AttesationCollectorAddress"` // RPCUrl to use for the chain RPCUrl string `toml:"RPCURL"` // Minimum start height StartHeight uint32 `toml:"StartHeight"` }
DomainConfig defines the config for a specific domain.
type DomainConfigs ¶
type DomainConfigs map[string]DomainConfig
DomainConfigs contains a map of name->domain config.
type SignerConfig ¶
type SignerConfig struct { // Type is the driver used for the signer Type string // File is the file used for the key. File string }
SignerConfig contains a signer config. Currently this config only supports local based signers due to a lack of isomorphic types when we parse yaml.
type SignerType ¶
type SignerType int
SignerType is the signer type
const ( // FileType is a file-based signer. FileType SignerType = 0 // File // KMSType is a non-file based signer. KMSType SignerType = iota // KMS )
func (SignerType) String ¶
func (i SignerType) String() string