cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cmd includes relayer commands Copyright © 2020 Jack Zampolin jack.zampolin@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package cmd includes relayer commands Copyright © 2020 Jack Zampolin jack.zampolin@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package cmd includes relayer commands Copyright © 2020 Jack Zampolin <jack.zampolin@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalJSONProviderConfig

func UnmarshalJSONProviderConfig(data []byte, customTypes map[string]reflect.Type) (any, error)

UnmarshalJSONProviderConfig contains the custom unmarshalling logic for ProviderConfig structs

Types

type Config

type Config struct {
	Global GlobalConfig   `yaml:"global" json:"global"`
	Chains relayer.Chains `yaml:"chains" json:"chains"`
}

Config represents the config file for the relayer

func DefaultConfig

func DefaultConfig(memo string) *Config

func (*Config) AddChain

func (c *Config) AddChain(chain *relayer.Chain) (err error)

AddChain adds an additional chain to the config

func (*Config) DeleteChain

func (c *Config) DeleteChain(chain string)

DeleteChain modifies c in-place to remove any chains that have the given name.

func (Config) MustYAML

func (c Config) MustYAML() []byte

MustYAML returns the yaml string representation of the Paths

func (*Config) Wrapped

func (c *Config) Wrapped() *ConfigOutputWrapper

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

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 {
	ApiListenPort     string `yaml:"api-listen-addr,omitempty" json:"api-listen-addr,omitempty"`
	DebugListenPort   string `yaml:"debug-listen-addr" json:"debug-listen-addr"`
	MetricsListenPort string `yaml:"metrics-listen-addr" json:"metrics-listen-addr"`
	Timeout           string `yaml:"timeout" json:"timeout"`
	Memo              string `yaml:"memo" json:"memo"`
	LightCacheSize    int    `yaml:"light-cache-size" json:"light-cache-size"`
	LogLevel          string `yaml:"log-level" json:"log-level"`
	ICS20MemoLimit    int    `yaml:"ics20-memo-limit" json:"ics20-memo-limit"`
	MaxReceiverSize   int    `yaml:"max-receiver-size" json:"max-receiver-size"`
}

GlobalConfig describes any global relayer settings

type ProviderConfigWrapper

type ProviderConfigWrapper struct {
	Type  string                  `yaml:"type"  json:"type"`
	Value provider.ProviderConfig `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

type ProviderConfigYAMLWrapper struct {
	Type  string `yaml:"type"`
	Value any    `yaml:"-"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL