hermes

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContainerVersion = "1.4.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressType

type AddressType struct {
	Derivation string `toml:"derivation"`
}

type Chain

type Chain struct {
	ID             string         `toml:"id"`
	RPCAddr        string         `toml:"rpc_addr"`
	GrpcAddr       string         `toml:"grpc_addr"`
	WebsocketAddr  string         `toml:"websocket_addr"`
	RPCTimeout     string         `toml:"rpc_timeout"`
	AccountPrefix  string         `toml:"account_prefix"`
	KeyName        string         `toml:"key_name"`
	AddressType    AddressType    `toml:"address_type"`
	StorePrefix    string         `toml:"store_prefix"`
	DefaultGas     int            `toml:"default_gas"`
	MaxGas         int            `toml:"max_gas"`
	GasPrice       GasPrice       `toml:"gas_price"`
	GasMultiplier  float64        `toml:"gas_multiplier"`
	MaxMsgNum      int            `toml:"max_msg_num"`
	MaxTxSize      int            `toml:"max_tx_size"`
	ClockDrift     string         `toml:"clock_drift"`
	MaxBlockTime   string         `toml:"max_block_time"`
	TrustingPeriod string         `toml:"trusting_period"`
	TrustThreshold TrustThreshold `toml:"trust_threshold"`
	MemoPrefix     string         `toml:"memo_prefix,omitempty"`
}

type ChainConfig

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

ChainConfig holds all values required to write an entry in the "chains" section in the hermes config file.

type ChannelAndPortId

type ChannelAndPortId struct {
	ChannelID string `json:"channel_id"`
	PortID    string `json:"port_id"`
}

type ChannelEnd

type ChannelEnd struct {
	ConnectionHops []string         `json:"connection_hops"`
	Ordering       string           `json:"ordering"`
	State          string           `json:"state"`
	Version        string           `json:"version"`
	Remote         ChannelAndPortId `json:"remote"`
}

type ChannelOutputResult

type ChannelOutputResult struct {
	Result []ChannelResult `json:"result"`
}

ChannelOutputResult contains the minimum required channel values.

type ChannelResult

type ChannelResult struct {
	ChannelEnd             ChannelEnd `json:"channel_end"`
	CounterPartyChannelEnd ChannelEnd `json:"counterparty_channel_end"`
}

type Channels

type Channels struct {
	Enabled bool `toml:"enabled"`
}

type ClientCreationResponse

type ClientCreationResponse struct {
	Result CreateClientResult `json:"result"`
}

ClientCreationResponse contains the minimum required values to extract the client id from the hermes response.

type ClientQueryResult

type ClientQueryResult struct {
	ClientResult []ClientResult `json:"result"`
}

type ClientResult

type ClientResult struct {
	ChainID  string `json:"chain_id"`
	ClientID string `json:"client_id"`
}

type Clients

type Clients struct {
	Enabled      bool `toml:"enabled"`
	Refresh      bool `toml:"refresh"`
	Misbehaviour bool `toml:"misbehaviour"`
}

type Config

type Config struct {
	Global    Global    `toml:"global"`
	Mode      Mode      `toml:"mode"`
	Rest      Rest      `toml:"rest"`
	Telemetry Telemetry `toml:"telemetry"`
	Chains    []Chain   `toml:"chains"`
}

func NewConfig

func NewConfig(chainConfigs ...ChainConfig) Config

NewConfig returns a hermes Config with an entry for each of the provided ChainConfigs. The defaults were adapted from the sample config file found here: https://github.com/informalsystems/hermes/blob/master/config.toml

type ConnectionEnd

type ConnectionEnd struct {
	ClientID     string       `json:"client_id"`
	Counterparty Counterparty `json:"counterparty"`
	DelayPeriod  DelayPeriod  `json:"delay_period"`
	State        string       `json:"state"`
	Versions     []Versions   `json:"versions"`
}

type ConnectionQueryResult

type ConnectionQueryResult struct {
	Result []Result `json:"result"`
	Status string   `json:"status"`
}

type ConnectionResponse

type ConnectionResponse struct {
	Result ConnectionResult `json:"result"`
}

ConnectionResponse contains the minimum required values to extract the connection id from both sides.

type ConnectionResult

type ConnectionResult struct {
	ASide ConnectionSide `json:"a_side"`
	BSide ConnectionSide `json:"b_side"`
}

type ConnectionSide

type ConnectionSide struct {
	ConnectionID string `json:"connection_id"`
}

type Connections

type Connections struct {
	Enabled bool `toml:"enabled"`
}

type Counterparty

type Counterparty struct {
	ClientID     string `json:"client_id"`
	ConnectionID string `json:"connection_id"`
	Prefix       string `json:"prefix"`
}

type CreateClient

type CreateClient struct {
	ClientID   string `json:"client_id"`
	ClientType string `json:"client_type"`
}

type CreateClientResult

type CreateClientResult struct {
	CreateClient CreateClient `json:"CreateClient"`
}

type DelayPeriod

type DelayPeriod struct {
	Nanos int `json:"nanos"`
	Secs  int `json:"secs"`
}

type GasPrice

type GasPrice struct {
	Price float64 `toml:"price"`
	Denom string  `toml:"denom"`
}

type Global

type Global struct {
	LogLevel string `toml:"log_level"`
}

type Mode

type Mode struct {
	Clients     Clients     `toml:"clients"`
	Connections Connections `toml:"connections"`
	Channels    Channels    `toml:"channels"`
	Packets     Packets     `toml:"packets"`
}

type Packets

type Packets struct {
	Enabled        bool `toml:"enabled"`
	ClearInterval  int  `toml:"clear_interval"`
	ClearOnStart   bool `toml:"clear_on_start"`
	TxConfirmation bool `toml:"tx_confirmation"`
}

type Relayer

type Relayer struct {
	*relayer.DockerRelayer
	// contains filtered or unexported fields
}

Relayer is the ibc.Relayer implementation for hermes.

func NewHermesRelayer

func NewHermesRelayer(log *zap.Logger, testName string, cli *client.Client, networkID string, options ...relayer.RelayerOption) *Relayer

NewHermesRelayer returns a new hermes relayer.

func (*Relayer) AddChainConfiguration

func (r *Relayer) AddChainConfiguration(ctx context.Context, rep ibc.RelayerExecReporter, chainConfig ibc.ChainConfig, keyName, rpcAddr, grpcAddr string) error

AddChainConfiguration is called once per chain configuration, which means that in the case of hermes, the single config file is overwritten with a new entry each time this function is called.

func (*Relayer) CreateChannel

func (r *Relayer) CreateChannel(ctx context.Context, rep ibc.RelayerExecReporter, pathName string, opts ibc.CreateChannelOptions) error

func (*Relayer) CreateClients

func (r *Relayer) CreateClients(ctx context.Context, rep ibc.RelayerExecReporter, pathName string, opts ibc.CreateClientOptions) error

CreateClients creates clients on both chains. Note: in the go relayer this can be done with a single command using the path reference, however in Hermes this needs to be done as two separate commands.

func (*Relayer) CreateConnections

func (r *Relayer) CreateConnections(ctx context.Context, rep ibc.RelayerExecReporter, pathName string) error

func (*Relayer) Flush

func (r *Relayer) Flush(ctx context.Context, rep ibc.RelayerExecReporter, pathName string, channelID string) error

func (*Relayer) GeneratePath

func (r *Relayer) GeneratePath(ctx context.Context, rep ibc.RelayerExecReporter, srcChainID, dstChainID, pathName string) error

GeneratePath establishes an in memory path representation. The concept does not exist in hermes, so it is handled at the interchain test level.

func (*Relayer) LinkPath

func (r *Relayer) LinkPath(ctx context.Context, rep ibc.RelayerExecReporter, pathName string, channelOpts ibc.CreateChannelOptions, clientOpts ibc.CreateClientOptions) error

LinkPath performs the operations that happen when a path is linked. This includes creating clients, creating connections and establishing a channel. This happens across multiple operations rather than a single link path cli command.

func (*Relayer) RestoreKey

func (r *Relayer) RestoreKey(ctx context.Context, rep ibc.RelayerExecReporter, cfg ibc.ChainConfig, keyName, mnemonic string) error

RestoreKey restores a key from a mnemonic. In hermes, you must provide a file containing the mnemonic. We need to copy the contents of the mnemonic into a file on disk and then reference the newly created file.

func (*Relayer) UpdateClients

func (r *Relayer) UpdateClients(ctx context.Context, rep ibc.RelayerExecReporter, pathName string) error

type Rest

type Rest struct {
	Enabled bool   `toml:"enabled"`
	Host    string `toml:"host"`
	Port    int    `toml:"port"`
}

type Result

type Result struct {
	ConnectionEnd ConnectionEnd `json:"connection_end"`
	ConnectionID  string        `json:"connection_id"`
}

type Telemetry

type Telemetry struct {
	Enabled bool   `toml:"enabled"`
	Host    string `toml:"host"`
	Port    int    `toml:"port"`
}

type TrustThreshold

type TrustThreshold struct {
	Numerator   string `toml:"numerator"`
	Denominator string `toml:"denominator"`
}

type Versions

type Versions struct {
	Features   []string `json:"features"`
	Identifier string   `json:"identifier"`
}

type Wallet

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

func NewWallet

func NewWallet(keyname string, address string, mnemonic string) *Wallet

func (*Wallet) Address

func (w *Wallet) Address() []byte

Get Address

func (*Wallet) FormattedAddress

func (w *Wallet) FormattedAddress() string

func (*Wallet) KeyName

func (w *Wallet) KeyName() string

func (*Wallet) Mnemonic

func (w *Wallet) Mnemonic() string

Get mnemonic, only used for relayer wallets

type WalletModel

type WalletModel struct {
	Mnemonic string `json:"mnemonic"`
	Address  string `json:"address"`
}

Jump to

Keyboard shortcuts

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