Documentation ¶
Index ¶
- Constants
- Variables
- func PathID(srcChainID, dstChainID string) string
- type Account
- type Chain
- type ChannelOption
- type Option
- type Relayer
- func (r Relayer) GetPath(_ context.Context, id string) (relayerconf.Path, error)
- func (r Relayer) Link(ctx context.Context, conf relayerconf.Config, pathID string) (relayerconf.Config, error)
- func (r Relayer) LinkPaths(ctx context.Context, pathIDs ...string) error
- func (r Relayer) ListPaths(_ context.Context) ([]relayerconf.Path, error)
- func (r Relayer) NewChain(accountName, rpcAddress string, options ...Option) (*Chain, cosmosaccount.Account, error)
- func (r Relayer) Start(ctx context.Context, conf relayerconf.Config, pathID string, ...) error
- func (r Relayer) StartPaths(ctx context.Context, pathIDs ...string) error
Constants ¶
const ( TransferPort = "transfer" TransferVersion = "ics20-1" OrderingUnordered = "ORDER_UNORDERED" OrderingOrdered = "ORDER_ORDERED" )
Variables ¶
var ErrLinkedPath = errors.New("path already linked")
ErrLinkedPath indicates that an IBC path is already liked.
Functions ¶
Types ¶
type Account ¶
type Account struct { // Address of the account. Address string `json:"address"` }
Account represents an account in relayer.
type Chain ¶
type Chain struct { // ID is id of the chain. ID string // contains filtered or unexported fields }
Chain represents a chain in relayer.
func (*Chain) Config ¶
func (c *Chain) Config() relayerconfig.Chain
func (*Chain) Connect ¶
func (c *Chain) Connect(dst *Chain, options ...ChannelOption) (id string, err error)
Connect connects dst chain to c chain and creates a path in between in offline mode. it returns the path id on success otherwise, returns with a non-nil error.
func (*Chain) EnsureChainSetup ¶
EnsureChainSetup sets up the new or existing chain.
type ChannelOption ¶
type ChannelOption func(*channelOptions)
ChannelOption is used to configure relayer IBC connection.
func SourcePort ¶
func SourcePort(port string) ChannelOption
SourcePort configures the source port of the new channel.
func SourceVersion ¶
func SourceVersion(version string) ChannelOption
SourceVersion configures the source version of the new channel.
func TargetPort ¶
func TargetPort(port string) ChannelOption
TargetPort configures the target port of the new channel.
func TargetVersion ¶
func TargetVersion(version string) ChannelOption
TargetVersion configures the target version of the new channel.
type Option ¶
type Option func(*Chain)
Option is used to configure Chain.
func WithAddressPrefix ¶
WithAddressPrefix configures the account key prefix used on the chain.
func WithClientID ¶
WithClientID configures the chain client id.
func WithFaucet ¶
WithFaucet provides a faucet address for chain to get tokens from. when it isn't provided.
func WithGasLimit ¶
WithGasLimit gives the gas limit to use to send ibc transactions to the chain.
func WithGasPrice ¶
WithGasPrice gives the gas price to use to send ibc transactions to the chain.
type Relayer ¶
type Relayer struct {
// contains filtered or unexported fields
}
Relayer is an IBC relayer.
func New ¶
func New(ca cosmosaccount.Registry) Relayer
New creates a new IBC relayer and uses ca to access accounts.
func (Relayer) Link ¶
func (r Relayer) Link( ctx context.Context, conf relayerconf.Config, pathID string, ) (relayerconf.Config, error)
Link links chain path to each other.
func (Relayer) LinkPaths ¶
LinkPaths links all chains that has a path from config file to each other. paths are optional and acts as a filter to only link some chains. calling Link multiple times for the same paths does not have any side effects.
func (Relayer) NewChain ¶
func (r Relayer) NewChain(accountName, rpcAddress string, options ...Option) ( *Chain, cosmosaccount.Account, error, )
NewChain creates a new chain on relayer or uses the existing matching chain.