Documentation ¶
Index ¶
- func CreateChannel(src, dst ChainI, ordered bool, to time.Duration) error
- func CreateClients(src, dst ChainI) error
- func CreateConnection(src, dst ChainI, to time.Duration) error
- func FindPacketAcknowledgementFromEventsBySequence(events []abci.Event, seq uint64) (*packetAcknowledgement, error)
- func FindPacketFromEventsBySequence(events []abci.Event, seq uint64) (*channeltypes.Packet, error)
- func GetPacketAcknowledgementsFromEvents(events []abci.Event) ([]packetAcknowledgement, error)
- func GetPacketsFromEvents(events []abci.Event) ([]channeltypes.Packet, error)
- func MakeEncodingConfig() simappparams.EncodingConfig
- func QueryChannelPair(src, dst ChainI, srcH, dstH int64) (srcChan, dstChan *chantypes.QueryChannelResponse, err error)
- func QueryClientConsensusStatePair(src, dst ChainI, srch, dsth int64, ...) (srcCsRes, dstCsRes *clienttypes.QueryConsensusStateResponse, err error)
- func QueryClientStatePair(src, dst ChainI, srch, dsth int64) (srcCsRes, dstCsRes *clienttypes.QueryClientStateResponse, err error)
- func QueryConnectionPair(src, dst ChainI, srcH, dstH int64) (srcConn, dstConn *conntypes.QueryConnectionResponse, err error)
- func RunStrategy(src, dst ChainI, strategy StrategyI) (func(), error)
- func SendTransferMsg(src, dst ChainI, amount sdk.Coin, dstAddr fmt.Stringer, toHeightOffset uint64, ...) error
- type ChainConfigI
- type ChainI
- type HeaderI
- type NaiveStrategy
- func (st NaiveStrategy) GetType() string
- func (st NaiveStrategy) RelayAcknowledgements(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error
- func (st NaiveStrategy) RelayPackets(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error
- func (st NaiveStrategy) UnrelayedAcknowledgements(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error)
- func (st NaiveStrategy) UnrelayedSequences(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error)
- type PathEnd
- type RelayMsgs
- type RelaySequences
- type StrategyI
- type SyncHeadersI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateChannel ¶
CreateChannel runs the channel creation messages on timeout until they pass TODO: add max retries or something to this function
func CreateClients ¶
func GetPacketsFromEvents ¶
func GetPacketsFromEvents(events []abci.Event) ([]channeltypes.Packet, error)
func MakeEncodingConfig ¶
func MakeEncodingConfig() simappparams.EncodingConfig
func QueryChannelPair ¶
func QueryChannelPair(src, dst ChainI, srcH, dstH int64) (srcChan, dstChan *chantypes.QueryChannelResponse, err error)
QueryChannelPair returns a pair of channel responses
func QueryClientConsensusStatePair ¶
func QueryClientConsensusStatePair( src, dst ChainI, srch, dsth int64, srcClientConsH, dstClientConsH ibcexported.Height) (srcCsRes, dstCsRes *clienttypes.QueryConsensusStateResponse, err error)
QueryClientConsensusStatePair allows for the querying of multiple client states at the same time
func QueryClientStatePair ¶
func QueryClientStatePair( src, dst ChainI, srch, dsth int64) (srcCsRes, dstCsRes *clienttypes.QueryClientStateResponse, err error)
QueryClientStatePair returns a pair of connection responses
func QueryConnectionPair ¶
func QueryConnectionPair( src, dst ChainI, srcH, dstH int64) (srcConn, dstConn *conntypes.QueryConnectionResponse, err error)
QueryConnectionPair returns a pair of connection responses
func RunStrategy ¶
RunStrategy runs a given strategy
Types ¶
type ChainConfigI ¶
type ChainI ¶
type ChainI interface { ClientType() string ChainID() string ClientID() string GetAddress() (sdk.AccAddress, error) // TODO consider whether the name is appropriate. // GetLatestLightHeight uses the CLI utilities to pull the latest height from a given chain GetLatestLightHeight() (int64, error) Marshaler() codec.Marshaler SetPath(p *PathEnd) error Path() *PathEnd // QueryLatestHeight queries the chain for the latest height and returns it QueryLatestHeight() (int64, error) // QueryLatestHeader returns the latest header from the chain QueryLatestHeader() (out HeaderI, err error) // QueryClientConsensusState retrevies the latest consensus state for a client in state at a given height QueryClientConsensusState(height int64, dstClientConsHeight ibcexported.Height, prove bool) (*clienttypes.QueryConsensusStateResponse, error) // height represents the height of src chain QueryClientState(height int64, prove bool) (*clienttypes.QueryClientStateResponse, error) // QueryConnection returns the remote end of a given connection QueryConnection(height int64, prove bool) (*conntypes.QueryConnectionResponse, error) // QueryChannel returns the channel associated with a channelID QueryChannel(height int64, prove bool) (chanRes *chantypes.QueryChannelResponse, err error) // QueryBalance returns the amount of coins in the relayer account QueryBalance(address sdk.AccAddress) (sdk.Coins, error) // QueryDenomTraces returns all the denom traces from a given chain QueryDenomTraces(offset, limit uint64, height int64) (*transfertypes.QueryDenomTracesResponse, error) // QueryPacketCommitment returns the packet commitment proof at a given height QueryPacketCommitment(height int64, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error) // QueryPacketCommitments returns an array of packet commitments QueryPacketCommitments(offset, limit, height uint64) (comRes *chantypes.QueryPacketCommitmentsResponse, err error) // QueryUnrecievedPackets returns a list of unrelayed packet commitments QueryUnrecievedPackets(height uint64, seqs []uint64) ([]uint64, error) // QueryPacketAcknowledgements returns an array of packet acks QueryPacketAcknowledgements(offset, limit, height uint64) (comRes *chantypes.QueryPacketAcknowledgementsResponse, err error) // QueryUnrecievedAcknowledgements returns a list of unrelayed packet acks QueryUnrecievedAcknowledgements(height uint64, seqs []uint64) ([]uint64, error) // QueryPacketAcknowledgementCommitment returns the packet ack proof at a given height QueryPacketAcknowledgementCommitment(height int64, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error) // QueryPacket returns a packet corresponds to a given sequence QueryPacket(height int64, sequence uint64) (*chantypes.Packet, error) QueryPacketAcknowledgement(height int64, sequence uint64) ([]byte, error) SendMsgs(msgs []sdk.Msg) ([]byte, error) // Send sends msgs to the chain and logging a result of it // It returns a boolean value whether the result is success Send(msgs []sdk.Msg) bool Update(key, value string) (ChainConfigI, error) // MakeMsgCreateClient creates a CreateClientMsg to this chain MakeMsgCreateClient(clientID string, dstHeader HeaderI, signer sdk.AccAddress) (sdk.Msg, error) // CreateTrustedHeader creates ... CreateTrustedHeader(dstChain ChainI, srcHeader HeaderI) (HeaderI, error) StartEventListener(dst ChainI, strategy StrategyI) Init(homePath string, timeout time.Duration, debug bool) error }
type HeaderI ¶
func UpdatesWithHeaders ¶
UpdatesWithHeaders calls UpdateLightWithHeader on the passed chains concurrently
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 NewNaiveStrategy ¶
func NewNaiveStrategy() *NaiveStrategy
func (NaiveStrategy) RelayAcknowledgements ¶
func (st NaiveStrategy) RelayAcknowledgements(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error
func (NaiveStrategy) RelayPackets ¶
func (st NaiveStrategy) RelayPackets(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error
func (NaiveStrategy) UnrelayedAcknowledgements ¶
func (st NaiveStrategy) UnrelayedAcknowledgements(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error)
func (NaiveStrategy) UnrelayedSequences ¶
func (st NaiveStrategy) UnrelayedSequences(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error)
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 ¶
func NewRelayMsgs() *RelayMsgs
NewRelayMsgs returns an initialized version of relay messages
type RelaySequences ¶
RelaySequences represents unrelayed packets on src and dst
type StrategyI ¶
type StrategyI interface { GetType() string UnrelayedSequences(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error) RelayPackets(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error UnrelayedAcknowledgements(src, dst ChainI, sh SyncHeadersI) (*RelaySequences, error) RelayAcknowledgements(src, dst ChainI, sp *RelaySequences, sh SyncHeadersI) error }
StrategyI defines
func GetStrategy ¶
func GetStrategy(cfg relayer.StrategyCfg) (StrategyI, error)
type SyncHeadersI ¶
type SyncHeadersI interface { GetHeight(chainID string) uint64 GetHeader(chainID string) HeaderI GetTrustedHeaders(src, dst ChainI) (srcHeader HeaderI, dstHeader HeaderI, err error) Updates(ChainI, ChainI) error }
func NewSyncHeaders ¶
func NewSyncHeaders(src, dst ChainI) (SyncHeadersI, error)
NewSyncHeaders returns a new instance of SyncHeadersI that can be easily kept "reasonably up to date"