Documentation ¶
Index ¶
- Variables
- func AutoUpdateClient(src, dst *Chain, thresholdTime time.Duration) (time.Duration, error)
- func BuildSimTx(txf tx.Factory, msgs ...sdk.Msg) ([]byte, error)
- func CalculateGas(queryFunc func(string, []byte) ([]byte, int64, error), txf tx.Factory, ...) (txtypes.SimulateResponse, uint64, error)
- func CastClientStateToTMType(cs *codectypes.Any) (*tmclient.ClientState, error)
- func ControllerUpcall(action interface{}) (bool, error)
- func CreateMnemonic() (string, error)
- func DecodeMsgs(c *Chain, msgs []string) []sdk.Msg
- func DefaultPageRequest() *querytypes.PageRequest
- func EncodeMsgs(c *Chain, msgs []sdk.Msg) []string
- func ExecuteChannelStep(src, dst *Chain) (success, last, modified bool, err error)
- func ExecuteConnectionStep(src, dst *Chain) (success, last, modified bool, err error)
- func FindMatchingChannel(source, counterparty *Chain) (string, bool)
- func FindMatchingClient(source, counterparty *Chain, clientState *ibctmtypes.ClientState) (string, bool)
- func FindMatchingConnection(source, counterparty *Chain) (string, bool)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func InitializeChannel(src, dst *Chain) (success, modified bool, err error)
- func InitializeConnection(src, dst *Chain) (success, modified bool, err error)
- func IsConnectionFound(connectionHops []string, connectionID string) bool
- func IsMatchingChannel(source, counterparty *Chain, channel *chantypes.IdentifiedChannel) bool
- func IsMatchingClient(clientStateA, clientStateB ibctmtypes.ClientState) bool
- func IsMatchingConnection(source, counterparty *Chain, connection *conntypes.IdentifiedConnection) bool
- func IsMatchingConsensusState(consensusStateA, consensusStateB *ibctmtypes.ConsensusState) bool
- func MustGetHeight(h ibcexported.Height) clienttypes.Height
- func OrderFromString(order string) chantypes.Order
- func ParseChannelIDFromEvents(events sdk.StringEvents) (string, error)
- func ParseClientIDFromEvents(events sdk.StringEvents) (string, error)
- func ParseConnectionIDFromEvents(events sdk.StringEvents) (string, error)
- func ParseEvents(e string) ([]string, error)
- func PathsSet(chains ...*Chain) bool
- func QueryChannelPair(src, dst *Chain, srcH, dstH int64) (srcChan, dstChan *chantypes.QueryChannelResponse, err error)
- func QueryConnectionPair(src, dst *Chain, srcH, dstH int64) (srcConn, dstConn *conntypes.QueryConnectionResponse, err error)
- func QueryLatestHeights(src, dst *Chain) (srch, dsth int64, err error)
- func RandLowerCaseLetterString(length int) string
- func RunStrategy(src, dst *Chain, strategy Strategy) (func(), error)
- func ValidateChannelParams(src, dst *Chain) error
- func ValidateClientPaths(src, dst *Chain) error
- func ValidateConnectionPaths(src, dst *Chain) error
- func ValidatePaths(src, dst *Chain) error
- type Chain
- func (c *Chain) AddPath(clientID, connectionID, channelID, port, order string) error
- func (c *Chain) CLIContext(height int64) sdkCtx.Context
- func (c *Chain) ChanAck(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ChanCloseConfirm(dstChanState *chantypes.QueryChannelResponse) sdk.Msg
- func (c *Chain) ChanCloseInit() sdk.Msg
- func (c *Chain) ChanConfirm(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ChanInit(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ChanTry(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) CloseChannel(dst *Chain, to time.Duration) error
- func (c *Chain) CloseChannelStep(dst *Chain) (*RelayMsgs, error)
- func (c *Chain) ConnAck(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ConnConfirm(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ConnInit(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) ConnTry(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
- func (c *Chain) CreateClient(clientState *tmclient.ClientState, dstHeader *tmclient.Header) (sdk.Msg, error)
- func (c *Chain) CreateClients(dst *Chain, ...) (modified bool, err error)
- func (c *Chain) CreateOpenChannels(dst *Chain, maxRetries uint64, to time.Duration) (modified bool, err error)
- func (c *Chain) CreateOpenConnections(dst *Chain, maxRetries uint64, to time.Duration) (modified bool, err error)
- func (c *Chain) CreateTestKey() error
- func (c *Chain) ErrCantSetPath(err error) error
- func (c *Chain) ErrPathNotSet() error
- func (c *Chain) Error(err error)
- func (c *Chain) FaucetHandler(fromKey sdk.AccAddress, amounts sdk.Coins) func(w http.ResponseWriter, r *http.Request)
- func (c *Chain) GenerateConnHandshakeProof(height uint64) (clientState ibcexported.ClientState, clientStateProof []byte, ...)
- func (c *Chain) GetAddress() (sdk.AccAddress, error)
- func (c *Chain) GetIBCUpdateHeader(dst *Chain, srch int64) (*tmclient.Header, error)
- func (c *Chain) GetLightSignedHeaderAtHeight(h int64) (*tmclient.Header, error)
- func (c *Chain) GetRPCPort() string
- func (c *Chain) GetSelfVersion() uint64
- func (c *Chain) GetTimeout() time.Duration
- func (c *Chain) GetTrustingPeriod() time.Duration
- func (c *Chain) Init(homePath string, timeout time.Duration, logger log.Logger, debug bool) error
- func (c *Chain) InjectTrustedFields(dst *Chain, header *tmclient.Header) (*tmclient.Header, error)
- func (c *Chain) KeyExists(name string) bool
- func (c *Chain) ListenRPCEmitJSON(tx, block, data bool) func()
- func (c *Chain) Log(s string)
- func (c *Chain) LogFailedTx(res *sdk.TxResponse, err error, msgs []sdk.Msg)
- func (c *Chain) LogSuccessTx(res *sdk.TxResponse, msgs []sdk.Msg)
- func (c *Chain) MakeEncodingConfig() params.EncodingConfig
- func (c *Chain) MsgRelayAcknowledgement(counterparty *Chain, counterpartyHeight int64, packet *relayMsgPacketAck) (sdk.Msg, error)
- func (c *Chain) MsgRelayRecvPacket(counterparty *Chain, counterpartyHeight int64, packet *relayMsgRecvPacket) (sdk.Msg, error)
- func (c *Chain) MsgRelayTimeout(counterparty *Chain, counterpartyHeight int64, packet *relayMsgTimeout) (sdk.Msg, error)
- func (c *Chain) MsgTransfer(dst *PathEnd, amount sdk.Coin, dstAddr string, ...) sdk.Msg
- func (c *Chain) MustGetAddress() string
- func (c *Chain) NewProtoCodec(interfaceRegistry types.InterfaceRegistry, accountPrefix string) *ProtoCodec
- func (c *Chain) PathSet() bool
- func (c *Chain) Print(toPrint proto.Message, text, indent bool) error
- func (c *Chain) QueryABCI(req abci.RequestQuery) (res abci.ResponseQuery, err error)
- func (c *Chain) QueryBalance(keyName string) (sdk.Coins, error)
- func (c *Chain) QueryBalanceWithAddress(address string) (sdk.Coins, error)
- func (c *Chain) QueryChannel(height int64) (chanRes *chantypes.QueryChannelResponse, err error)
- func (c *Chain) QueryChannelClient(height int64) (*chantypes.QueryChannelClientStateResponse, error)
- func (c *Chain) QueryChannels(pagereq *querytypes.PageRequest) (*chantypes.QueryChannelsResponse, error)
- func (c *Chain) QueryClientConsensusState(height int64, dstClientConsHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)
- func (c *Chain) QueryClientState(height int64) (ibcexported.ClientState, error)
- func (c *Chain) QueryClientStateResponse(height int64) (*clienttypes.QueryClientStateResponse, error)
- func (c *Chain) QueryClients(pagereq *querytypes.PageRequest) (*clienttypes.QueryClientStatesResponse, error)
- func (c *Chain) QueryConnection(height int64) (*conntypes.QueryConnectionResponse, error)
- func (c *Chain) QueryConnectionChannels(connectionID string, pagereq *querytypes.PageRequest) (*chantypes.QueryConnectionChannelsResponse, error)
- func (c *Chain) QueryConnections(pagereq *querytypes.PageRequest) (conns *conntypes.QueryConnectionsResponse, err error)
- func (c *Chain) QueryConnectionsUsingClient(height int64) (clientConns *conntypes.QueryClientConnectionsResponse, err error)
- func (c *Chain) QueryConsensusState(height int64) (*tmclient.ConsensusState, int64, error)
- func (c *Chain) QueryDenomTrace(denom string) (*transfertypes.QueryDenomTraceResponse, error)
- func (c *Chain) QueryDenomTraces(pagereq *querytypes.PageRequest, height int64) (*transfertypes.QueryDenomTracesResponse, error)
- func (c *Chain) QueryHeaderAtHeight(height int64) (*tmclient.Header, error)
- func (c *Chain) QueryHistoricalInfo(height clienttypes.Height) (*stakingtypes.QueryHistoricalInfoResponse, error)
- func (c *Chain) QueryLatestHeight() (int64, error)
- func (c *Chain) QueryNextSeqRecv(height int64) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error)
- func (c *Chain) QueryPacketAcknowledgement(height int64, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error)
- func (c *Chain) QueryPacketAcknowledgements(pagereq *querytypes.PageRequest, height uint64) (comRes *chantypes.QueryPacketAcknowledgementsResponse, err error)
- func (c *Chain) QueryPacketCommitment(height int64, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error)
- func (c *Chain) QueryPacketCommitments(pagereq *querytypes.PageRequest, height uint64) (comRes *chantypes.QueryPacketCommitmentsResponse, err error)
- func (c *Chain) QueryPacketReceipt(height int64, seq uint64) (recRes *chantypes.QueryPacketReceiptResponse, err error)
- func (c *Chain) QueryTMClientState(height int64) (*tmclient.ClientState, error)
- func (c *Chain) QueryTx(hashHex string) (*ctypes.ResultTx, error)
- func (c *Chain) QueryTxs(height uint64, page, limit int, events []string) ([]*ctypes.ResultTx, error)
- func (c *Chain) QueryUnbondingPeriod() (time.Duration, error)
- func (c *Chain) QueryUnreceivedAcknowledgements(height uint64, seqs []uint64) ([]uint64, error)
- func (c *Chain) QueryUnreceivedPackets(height uint64, seqs []uint64) ([]uint64, error)
- func (c *Chain) QueryUpgradeProof(key []byte, height uint64) ([]byte, clienttypes.Height, error)
- func (c *Chain) QueryUpgradedClient(height int64) (*codectypes.Any, []byte, clienttypes.Height, error)
- func (c *Chain) QueryUpgradedConsState(height int64) (*codectypes.Any, []byte, clienttypes.Height, error)
- func (c *Chain) QueryValsetAtHeight(height clienttypes.Height) (*tmproto.ValidatorSet, error)
- func (c *Chain) QueryWithData(p string, d []byte) (byt []byte, i int64, err error)
- func (c *Chain) SendAndPrint(txs []sdk.Msg, text, indent bool) (err error)
- func (c *Chain) SendMsg(datagram sdk.Msg) (*sdk.TxResponse, bool, error)
- func (c *Chain) SendMsgWithKey(msg sdk.Msg, keyName string) (res *sdk.TxResponse, err error)
- func (c *Chain) SendMsgs(msgs []sdk.Msg) (*sdk.TxResponse, bool, error)
- func (c *Chain) SendTransferMsg(dst *Chain, amount sdk.Coin, dstAddr string, toHeightOffset uint64, ...) error
- func (c *Chain) SetPath(p *PathEnd) error
- func (c *Chain) Start() error
- func (c *Chain) StatusErr() error
- func (c *Chain) String() string
- func (c *Chain) Subscribe(query string) (<-chan ctypes.ResultEvent, context.CancelFunc, error)
- func (c *Chain) TxFactory(height int64) tx.Factory
- func (c *Chain) Update(key, value string) (out *Chain, err error)
- func (c *Chain) UpdateClient(dst *Chain, dsth *tmclient.Header) (sdk.Msg, error)
- func (c *Chain) UpdateClients(dst *Chain) (err error)
- func (c *Chain) UpgradeChain(dst *Chain, plan *upgradetypes.Plan, deposit sdk.Coin, ...) error
- func (c *Chain) UpgradeClients(dst *Chain, height int64) error
- func (c *Chain) UseSDKContext() func()
- func (c *Chain) WaitForNBlocks(n int64) error
- type Chains
- type DeliverMsgsAction
- type FaucetRequest
- type NaiveStrategy
- func (nrs *NaiveStrategy) GetType() string
- func (nrs *NaiveStrategy) HandleEvents(src, dst *Chain, srch, dsth int64, events map[string][]string)
- func (nrs *NaiveStrategy) RelayAcknowledgements(src, dst *Chain, sp *RelaySequences) error
- func (nrs *NaiveStrategy) RelayPackets(src, dst *Chain, sp *RelaySequences) error
- func (nrs *NaiveStrategy) UnrelayedAcknowledgements(src, dst *Chain) (*RelaySequences, error)
- func (nrs *NaiveStrategy) UnrelayedSequences(src, dst *Chain) (*RelaySequences, error)
- type Path
- type PathAction
- type PathEnd
- func (pe *PathEnd) GetOrder() chantypes.Order
- func (pe *PathEnd) NewPacket(dst *PathEnd, sequence uint64, packetData []byte, ...) chantypes.Packet
- func (pe PathEnd) String() string
- func (pe *PathEnd) ValidateBasic() error
- func (pe *PathEnd) ValidateFull() error
- func (pe *PathEnd) Vchan() error
- func (pe *PathEnd) Vclient() error
- func (pe *PathEnd) Vconn() error
- func (pe *PathEnd) Vport() error
- func (pe *PathEnd) Vversion() error
- func (pe *PathEnd) XferPacket(amount sdk.Coin, sender, receiver string) []byte
- type PathStatus
- type PathWithStatus
- type Paths
- type ProtoCodec
- func (pc *ProtoCodec) InterfaceRegistry() types.InterfaceRegistry
- func (pc *ProtoCodec) Marshal(o codec.ProtoMarshaler) ([]byte, error)
- func (pc *ProtoCodec) MarshalInterface(i proto.Message) ([]byte, error)
- func (pc *ProtoCodec) MarshalInterfaceJSON(x proto.Message) ([]byte, error)
- func (pc *ProtoCodec) MarshalJSON(o proto.Message) ([]byte, error)
- func (pc *ProtoCodec) MarshalLengthPrefixed(o codec.ProtoMarshaler) ([]byte, error)
- func (pc *ProtoCodec) MustMarshal(o codec.ProtoMarshaler) []byte
- func (pc *ProtoCodec) MustMarshalJSON(o proto.Message) []byte
- func (pc *ProtoCodec) MustMarshalLengthPrefixed(o codec.ProtoMarshaler) []byte
- func (pc *ProtoCodec) MustUnmarshal(bz []byte, ptr codec.ProtoMarshaler)
- func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr proto.Message)
- func (pc *ProtoCodec) MustUnmarshalLengthPrefixed(bz []byte, ptr codec.ProtoMarshaler)
- func (pc *ProtoCodec) Unmarshal(bz []byte, ptr codec.ProtoMarshaler) error
- func (pc *ProtoCodec) UnmarshalInterface(bz []byte, ptr interface{}) error
- func (pc *ProtoCodec) UnmarshalInterfaceJSON(bz []byte, iface interface{}) error
- func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr proto.Message) error
- func (pc *ProtoCodec) UnmarshalLengthPrefixed(bz []byte, ptr codec.ProtoMarshaler) error
- func (pc *ProtoCodec) UnpackAny(any *types.Any, iface interface{}) error
- type RelayMsgs
- type RelaySequences
- type Strategy
- type StrategyCfg
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultUpgradePath is the default IBC upgrade path set for an on-chain light client DefaultUpgradePath = []string{"upgrade", "upgradedIBCState"} )
var SendToController func(needReply bool, str string) (string, error)
SendToController is ...
Functions ¶
func AutoUpdateClient ¶ added in v0.8.0
AutoUpdateClient update client automatically to prevent expiry
func BuildSimTx ¶ added in v1.0.0
BuildSimTx creates an unsigned tx with an empty single signature and returns the encoded transaction or an error if the unsigned transaction cannot be built.
func CalculateGas ¶ added in v1.0.0
func CalculateGas( queryFunc func(string, []byte) ([]byte, int64, error), txf tx.Factory, msgs ...sdk.Msg, ) (txtypes.SimulateResponse, uint64, error)
CalculateGas simulates the execution of a transaction and returns the simulation response obtained by the query and the adjusted gas amount.
func CastClientStateToTMType ¶ added in v1.0.0
func CastClientStateToTMType(cs *codectypes.Any) (*tmclient.ClientState, error)
CastClientStateToTMType casts client state to tendermint type
func ControllerUpcall ¶ added in v0.6.0
ControllerUpcall takes action interface type
func CreateMnemonic ¶ added in v0.6.0
CreateMnemonic creates a new mnemonic
func DefaultPageRequest ¶ added in v1.0.0
func DefaultPageRequest() *querytypes.PageRequest
func ExecuteChannelStep ¶ added in v0.7.0
ExecuteChannelStep executes the next channel step based on the states of two channel ends specified by the relayer configuration file. The booleans return indicate if the message was successfully executed and if this was the last handshake step.
func ExecuteConnectionStep ¶ added in v0.7.0
ExecuteConnectionStep executes the next connection step based on the states of two connection ends specified by the relayer configuration file. The booleans return indicate if the message was successfully executed and if this was the last handshake step.
func FindMatchingChannel ¶ added in v0.7.0
FindMatchingChannel will determine if there already exists a channel between source and counterparty that matches the parameters set in the relayer config.
func FindMatchingClient ¶ added in v0.7.0
func FindMatchingClient(source, counterparty *Chain, clientState *ibctmtypes.ClientState) (string, bool)
FindMatchingClient will determine if there exists a client with identical client and consensus states to the client which would have been created. Source is the chain that would be adding a client which would track the counterparty. Therefore we query source for the existing clients and check if any match the counterparty. The counterparty must have a matching consensus state to the latest consensus state of a potential match. The provided client state is the client state that will be created if there exist no matches.
func FindMatchingConnection ¶ added in v0.7.0
FindMatchingConnection will determine if there already exists a connection between source and counterparty that matches the parameters set in the relayer config.
func GenerateRandomBytes ¶ added in v0.6.0
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶ added in v0.6.0
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func InitializeChannel ¶ added in v0.7.0
InitializeChannel creates a new channel on either the source or destination chain . The identifiers set in the PathEnd's are used to determine which channel ends need to be initialized. The PathEnds are updated upon a successful transaction. NOTE: This function may need to be called twice if neither channel exists.
func InitializeConnection ¶ added in v0.7.0
InitializeConnection creates a new connection on either the source or destination chain . The identifiers set in the PathEnd's are used to determine which connection ends need to be initialized. The PathEnds are updated upon a successful transaction. NOTE: This function may need to be called twice if neither connection exists.
func IsConnectionFound ¶ added in v0.7.0
IsConnectionFound determines if given connectionId is present in channel connectionHops list
func IsMatchingChannel ¶ added in v0.7.0
func IsMatchingChannel(source, counterparty *Chain, channel *chantypes.IdentifiedChannel) bool
IsMatchingChannel determines if given channel matches required conditions
func IsMatchingClient ¶ added in v0.7.0
func IsMatchingClient(clientStateA, clientStateB ibctmtypes.ClientState) bool
IsMatchingClient determines if the two provided clients match in all fields except latest height. They are assumed to be IBC tendermint light clients. NOTE: we don't pass in a pointer so upstream references don't have a modified latest height set to zero.
func IsMatchingConnection ¶ added in v0.7.0
func IsMatchingConnection(source, counterparty *Chain, connection *conntypes.IdentifiedConnection) bool
IsMatchingConnection determines if given connection matches required conditions
func IsMatchingConsensusState ¶ added in v0.7.0
func IsMatchingConsensusState(consensusStateA, consensusStateB *ibctmtypes.ConsensusState) bool
IsMatchingConsensusState determines if the two provided consensus states are identical. They are assumed to be IBC tendermint light clients.
func MustGetHeight ¶ added in v0.6.0
func MustGetHeight(h ibcexported.Height) clienttypes.Height
MustGetHeight takes the height inteface and returns the actual height
func OrderFromString ¶ added in v0.6.0
OrderFromString parses a string into a channel order byte
func ParseChannelIDFromEvents ¶ added in v0.7.0
func ParseChannelIDFromEvents(events sdk.StringEvents) (string, error)
ParseChannelIDFromEvents parses events emitted from a MsgChannelOpenInit or MsgChannelOpenTry and returns the channel identifier.
func ParseClientIDFromEvents ¶ added in v0.7.0
func ParseClientIDFromEvents(events sdk.StringEvents) (string, error)
ParseClientIDFromEvents parses events emitted from a MsgCreateClient and returns the client identifier.
func ParseConnectionIDFromEvents ¶ added in v0.7.0
func ParseConnectionIDFromEvents(events sdk.StringEvents) (string, error)
ParseConnectionIDFromEvents parses events emitted from a MsgConnectionOpenInit or MsgConnectionOpenTry and returns the connection identifier.
func ParseEvents ¶ added in v0.6.0
ParseEvents takes events in the query format and reutrns
func QueryChannelPair ¶
func QueryChannelPair(src, dst *Chain, srcH, dstH int64) (srcChan, dstChan *chantypes.QueryChannelResponse, err error)
QueryChannelPair returns a pair of channel responses
func QueryConnectionPair ¶
func QueryConnectionPair( src, dst *Chain, srcH, dstH int64) (srcConn, dstConn *conntypes.QueryConnectionResponse, err error)
QueryConnectionPair returns a pair of connection responses
func QueryLatestHeights ¶
QueryLatestHeights returns the heights of multiple chains at once
func RandLowerCaseLetterString ¶ added in v0.6.0
RandLowerCaseLetterString returns a lowercase letter string of given length
func RunStrategy ¶ added in v0.6.0
RunStrategy runs a given strategy
func ValidateChannelParams ¶ added in v0.7.0
ValidateChannelParams takes two chains and validates their respective channel params
func ValidateClientPaths ¶ added in v0.7.0
ValidateClientPaths takes two chains and validates their clients
func ValidateConnectionPaths ¶ added in v0.7.0
ValidateConnectionPaths takes two chains and validates the connections and underlying client identifiers
func ValidatePaths ¶ added in v0.6.0
ValidatePaths takes two chains and validates their paths
Types ¶
type Chain ¶
type Chain struct { Key string `yaml:"key" json:"key"` ChainID string `yaml:"chain-id" json:"chain-id"` RPCAddr string `yaml:"rpc-addr" json:"rpc-addr"` AccountPrefix string `yaml:"account-prefix" json:"account-prefix"` GasAdjustment float64 `yaml:"gas-adjustment" json:"gas-adjustment"` GasPrices string `yaml:"gas-prices" json:"gas-prices"` TrustingPeriod string `yaml:"trusting-period" json:"trusting-period"` // TODO: make these private HomePath string `yaml:"-" json:"-"` PathEnd *PathEnd `yaml:"-" json:"-"` Keybase keys.Keyring `yaml:"-" json:"-"` Client rpcclient.Client `yaml:"-" json:"-"` Encoding params.EncodingConfig `yaml:"-" json:"-"` Provider provtypes.Provider `yaml:"-" json:"-"` // contains filtered or unexported fields }
Chain represents the necessary data for connecting to and indentifying a chain and its counterparites
func UnmarshalChain ¶ added in v0.6.0
UnmarshalChain returns Marshalled chain
func (*Chain) AddPath ¶
AddPath takes the elements of a path and validates then, setting that path to the chain
func (*Chain) CLIContext ¶ added in v0.6.0
CLIContext returns an instance of client.Context derived from Chain
func (*Chain) ChanAck ¶ added in v0.7.0
func (c *Chain) ChanAck(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ChanAck creates a MsgChannelOpenAck
func (*Chain) ChanCloseConfirm ¶ added in v0.7.0
func (c *Chain) ChanCloseConfirm(dstChanState *chantypes.QueryChannelResponse) sdk.Msg
ChanCloseConfirm creates a MsgChannelCloseConfirm
func (*Chain) ChanCloseInit ¶ added in v0.7.0
ChanCloseInit creates a MsgChannelCloseInit
func (*Chain) ChanConfirm ¶ added in v0.7.0
func (c *Chain) ChanConfirm(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ChanConfirm creates a MsgChannelOpenConfirm
func (*Chain) ChanInit ¶ added in v0.7.0
func (c *Chain) ChanInit(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ChanInit creates a MsgChannelOpenInit
func (*Chain) ChanTry ¶ added in v0.7.0
func (c *Chain) ChanTry(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ChanTry creates a MsgChannelOpenTry
func (*Chain) CloseChannel ¶ added in v0.6.0
CloseChannel runs the channel closing messages on timeout until they pass TODO: add max retries or something to this function
func (*Chain) CloseChannelStep ¶ added in v0.6.0
CloseChannelStep returns the next set of messages for closing a channel with given identifiers between chains src and dst. If the closing handshake hasn't started, then CloseChannelStep will begin the handshake on the src chain
func (*Chain) ConnAck ¶ added in v0.7.0
func (c *Chain) ConnAck(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ConnAck creates a MsgConnectionOpenAck
func (*Chain) ConnConfirm ¶ added in v0.7.0
func (c *Chain) ConnConfirm(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ConnConfirm creates a MsgConnectionOpenConfirm
func (*Chain) ConnInit ¶ added in v0.7.0
func (c *Chain) ConnInit(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ConnInit creates a MsgConnectionOpenInit
func (*Chain) ConnTry ¶ added in v0.7.0
func (c *Chain) ConnTry(counterparty *Chain, counterpartyHeader *tmclient.Header) ([]sdk.Msg, error)
ConnTry creates a MsgConnectionOpenTry
func (*Chain) CreateClient ¶ added in v0.7.0
func (c *Chain) CreateClient( clientState *tmclient.ClientState, dstHeader *tmclient.Header) (sdk.Msg, error)
CreateClient creates an sdk.Msg to update the client on src with consensus state from dst
func (*Chain) CreateClients ¶
func (c *Chain) CreateClients(dst *Chain, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override bool) (modified bool, err error)
CreateClients creates clients for src on dst and dst on src if the client ids are unspecified. TODO: de-duplicate code
func (*Chain) CreateOpenChannels ¶ added in v0.7.0
func (c *Chain) CreateOpenChannels(dst *Chain, maxRetries uint64, to time.Duration) (modified bool, err error)
CreateOpenChannels runs the channel creation messages on timeout until they pass
func (*Chain) CreateOpenConnections ¶ added in v0.7.0
func (c *Chain) CreateOpenConnections(dst *Chain, maxRetries uint64, to time.Duration) (modified bool, err error)
CreateOpenConnections runs the connection creation messages on timeout until they pass. The returned boolean indicates that the path end has been modified.
func (*Chain) CreateTestKey ¶ added in v0.6.0
CreateTestKey creates a key for test chain
func (*Chain) ErrCantSetPath ¶
ErrCantSetPath returns an error if the path doesn't set properly
func (*Chain) ErrPathNotSet ¶
ErrPathNotSet returns information what identifiers are needed to relay
func (*Chain) FaucetHandler ¶ added in v0.6.0
func (c *Chain) FaucetHandler(fromKey sdk.AccAddress, amounts sdk.Coins) func(w http.ResponseWriter, r *http.Request)
FaucetHandler listens for addresses
func (*Chain) GenerateConnHandshakeProof ¶ added in v0.7.0
func (c *Chain) GenerateConnHandshakeProof(height uint64) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight clienttypes.Height, err error)
GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the connection state on this chain. A counterparty should use these generated proofs.
func (*Chain) GetAddress ¶
func (c *Chain) GetAddress() (sdk.AccAddress, error)
GetAddress returns the sdk.AccAddress associated with the configured key
func (*Chain) GetIBCUpdateHeader ¶ added in v0.8.0
GetIBCUpdateHeader updates the off chain tendermint light client and returns an IBC Update Header which can be used to update an on chain light client on the destination chain. The source is used to construct the header data.
func (*Chain) GetLightSignedHeaderAtHeight ¶ added in v0.6.0
func (*Chain) GetRPCPort ¶ added in v0.6.0
GetRPCPort returns the port configured for the chain
func (*Chain) GetSelfVersion ¶ added in v0.6.0
GetSelfVersion returns the version of the given chain
func (*Chain) GetTimeout ¶ added in v0.6.0
GetTimeout returns the chain's configured timeout
func (*Chain) GetTrustingPeriod ¶
GetTrustingPeriod returns the trusting period for the chain
func (*Chain) Init ¶
Init initializes the pieces of a chain that aren't set when it parses a config NOTE: All validation of the chain should happen here.
func (*Chain) InjectTrustedFields ¶ added in v0.8.0
InjectTrustedFields injects the necessary trusted fields for a header to update a light client stored on the destination chain, using the information provided by the source chain. TrustedHeight is the latest height of the IBC client on dst TrustedValidators is the validator set of srcChain at the TrustedHeight InjectTrustedFields returns a copy of the header with TrustedFields modified
func (*Chain) KeyExists ¶ added in v0.6.0
KeyExists returns true if there is a specified key in chain's keybase
func (*Chain) ListenRPCEmitJSON ¶ added in v0.6.0
ListenRPCEmitJSON listens for tx and block events from a chain and outputs them as JSON to stdout
func (*Chain) LogFailedTx ¶
LogFailedTx takes the transaction and the messages to create it and logs the appropriate data
func (*Chain) LogSuccessTx ¶
func (c *Chain) LogSuccessTx(res *sdk.TxResponse, msgs []sdk.Msg)
LogSuccessTx take the transaction and the messages to create it and logs the appropriate data
func (*Chain) MakeEncodingConfig ¶ added in v0.6.0
func (c *Chain) MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig returns the encoding txConfig for the chain
func (*Chain) MsgRelayAcknowledgement ¶ added in v0.9.0
func (c *Chain) MsgRelayAcknowledgement(counterparty *Chain, counterpartyHeight int64, packet *relayMsgPacketAck) (sdk.Msg, error)
MsgRelayAcknowledgement constructs the MsgAcknowledgement which is to be sent to the sending chain. The counterparty represents the receiving chain where the acknowledgement would be stored.
func (*Chain) MsgRelayRecvPacket ¶ added in v0.9.0
func (c *Chain) MsgRelayRecvPacket(counterparty *Chain, counterpartyHeight int64, packet *relayMsgRecvPacket) (sdk.Msg, error)
MsgRelayRecvPacket constructs the MsgRecvPacket which is to be sent to the receiving chain. The counterparty represents the sending chain where the packet commitment would be stored.
func (*Chain) MsgRelayTimeout ¶ added in v0.9.0
func (c *Chain) MsgRelayTimeout(counterparty *Chain, counterpartyHeight int64, packet *relayMsgTimeout) (sdk.Msg, error)
MsgRelayTimeout constructs the MsgTimeout which is to be sent to the sending chain. The counterparty represents the receiving chain where the receipts would have been stored.
func (*Chain) MsgTransfer ¶ added in v0.7.0
func (c *Chain) MsgTransfer(dst *PathEnd, amount sdk.Coin, dstAddr string, timeoutHeight, timeoutTimestamp uint64) sdk.Msg
MsgTransfer creates a new transfer message
func (*Chain) MustGetAddress ¶
MustGetAddress used for brevity
func (*Chain) NewProtoCodec ¶ added in v0.6.0
func (c *Chain) NewProtoCodec(interfaceRegistry types.InterfaceRegistry, accountPrefix string) *ProtoCodec
NewProtoCodec returns a reference to a new ProtoCodec
func (*Chain) Print ¶
Print fmt.Printlns the json or yaml representation of whatever is passed in CONTRACT: The cmd calling this function needs to have the "json" and "indent" flags set TODO: better "text" printing here would be a nice to have TODO: fix indenting all over the code base
func (*Chain) QueryABCI ¶
func (c *Chain) QueryABCI(req abci.RequestQuery) (res abci.ResponseQuery, err error)
QueryABCI is an affordance for querying the ABCI server associated with a chain Similar to cliCtx.QueryABCI
func (*Chain) QueryBalance ¶
QueryBalance returns the amount of coins in the relayer account
func (*Chain) QueryBalanceWithAddress ¶ added in v0.8.0
QueryBalanceWithAddress returns the amount of coins in the relayer account with address as input
func (*Chain) QueryChannel ¶
func (c *Chain) QueryChannel(height int64) (chanRes *chantypes.QueryChannelResponse, err error)
QueryChannel returns the channel associated with a channelID
func (*Chain) QueryChannelClient ¶ added in v0.6.0
func (c *Chain) QueryChannelClient(height int64) (*chantypes.QueryChannelClientStateResponse, error)
QueryChannelClient returns the client state of the client supporting a given channel
func (*Chain) QueryChannels ¶
func (c *Chain) QueryChannels(pagereq *querytypes.PageRequest) (*chantypes.QueryChannelsResponse, error)
QueryChannels returns all the channels that are registered on a chain
func (*Chain) QueryClientConsensusState ¶
func (c *Chain) QueryClientConsensusState( height int64, dstClientConsHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)
QueryClientConsensusState retrevies the latest consensus state for a client in state at a given height
func (*Chain) QueryClientState ¶
func (c *Chain) QueryClientState(height int64) (ibcexported.ClientState, error)
QueryClientState retrevies the latest consensus state for a client in state at a given height and unpacks it to exported client state interface
func (*Chain) QueryClientStateResponse ¶ added in v1.0.0
func (c *Chain) QueryClientStateResponse(height int64) (*clienttypes.QueryClientStateResponse, error)
QueryClientStateResponse retrevies the latest consensus state for a client in state at a given height
func (*Chain) QueryClients ¶
func (c *Chain) QueryClients(pagereq *querytypes.PageRequest) (*clienttypes.QueryClientStatesResponse, error)
QueryClients queries all the clients!
func (*Chain) QueryConnection ¶
func (c *Chain) QueryConnection(height int64) (*conntypes.QueryConnectionResponse, error)
QueryConnection returns the remote end of a given connection
func (*Chain) QueryConnectionChannels ¶ added in v0.6.0
func (c *Chain) QueryConnectionChannels( connectionID string, pagereq *querytypes.PageRequest) (*chantypes.QueryConnectionChannelsResponse, error)
QueryConnectionChannels queries the channels associated with a connection
func (*Chain) QueryConnections ¶
func (c *Chain) QueryConnections( pagereq *querytypes.PageRequest) (conns *conntypes.QueryConnectionsResponse, err error)
QueryConnections gets any connections on a chain
func (*Chain) QueryConnectionsUsingClient ¶
func (c *Chain) QueryConnectionsUsingClient( height int64) (clientConns *conntypes.QueryClientConnectionsResponse, err error)
QueryConnectionsUsingClient gets any connections that exist between chain and counterparty
func (*Chain) QueryConsensusState ¶
QueryConsensusState returns a consensus state for a given chain to be used as a client in another chain, fetches latest height when passed 0 as arg
func (*Chain) QueryDenomTrace ¶ added in v0.6.0
func (c *Chain) QueryDenomTrace(denom string) (*transfertypes.QueryDenomTraceResponse, error)
QueryDenomTrace takes a denom from IBC and queries the information about it
func (*Chain) QueryDenomTraces ¶ added in v0.6.0
func (c *Chain) QueryDenomTraces(pagereq *querytypes.PageRequest, height int64) (*transfertypes.QueryDenomTracesResponse, error)
QueryDenomTraces returns all the denom traces from a given chain
func (*Chain) QueryHeaderAtHeight ¶
QueryHeaderAtHeight returns the header at a given height
func (*Chain) QueryHistoricalInfo ¶ added in v0.6.0
func (c *Chain) QueryHistoricalInfo(height clienttypes.Height) (*stakingtypes.QueryHistoricalInfoResponse, error)
QueryHistoricalInfo returns historical header data
func (*Chain) QueryLatestHeight ¶
QueryLatestHeight queries the chain for the latest height and returns it
func (*Chain) QueryNextSeqRecv ¶
func (c *Chain) QueryNextSeqRecv(height int64) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error)
QueryNextSeqRecv returns the next seqRecv for a configured channel
func (*Chain) QueryPacketAcknowledgement ¶ added in v0.6.0
func (c *Chain) QueryPacketAcknowledgement(height int64, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error)
QueryPacketAcknowledgement returns the packet ack proof at a given height
func (*Chain) QueryPacketAcknowledgements ¶ added in v0.6.0
func (c *Chain) QueryPacketAcknowledgements(pagereq *querytypes.PageRequest, height uint64) (comRes *chantypes.QueryPacketAcknowledgementsResponse, err error)
QueryPacketAcknowledgements returns an array of packet acks
func (*Chain) QueryPacketCommitment ¶
func (c *Chain) QueryPacketCommitment( height int64, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error)
QueryPacketCommitment returns the packet commitment proof at a given height
func (*Chain) QueryPacketCommitments ¶ added in v0.6.0
func (c *Chain) QueryPacketCommitments(pagereq *querytypes.PageRequest, height uint64) (comRes *chantypes.QueryPacketCommitmentsResponse, err error)
QueryPacketCommitments returns an array of packet commitments
func (*Chain) QueryPacketReceipt ¶ added in v0.8.0
func (c *Chain) QueryPacketReceipt(height int64, seq uint64) (recRes *chantypes.QueryPacketReceiptResponse, err error)
QueryPacketReceipt returns the packet receipt proof at a given height
func (*Chain) QueryTMClientState ¶ added in v1.0.0
func (c *Chain) QueryTMClientState(height int64) (*tmclient.ClientState, error)
QueryTMClientState retrevies the latest consensus state for a client in state at a given height and unpacks/cast it to tendermint clientstate
func (*Chain) QueryTxs ¶
func (c *Chain) QueryTxs(height uint64, page, limit int, events []string) ([]*ctypes.ResultTx, error)
QueryTxs returns an array of transactions given a tag
func (*Chain) QueryUnbondingPeriod ¶ added in v0.6.0
QueryUnbondingPeriod returns the unbonding period of the chain
func (*Chain) QueryUnreceivedAcknowledgements ¶ added in v0.8.0
QueryUnreceivedAcknowledgements returns a list of unrelayed packet acks
func (*Chain) QueryUnreceivedPackets ¶ added in v0.8.0
QueryUnreceivedPackets returns a list of unrelayed packet commitments
func (*Chain) QueryUpgradeProof ¶ added in v0.7.0
QueryUpgradeProof performs an abci query with the given key and returns the proto encoded merkle proof for the query and the height at which the proof will succeed on a tendermint verifier.
func (*Chain) QueryUpgradedClient ¶ added in v0.7.0
func (c *Chain) QueryUpgradedClient(height int64) (*codectypes.Any, []byte, clienttypes.Height, error)
QueryUpgradedClient returns upgraded client info
func (*Chain) QueryUpgradedConsState ¶ added in v0.7.0
func (c *Chain) QueryUpgradedConsState(height int64) (*codectypes.Any, []byte, clienttypes.Height, error)
QueryUpgradedConsState returns upgraded consensus state and height of client
func (*Chain) QueryValsetAtHeight ¶ added in v0.6.0
func (c *Chain) QueryValsetAtHeight(height clienttypes.Height) (*tmproto.ValidatorSet, error)
QueryValsetAtHeight returns the validator set at a given height
func (*Chain) QueryWithData ¶
QueryWithData satisfies auth.NodeQuerier interface and used for fetching account details
func (*Chain) SendAndPrint ¶
SendAndPrint sends a transaction and prints according to the passed args
func (*Chain) SendMsgWithKey ¶ added in v0.6.0
SendMsgWithKey allows the user to specify which relayer key will sign the message
func (*Chain) SendMsgs ¶
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.
func (*Chain) SendTransferMsg ¶ added in v0.6.0
func (c *Chain) SendTransferMsg(dst *Chain, amount sdk.Coin, dstAddr string, toHeightOffset uint64, toTimeOffset time.Duration) error
SendTransferMsg initiates an ibs20 transfer from src to dst with the specified args
func (*Chain) Subscribe ¶
func (c *Chain) Subscribe(query string) (<-chan ctypes.ResultEvent, context.CancelFunc, error)
Subscribe returns channel of events given a query
func (*Chain) UpdateClient ¶ added in v0.7.0
UpdateClient creates an sdk.Msg to update the client on src with data pulled from dst at the request height..
func (*Chain) UpdateClients ¶ added in v0.6.0
UpdateClients updates clients for src on dst and dst on src given the configured paths
func (*Chain) UpgradeChain ¶ added in v0.7.0
func (c *Chain) UpgradeChain(dst *Chain, plan *upgradetypes.Plan, deposit sdk.Coin, unbondingPeriod time.Duration) error
UpgradeChain submits and upgrade proposal using a zero'd out client state with an updated unbonding period.
func (*Chain) UpgradeClients ¶ added in v0.7.0
UpgradeClients upgrades the client on src after dst chain has undergone an upgrade.
func (*Chain) UseSDKContext ¶ added in v0.6.0
func (c *Chain) UseSDKContext() func()
UseSDKContext uses a custom Bech32 account prefix and returns a restore func CONTRACT: When using this function, caller must ensure that lock contention doesn't cause program to hang. This function is only for use in codec calls
func (*Chain) WaitForNBlocks ¶ added in v0.6.0
WaitForNBlocks blocks until the next block on a given chain
type Chains ¶
type Chains []*Chain
Chains is a collection of Chain
type DeliverMsgsAction ¶ added in v0.6.0
type DeliverMsgsAction struct { SrcMsgs []string `json:"src_msgs"` Src PathEnd `json:"src"` DstMsgs []string `json:"dst_msgs"` Dst PathEnd `json:"dst"` Last bool `json:"last"` Succeeded bool `json:"succeeded"` Type string `json:"type"` }
DeliverMsgsAction is struct
type FaucetRequest ¶ added in v0.6.0
FaucetRequest represents a request to the facuet
type NaiveStrategy ¶
type NaiveStrategy struct { Ordered bool MaxTxSize uint64 // maximum permitted size of the msgs in a bundled relay transaction MaxMsgLength uint64 // maximum amount of messages in a bundled relay transaction }
NaiveStrategy is an implementation of Strategy.
func (*NaiveStrategy) GetType ¶
func (nrs *NaiveStrategy) GetType() string
GetType implements Strategy
func (*NaiveStrategy) HandleEvents ¶ added in v0.6.0
func (nrs *NaiveStrategy) HandleEvents(src, dst *Chain, srch, dsth int64, events map[string][]string)
HandleEvents defines how the relayer will handle block and transaction events as they are emitted
func (*NaiveStrategy) RelayAcknowledgements ¶ added in v0.6.0
func (nrs *NaiveStrategy) RelayAcknowledgements(src, dst *Chain, sp *RelaySequences) error
RelayAcknowledgements creates transactions to relay acknowledgements from src to dst and from dst to src
func (*NaiveStrategy) RelayPackets ¶ added in v0.6.0
func (nrs *NaiveStrategy) RelayPackets(src, dst *Chain, sp *RelaySequences) error
RelayPackets creates transactions to relay packets from src to dst and from dst to src
func (*NaiveStrategy) UnrelayedAcknowledgements ¶ added in v0.6.0
func (nrs *NaiveStrategy) UnrelayedAcknowledgements(src, dst *Chain) (*RelaySequences, error)
UnrelayedAcknowledgements returns the unrelayed sequence numbers between two chains
func (*NaiveStrategy) UnrelayedSequences ¶ added in v0.6.0
func (nrs *NaiveStrategy) UnrelayedSequences(src, dst *Chain) (*RelaySequences, error)
UnrelayedSequences returns the unrelayed sequence numbers between two chains
type Path ¶
type Path struct { Src *PathEnd `yaml:"src" json:"src"` Dst *PathEnd `yaml:"dst" json:"dst"` Strategy *StrategyCfg `yaml:"strategy" json:"strategy"` }
Path represents a pair of chains and the identifiers needed to relay over them
func GenPath ¶ added in v0.6.0
GenPath generates a path with unspecified client, connection and channel identifiers given chainIDs and portIDs.
func (*Path) GetStrategy ¶
GetStrategy the strategy defined in the relay messages
func (*Path) MustGetStrategy ¶ added in v0.6.0
MustGetStrategy returns the strategy and panics on error
func (*Path) Ordered ¶ added in v0.6.0
Ordered returns true if the path is ordered and false if otherwise
func (*Path) QueryPathStatus ¶ added in v0.6.0
func (p *Path) QueryPathStatus(src, dst *Chain) *PathWithStatus
QueryPathStatus returns an instance of the path struct with some attached data about the current status of the path
type PathAction ¶ added in v0.6.0
PathAction is struct
type PathEnd ¶
type PathEnd struct { ChainID string `yaml:"chain-id,omitempty" json:"chain-id,omitempty"` ClientID string `yaml:"client-id,omitempty" json:"client-id,omitempty"` ConnectionID string `yaml:"connection-id,omitempty" json:"connection-id,omitempty"` ChannelID string `yaml:"channel-id,omitempty" json:"channel-id,omitempty"` PortID string `yaml:"port-id,omitempty" json:"port-id,omitempty"` Order string `yaml:"order,omitempty" json:"order,omitempty"` Version string `yaml:"version,omitempty" json:"version,omitempty"` }
PathEnd represents the local connection identifers for a relay path The path is set on the chain before performing operations
func (*PathEnd) NewPacket ¶
func (pe *PathEnd) NewPacket(dst *PathEnd, sequence uint64, packetData []byte, timeoutHeight clienttypes.Height, timeoutStamp uint64) chantypes.Packet
NewPacket returns a new packet from src to dist w
func (*PathEnd) ValidateBasic ¶ added in v0.7.0
ValidateBasic validates fields that cannot be empty such as the port and channel order.
func (*PathEnd) ValidateFull ¶ added in v0.7.0
ValidateFull returns errors about invalid identifiers as well as unset path variables for the appropriate type
type PathStatus ¶ added in v0.6.0
type PathStatus struct { Chains bool `yaml:"chains" json:"chains"` Clients bool `yaml:"clients" json:"clients"` Connection bool `yaml:"connection" json:"connection"` Channel bool `yaml:"channel" json:"channel"` }
PathStatus holds the status of the primitives in the path
type PathWithStatus ¶ added in v0.6.0
type PathWithStatus struct { Path *Path `yaml:"path" json:"chains"` Status PathStatus `yaml:"status" json:"status"` }
PathWithStatus is used for showing the status of the path
func (*PathWithStatus) PrintString ¶ added in v0.6.0
func (ps *PathWithStatus) PrintString(name string) string
PrintString prints a string representations of the path status
type Paths ¶
Paths represent connection paths between chains
type ProtoCodec ¶ added in v0.6.0
type ProtoCodec struct {
// contains filtered or unexported fields
}
ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON encoding.
func (*ProtoCodec) InterfaceRegistry ¶ added in v0.6.0
func (pc *ProtoCodec) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns the ProtoCodec interfaceRegistry
func (*ProtoCodec) Marshal ¶ added in v1.0.0
func (pc *ProtoCodec) Marshal(o codec.ProtoMarshaler) ([]byte, error)
Marshal implements BinaryCodec.Marshal method.
func (*ProtoCodec) MarshalInterface ¶ added in v0.7.0
func (pc *ProtoCodec) MarshalInterface(i proto.Message) ([]byte, error)
MarshalInterface is a convenience function for proto marshalling interfaces. It packs the provided value, which must be an interface, in an Any and then marshals it to bytes. NOTE: to marshal a concrete type, you should use Marshal instead
func (*ProtoCodec) MarshalInterfaceJSON ¶ added in v0.7.0
func (pc *ProtoCodec) MarshalInterfaceJSON(x proto.Message) ([]byte, error)
MarshalInterfaceJSON is a convenience function for proto marshalling interfaces. It packs the provided value in an Any and then marshals it to bytes. NOTE: to marshal a concrete type, you should use MarshalJSON instead
func (*ProtoCodec) MarshalJSON ¶ added in v0.6.0
func (pc *ProtoCodec) MarshalJSON(o proto.Message) ([]byte, error)
MarshalJSON implements JSONCodec.MarshalJSON method, it marshals to JSON using proto codec.
func (*ProtoCodec) MarshalLengthPrefixed ¶ added in v1.0.0
func (pc *ProtoCodec) MarshalLengthPrefixed(o codec.ProtoMarshaler) ([]byte, error)
MarshalLengthPrefixed implements BinaryCodec.MarshalLengthPrefixed method.
func (*ProtoCodec) MustMarshal ¶ added in v1.0.0
func (pc *ProtoCodec) MustMarshal(o codec.ProtoMarshaler) []byte
MustMarshal implements BinaryCodec.MustMarshal method.
func (*ProtoCodec) MustMarshalJSON ¶ added in v0.6.0
func (pc *ProtoCodec) MustMarshalJSON(o proto.Message) []byte
MustMarshalJSON implements JSONCodec.MustMarshalJSON method, it executes MarshalJSON except it panics upon failure.
func (*ProtoCodec) MustMarshalLengthPrefixed ¶ added in v1.0.0
func (pc *ProtoCodec) MustMarshalLengthPrefixed(o codec.ProtoMarshaler) []byte
MustMarshalLengthPrefixed implements BinaryCodec.MustMarshalLengthPrefixed method.
func (*ProtoCodec) MustUnmarshal ¶ added in v1.0.0
func (pc *ProtoCodec) MustUnmarshal(bz []byte, ptr codec.ProtoMarshaler)
MustUnmarshal implements BinaryCodec.MustUnmarshal method.
func (*ProtoCodec) MustUnmarshalJSON ¶ added in v0.6.0
func (pc *ProtoCodec) MustUnmarshalJSON(bz []byte, ptr proto.Message)
MustUnmarshalJSON implements JSONCodec.MustUnmarshalJSON method, it executes UnmarshalJSON except it panics upon failure.
func (*ProtoCodec) MustUnmarshalLengthPrefixed ¶ added in v1.0.0
func (pc *ProtoCodec) MustUnmarshalLengthPrefixed(bz []byte, ptr codec.ProtoMarshaler)
MustUnmarshalLengthPrefixed implements BinaryCodec.MustUnmarshalLengthPrefixed method.
func (*ProtoCodec) Unmarshal ¶ added in v1.0.0
func (pc *ProtoCodec) Unmarshal(bz []byte, ptr codec.ProtoMarshaler) error
Unmarshal implements BinaryMarshaler.Unmarshal method.
func (*ProtoCodec) UnmarshalInterface ¶ added in v0.7.0
func (pc *ProtoCodec) UnmarshalInterface(bz []byte, ptr interface{}) error
UnmarshalInterface is a convenience function for proto unmarshaling interfaces. It unmarshals an Any from bz bytes and then unpacks it to the `ptr`, which must be a pointer to a non empty interface with registered implementations. NOTE: to unmarshal a concrete type, you should use Unmarshal instead
Example:
var x MyInterface err := cdc.UnmarshalInterface(bz, &x)
func (*ProtoCodec) UnmarshalInterfaceJSON ¶ added in v0.7.0
func (pc *ProtoCodec) UnmarshalInterfaceJSON(bz []byte, iface interface{}) error
UnmarshalInterfaceJSON is a convenience function for proto unmarshaling interfaces. It unmarshals an Any from bz bytes and then unpacks it to the `iface`, which must be a pointer to a non empty interface, implementing proto.Message with registered implementations. NOTE: to unmarshal a concrete type, you should use UnmarshalJSON instead
Example:
var x MyInterface // must implement proto.Message err := cdc.UnmarshalInterfaceJSON(&x, bz)
func (*ProtoCodec) UnmarshalJSON ¶ added in v0.6.0
func (pc *ProtoCodec) UnmarshalJSON(bz []byte, ptr proto.Message) error
UnmarshalJSON implements JSONCodec.UnmarshalJSON method, it unmarshals from JSON using proto codec.
func (*ProtoCodec) UnmarshalLengthPrefixed ¶ added in v1.0.0
func (pc *ProtoCodec) UnmarshalLengthPrefixed(bz []byte, ptr codec.ProtoMarshaler) error
UnmarshalLengthPrefixed implements BinaryCodec.UnmarshalLengthPrefixed method.
type RelayMsgs ¶
type RelayMsgs struct { Src []sdk.Msg `json:"src"` Dst []sdk.Msg `json:"dst"` MaxTxSize uint64 `json:"max_tx_size"` // maximum permitted size of the msgs in a bundled relay transaction MaxMsgLength uint64 `json:"max_msg_length"` // maximum amount of messages in a bundled relay transaction Last bool `json:"last"` Succeeded bool `json:"success"` }
RelayMsgs contains the msgs that need to be sent to both a src and dst chain after a given relay round. MaxTxSize and MaxMsgLength are ignored if they are set to zero.
func NewRelayMsgs ¶ added in v0.6.0
func NewRelayMsgs() *RelayMsgs
NewRelayMsgs returns an initialized version of relay messages
func (*RelayMsgs) SendWithController ¶ added in v0.6.0
type RelaySequences ¶ added in v0.6.0
RelaySequences represents unrelayed packets on src and dst
type Strategy ¶
type Strategy interface { GetType() string HandleEvents(src, dst *Chain, srch, dsth int64, events map[string][]string) UnrelayedSequences(src, dst *Chain) (*RelaySequences, error) UnrelayedAcknowledgements(src, dst *Chain) (*RelaySequences, error) RelayPackets(src, dst *Chain, sp *RelaySequences) error RelayAcknowledgements(src, dst *Chain, sp *RelaySequences) error }
Strategy defines
type StrategyCfg ¶
type StrategyCfg struct {
Type string `json:"type" yaml:"type"`
}
StrategyCfg defines which relaying strategy to take for a given path
func NewNaiveStrategy ¶
func NewNaiveStrategy() *StrategyCfg
NewNaiveStrategy returns the proper config for the NaiveStrategy