relayer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransferPort      = "transfer"
	TransferVersion   = "ics20-1"
	OrderingUnordered = "ORDER_UNORDERED"
	OrderingOrdered   = "ORDER_ORDERED"
)

Variables

This section is empty.

Functions

This section is empty.

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) Connect

func (c *Chain) Connect(ctx context.Context, 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) TryRetrieve

func (c *Chain) TryRetrieve(ctx context.Context) (sdk.Coins, error)

TryRetrieve tries to receive some coins to the account and returns the total balance.

type ChannelOption

type ChannelOption func(*channelOptions)

ChannelOption is used to configure relayer IBC connection

func Ordered

func Ordered() ChannelOption

Ordered sets the new channel as ordered

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

func WithAddressPrefix(addressPrefix string) Option

WithAddressPrefix configures the account key prefix used on the chain.

func WithFaucet

func WithFaucet(address string) Option

WithFaucet provides a faucet address for chain to get tokens from. when it isn't provided.

func WithGasLimit

func WithGasLimit(limit int64) Option

WithGasLimit gives the gas limit to use to send ibc transactions to the chain.

func WithGasPrice

func WithGasPrice(gasPrice string) Option

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

New creates a new IBC relayer and uses ca to access accounts.

func (Relayer) GetPath

func (r Relayer) GetPath(_ context.Context, id string) (relayerconf.Path, error)

GetPath returns a path by its id.

func (r Relayer) Link(ctx context.Context, pathIDs ...string) error

Link links all chains that has a path 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) ListPaths

func (r Relayer) ListPaths(_ context.Context) ([]relayerconf.Path, error)

ListPaths list all the paths.

func (Relayer) NewChain

func (r Relayer) NewChain(ctx context.Context, accountName, rpcAddress string, options ...Option) (
	*Chain, cosmosaccount.Account, error)

NewChain creates a new chain on relayer or uses the existing matching chain.

func (Relayer) Start

func (r Relayer) Start(ctx context.Context, pathIDs ...string) error

Start relays packets for linked paths until ctx is canceled.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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