config

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 36

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"`

	ConfigPath string `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

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) CreateConfig added in v0.4.23

func (c *Config) CreateConfig() error

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)

func (*Config) InitConfig added in v0.4.23

func (c *Config) InitConfig(ctx *Context, homePath, configPath string, debug bool) error

func (*Config) InitCoreConfig added in v0.4.23

func (c *Config) InitCoreConfig()

func (*Config) OverWriteConfig added in v0.4.23

func (c *Config) OverWriteConfig() error

type Context

type Context struct {
	Modules []ModuleI
	Codec   codec.ProtoCodecMarshaler
	Config  *Config
}

type CoreConfig added in v0.4.23

type CoreConfig struct {
	// contains filtered or unexported fields
}

func (CoreConfig) UpdateConfigID added in v0.4.23

func (c CoreConfig) UpdateConfigID(pathName string, chainID string, configID core.ConfigIDType, id string) error

type GlobalConfig

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

GlobalConfig describes any global relayer settings

type LoggerConfig added in v0.4.7

type LoggerConfig struct {
	Level  string `yaml:"level" json:"level"`
	Format string `yaml:"format" json:"format"`
	Output string `yaml:"output" json:"output"`
}

type ModuleI added in v0.1.1

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