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:"ConfirmationsThreshold"` // OriginAddress gets origin contract address OriginAddress string `toml:"OriginAddress"` // AttestationCollectorAddress contains the attestation collector address (if present) AttestationCollectorAddress string `toml:"AttestationCollectorAddress"` // DestinationAddress gets destination contract address DestinationAddress string `toml:"DestinationAddress"` // 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 NotaryConfig ¶ added in v0.0.58
type NotaryConfig struct { // OriginDomains stores all origin domains OriginDomains DomainConfigs `toml:"OriginDomains"` // AttestationDomain stores the attestaion domain AttestationDomain DomainConfig `toml:"AttestationDomain"` // DestinationDomain stores the destination domain DestinationDomain DomainConfig `toml:"DestinationDomain"` // UnbondedSigner contains the unbonded signer config for agents // (this is signer used to submit transactions) UnbondedSigner SignerConfig `toml:"UnbondedSigner"` // BondedSigner contains the bonded signer config for agents BondedSigner SignerConfig `toml:"BondedSigner"` // DbConfig is the database config Database DBConfig `toml:"Database"` // RefreshIntervalInSeconds is how long to wait before refreshing the Notary state RefreshIntervalInSeconds int64 `toml:"RefreshIntervalInSeconds"` }
NotaryConfig is used for configuring the notary.
func (*NotaryConfig) IsValid ¶ added in v0.0.58
func (c *NotaryConfig) 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.
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