config

package
v0.0.0-...-22ee8c0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitChains

func InitChains(ctx *Context, homePath string, debug bool) error

Called to initialize the relayer.Chain types on Config

func MarshalJSON

func MarshalJSON(config Config) ([]byte, error)

func UnmarshalJSON

func UnmarshalJSON(m codec.Codec, bz []byte, config *Config) error

Types

type Chains

type Chains []*core.ProvableChain

func (Chains) Get

func (cs Chains) Get(chainID string) (*core.ProvableChain, error)

Get returns the configuration for a given chain

func (Chains) Gets

func (cs Chains) Gets(chainIDs ...string) (map[string]*core.ProvableChain, error)

Gets returns a map chainIDs to their chains

type Config

type Config struct {
	Global GlobalConfig             `yaml:"global" json:"global"`
	Chains []core.ChainProverConfig `yaml:"chains" json:"chains"`
	Paths  core.Paths               `yaml:"paths" json:"paths"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) AddChain

func (c *Config) AddChain(m codec.JSONCodec, config core.ChainProverConfig) error

AddChain adds an additional chain to the config

func (*Config) AddPath

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

AddPath adds an additional path to the config

func (*Config) ChainsFromPath

func (c *Config) ChainsFromPath(path string) (map[string]*core.ProvableChain, 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) GetChain

func (c *Config) GetChain(chainID string) (*core.ProvableChain, error)

func (*Config) GetChains

func (c *Config) GetChains(chainIDs ...string) (map[string]*core.ProvableChain, error)

type Context

type Context struct {
	Codec  codec.ProtoCodecMarshaler
	Config *Config
}

type GlobalConfig

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

GlobalConfig describes any global relayer settings

type ModuleI

type ModuleI interface {
	// Name returns the name of the module
	Name() string

	// RegisterInterfaces register the module interfaces to protobuf Any.
	RegisterInterfaces(registry codectypes.InterfaceRegistry)

	// GetCmd returns the command
	GetCmd(ctx *Context) *cobra.Command
}

ModuleI defines an interface of Module

Jump to

Keyboard shortcuts

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