cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 44 Imported by: 1

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.

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

View Source
const (
	// ORDERED is exported channel type constant
	ORDERED = "ORDERED"
	// UNORDERED is exported channel type constant
	UNORDERED = "UNORDERED"
)
View Source
const (
	MB = 1048576 // in bytes
)

MB is a megabyte

Variables

View Source
var (
	// Version defines the application version (defined at compile time)
	Version = ""
	// Commit defines the application commit hash (defined at compile time)
	Commit = ""
	// SDKCommit defines the CosmosSDK commit hash (defined at compile time)
	SDKCommit = ""
)

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 GetStrategyWithOptions added in v0.6.0

func GetStrategyWithOptions(cmd *cobra.Command, strategy relayer.Strategy) (relayer.Strategy, error)

GetStrategyWithOptions sets strategy specific fields.

func NewRootCmd added in v0.8.0

func NewRootCmd() *cobra.Command

NewRootCmd returns the root command for relayer.

func UpdateClientsFromChains added in v0.8.0

func UpdateClientsFromChains(src, dst *relayer.Chain, thresholdTime time.Duration) (time.Duration, error)

UpdateClientsFromChains takes src, dst chains, threshold time and update clients based on expiry time

Types

type Config

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

Config represents the config file for the relayer

func (*Config) AddChain

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

AddChain adds an additional chain to the config

func (*Config) AddPath added in v0.6.0

func (c *Config) AddPath(name string, path *relayer.Path) (err error)

AddPath adds an additional path to the config

func (*Config) ChainsFromPath added in v0.6.0

func (c *Config) ChainsFromPath(path string) (map[string]*relayer.Chain, string, string, error)

ChainsFromPath takes the path name and returns the properly configured chains

func (*Config) DeleteChain

func (c *Config) DeleteChain(chain string) *Config

DeleteChain removes a chain from the config

func (Config) MustYAML

func (c Config) MustYAML() []byte

MustYAML returns the yaml string representation of the Paths

func (*Config) ValidateChannel added in v0.8.0

func (c *Config) ValidateChannel(chain *relayer.Chain, height int64, pe *relayer.PathEnd) error

ValidateChannel validates channel id in provided pathend

func (*Config) ValidateClient added in v0.8.0

func (c *Config) ValidateClient(chain *relayer.Chain, height int64, pe *relayer.PathEnd) error

ValidateClient validates client id in provided pathend

func (*Config) ValidateConnection added in v0.8.0

func (c *Config) ValidateConnection(chain *relayer.Chain, height int64, pe *relayer.PathEnd) error

ValidateConnection validates connection id in provided pathend

func (*Config) ValidatePath added in v0.8.0

func (c *Config) ValidatePath(p *relayer.Path) (err error)

ValidatePath checks that a path is valid

func (*Config) ValidatePathEnd added in v0.8.0

func (c *Config) ValidatePathEnd(pe *relayer.PathEnd) error

ValidatePathEnd validates provided pathend and returns error for invalid identifiers

type GlobalConfig

type GlobalConfig struct {
	APIListenPort  string `yaml:"api-listen-addr" json:"api-listen-addr"`
	Timeout        string `yaml:"timeout" json:"timeout"`
	LightCacheSize int    `yaml:"light-cache-size" json:"light-cache-size"`
}

GlobalConfig describes any global relayer settings

Jump to

Keyboard shortcuts

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