Documentation ¶
Index ¶
- Variables
- func Execute()
- func NewRootCmd(log *zap.Logger) *cobra.Command
- func UnmarshalJSONProviderConfig(data []byte, customTypes map[string]reflect.Type) (any, error)
- type Config
- type ConfigInputWrapper
- type ConfigOutputWrapper
- type GlobalConfig
- type ProviderConfigWrapper
- type ProviderConfigYAMLWrapper
- type ProviderConfigs
Constants ¶
This section is empty.
Variables ¶
var TempDir = os.TempDir()
var (
Version = "dev"
)
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func NewRootCmd ¶
NewRootCmd returns the root command for relayer. If log is nil, a new zap.Logger is set on the app state based on the command line flags regarding logging.
Types ¶
type Config ¶
type Config struct { Global *GlobalConfig `yaml:"global" json:"global"` Chains relayer.Chains `yaml:"chains" json:"chains"` }
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) DeleteChain ¶
func (*Config) Wrapped ¶
func (c *Config) Wrapped() *ConfigOutputWrapper
Note: chainId and chainName is basically the same Wrapped converts the Config struct into a ConfigOutputWrapper struct
type ConfigInputWrapper ¶
type ConfigInputWrapper struct { Global *GlobalConfig `yaml:"global"` ProviderConfigs map[string]*ProviderConfigYAMLWrapper `yaml:"chains"` }
ConfigInputWrapper is an intermediary type for parsing the config.yaml file
func (*ConfigInputWrapper) RuntimeConfig ¶
func (c *ConfigInputWrapper) RuntimeConfig(ctx context.Context, a *appState) (*Config, error)
RuntimeConfig converts the input disk config into the relayer runtime config.
type ConfigOutputWrapper ¶
type ConfigOutputWrapper struct { Global *GlobalConfig `yaml:"global" json:"global"` ProviderConfigs ProviderConfigs `yaml:"chains" json:"chains"` }
ConfigOutputWrapper is an intermediary type for writing the config to disk and stdout
type GlobalConfig ¶
type GlobalConfig struct { Timeout string `yaml:"timeout" json:"timeout"` KMSKeyID string `yaml:"kms-key-id" json:"kms-key-id"` }
GlobalConfig describes any global relayer settings
type ProviderConfigWrapper ¶
type ProviderConfigWrapper struct { Type string `yaml:"type" json:"type"` Value provider.Config `yaml:"value" json:"value"` }
ProviderConfigWrapper is an intermediary type for parsing arbitrary ProviderConfigs from json files and writing to json/yaml files
func (*ProviderConfigWrapper) UnmarshalJSON ¶
func (pcw *ProviderConfigWrapper) UnmarshalJSON(data []byte) error
UnmarshalJSON adds support for unmarshalling data from an arbitrary ProviderConfig NOTE: Add new ProviderConfig types in the map here with the key set equal to the type of ChainProvider (e.g. cosmos, substrate, etc.)
type ProviderConfigYAMLWrapper ¶
ProviderConfigYAMLWrapper is an intermediary type for parsing arbitrary ProviderConfigs from yaml files
func (*ProviderConfigYAMLWrapper) UnmarshalYAML ¶
func (iw *ProviderConfigYAMLWrapper) UnmarshalYAML(n *yaml.Node) error
UnmarshalYAML adds support for unmarshalling data from arbitrary ProviderConfig entries found in the config file NOTE: Add logic for new ProviderConfig types in a switch case here
type ProviderConfigs ¶
type ProviderConfigs map[string]*ProviderConfigWrapper