client

package module
v0.0.0-...-428b8ef Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Name          string  `name:"name" json:"name" yaml:"name"`
	Type          string  `name:"type" json:"type" yaml:"type"`
	NumValidators int     `name:"num-validators" json:"num_validators" yaml:"numValidators"`
	Ports         Port    `name:"ports" json:"ports" yaml:"ports"`
	Upgrade       Upgrade `name:"upgrade" json:"upgrade" yaml:"upgrade"`
}

func (*Chain) GetRESTAddr

func (c *Chain) GetRESTAddr() string

func (*Chain) GetRPCAddr

func (c *Chain) GetRPCAddr() string

type ChainClient

type ChainClient struct {
	Logger *zap.Logger
	Config *Config

	Address     string
	ChainID     string
	ChainConfig *lens.ChainClientConfig
	Client      *lens.ChainClient
}

func NewChainClient

func NewChainClient(logger *zap.Logger, config *Config, chainID string) (*ChainClient, error)

func (*ChainClient) CreateRandWallet

func (c *ChainClient) CreateRandWallet(keyName string) (string, error)

func (*ChainClient) CreateWallet

func (c *ChainClient) CreateWallet(keyName, mnemonic string) (string, error)

func (*ChainClient) CustomSendMsg

func (c *ChainClient) CustomSendMsg(ctx context.Context, keyName string, msg sdk.Msg, memo string) (*sdk.TxResponse, error)

func (*ChainClient) CustomSendMsgs

func (c *ChainClient) CustomSendMsgs(ctx context.Context, keyName string, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)

CustomSendMsgs wraps the msgs in a StdTx, signs and sends it. An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.

func (*ChainClient) GetChainAssets

func (c *ChainClient) GetChainAssets() ([]*pb.ChainAsset, error)

GetChainAssets fetches the assets from chain registry at `/chains/{chain-id}/assets` endpoint

func (*ChainClient) GetChainDenom

func (c *ChainClient) GetChainDenom() (string, error)

func (*ChainClient) GetChainID

func (c *ChainClient) GetChainID() string

func (*ChainClient) GetChainKeys

func (c *ChainClient) GetChainKeys() (*pb.Keys, error)

GetChainKeys fetches keys from the chain registry at `/chains/{chain-id}/keys` endpoint

func (*ChainClient) GetChainRegistry

func (c *ChainClient) GetChainRegistry() (*pb.ChainRegistry, error)

GetChainRegistry fetches the chain registry from the registry at `/chains/{chain-id}` endpoint

func (*ChainClient) GetGenesisMnemonic

func (c *ChainClient) GetGenesisMnemonic() (string, error)

GetGenesisMnemonic fetches the mnemonic from GetChainKeys and returns the first mnemonic in genesis list

func (*ChainClient) GetHeight

func (c *ChainClient) GetHeight() (int64, error)

func (*ChainClient) GetIBCChannel

func (c *ChainClient) GetIBCChannel(chain2 string) (*pb.ChannelData, error)

func (*ChainClient) GetIBCInfo

func (c *ChainClient) GetIBCInfo(chain2 string) (*pb.IBCData, error)

func (*ChainClient) GetRPCAddr

func (c *ChainClient) GetRPCAddr() string

func (*ChainClient) GetStatus

func (c *ChainClient) GetStatus() (*coretypes.ResultStatus, error)

func (*ChainClient) Initialize

func (c *ChainClient) Initialize() error

func (*ChainClient) MustGetChainDenom

func (c *ChainClient) MustGetChainDenom() string

func (*ChainClient) SendMsg

func (c *ChainClient) SendMsg(ctx context.Context, msg sdk.Msg, memo string) (*sdk.TxResponse, error)

func (*ChainClient) SendMsgs

func (c *ChainClient) SendMsgs(ctx context.Context, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)

SendMsgs wraps the msgs in a StdTx, signs and sends it. An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.

type ChainClients

type ChainClients []*ChainClient

func NewChainClients

func NewChainClients(logger *zap.Logger, config *Config) (ChainClients, error)

func (ChainClients) GetChainClient

func (cc ChainClients) GetChainClient(chainID string) (*ChainClient, error)

GetChainClient returns a chain client pointer for the given chain id

type Config

type Config struct {
	Chains   []*Chain   `name:"chains" json:"chains" yaml:"chains"`
	Relayers []*Relayer `name:"relayers" json:"relayers" yaml:"relayers"`
	Explorer *Feature   `name:"explorer" json:"explorer" yaml:"explorer"`
	Registry *Feature   `name:"registry" json:"registry" yaml:"registry"`
}

Config is the struct for the config.yaml setup file todo: move this to a more common place, outside just tests todo: can be moved to proto defination

func (*Config) GetChain

func (c *Config) GetChain(chainId string) *Chain

GetChain returns the Chain object pointer for the given chain id

func (*Config) HasChainId

func (c *Config) HasChainId(chainId string) bool

HasChainId returns true if chain id found in list of chains

type Feature

type Feature struct {
	Enabled bool   `name:"enabled" json:"enabled" yaml:"enabled"`
	Image   string `name:"image" json:"image" yaml:"image"`
	Ports   Port   `name:"ports" json:"ports" yaml:"ports"`
}

func (*Feature) GetRESTAddr

func (f *Feature) GetRESTAddr() string

func (*Feature) GetRPCAddr

func (f *Feature) GetRPCAddr() string

type Port

type Port struct {
	Rest    int `name:"rest" json:"rest" yaml:"rest"`
	Rpc     int `name:"rpc" json:"rpc" yaml:"rpc"`
	Grpc    int `name:"grpc" json:"grpc" yaml:"grpc"`
	Exposer int `name:"exposer" json:"exposer" yaml:"exposer"`
}

type Relayer

type Relayer struct {
	Name     string   `name:"name" json:"name" yaml:"name"`
	Type     string   `name:"type" json:"type" yaml:"type"`
	Replicas int      `name:"replicas" json:"replicas" yaml:"replicas"`
	Chains   []string `name:"chains" json:"chains" yaml:"chains"`
}

type Upgrade

type Upgrade struct {
	Enabled  bool   `name:"eanbled" json:"enabled" yaml:"enabled"`
	Type     string `name:"type" json:"type" yaml:"type"`
	Genesis  string `name:"genesis" json:"genesis" yaml:"genesis"`
	Upgrades []struct {
		Name    string `name:"name" json:"name" yaml:"name"`
		Version string `name:"version" json:"version" yaml:"version"`
	} `name:"upgrades" json:"upgrades" yaml:"upgrades"`
}

Jump to

Keyboard shortcuts

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