relayer

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RelayerApiServiceRelayProcedure is the fully-qualified name of the RelayerApiService's Relay RPC.
	RelayerApiServiceRelayProcedure = "/ibc.v2.relayer.RelayerApiService/Relay"
	// RelayerApiServicePacketsProcedure is the fully-qualified name of the RelayerApiService's Packets
	// RPC.
	RelayerApiServicePacketsProcedure = "/ibc.v2.relayer.RelayerApiService/Packets"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const ProcessReadinessEvent = "ready"

ProcessReadinessEvent identifies the relayer startup event.

View Source
const (
	// RelayerApiServiceName is the fully-qualified name of the RelayerApiService service.
	RelayerApiServiceName = "ibc.v2.relayer.RelayerApiService"
)

Variables

View Source
var (
	PacketSelection_name = map[int32]string{
		0: "PACKET_SELECTION_UNSPECIFIED",
		1: "PACKET_SELECTION_SELECTED",
		2: "PACKET_SELECTION_NOT_SELECTED",
		3: "PACKET_SELECTION_UNCONFIGURED",
	}
	PacketSelection_value = map[string]int32{
		"PACKET_SELECTION_UNSPECIFIED":  0,
		"PACKET_SELECTION_SELECTED":     1,
		"PACKET_SELECTION_NOT_SELECTED": 2,
		"PACKET_SELECTION_UNCONFIGURED": 3,
	}
)

Enum value maps for PacketSelection.

View Source
var (
	PacketState_name = map[int32]string{
		0: "PACKET_STATE_UNSPECIFIED",
		1: "PACKET_STATE_NOT_SELECTED",
		2: "PACKET_STATE_PENDING",
		3: "PACKET_STATE_SUCCEEDED",
		4: "PACKET_STATE_TIMED_OUT",
		5: "PACKET_STATE_REJECTED",
		6: "PACKET_STATE_RELAY_FAILED",
	}
	PacketState_value = map[string]int32{
		"PACKET_STATE_UNSPECIFIED":  0,
		"PACKET_STATE_NOT_SELECTED": 1,
		"PACKET_STATE_PENDING":      2,
		"PACKET_STATE_SUCCEEDED":    3,
		"PACKET_STATE_TIMED_OUT":    4,
		"PACKET_STATE_REJECTED":     5,
		"PACKET_STATE_RELAY_FAILED": 6,
	}
)

Enum value maps for PacketState.

View Source
var File_relayer_proto protoreflect.FileDescriptor

Functions

func NewRelayerApiServiceHandler

func NewRelayerApiServiceHandler(svc RelayerApiServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewRelayerApiServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type AllPackets

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

AllPackets selects every packet in the transaction for which this relayer has a configured client and route; packets without one are skipped, and the request succeeds even if that leaves nothing to relay.

func (*AllPackets) Descriptor deprecated

func (*AllPackets) Descriptor() ([]byte, []int)

Deprecated: Use AllPackets.ProtoReflect.Descriptor instead.

func (*AllPackets) ProtoMessage

func (*AllPackets) ProtoMessage()

func (*AllPackets) ProtoReflect

func (x *AllPackets) ProtoReflect() protoreflect.Message

func (*AllPackets) Reset

func (x *AllPackets) Reset()

func (*AllPackets) String

func (x *AllPackets) String() string

type ObservedPacket

type ObservedPacket struct {
	SourceClientId string          `protobuf:"bytes,1,opt,name=source_client_id,json=sourceClientId,proto3" json:"source_client_id,omitempty"`
	SequenceNumber uint64          `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"`
	Selection      PacketSelection `protobuf:"varint,3,opt,name=selection,proto3,enum=ibc.v2.relayer.PacketSelection" json:"selection,omitempty"`
	// contains filtered or unexported fields
}

func (*ObservedPacket) Descriptor deprecated

func (*ObservedPacket) Descriptor() ([]byte, []int)

Deprecated: Use ObservedPacket.ProtoReflect.Descriptor instead.

func (*ObservedPacket) GetSelection

func (x *ObservedPacket) GetSelection() PacketSelection

func (*ObservedPacket) GetSequenceNumber

func (x *ObservedPacket) GetSequenceNumber() uint64

func (*ObservedPacket) GetSourceClientId

func (x *ObservedPacket) GetSourceClientId() string

func (*ObservedPacket) ProtoMessage

func (*ObservedPacket) ProtoMessage()

func (*ObservedPacket) ProtoReflect

func (x *ObservedPacket) ProtoReflect() protoreflect.Message

func (*ObservedPacket) Reset

func (x *ObservedPacket) Reset()

func (*ObservedPacket) String

func (x *ObservedPacket) String() string

type PacketFilter

type PacketFilter struct {
	SourceChainId       *string      `protobuf:"bytes,1,opt,name=source_chain_id,json=sourceChainId,proto3,oneof" json:"source_chain_id,omitempty"`
	DestinationChainId  *string      `protobuf:"bytes,2,opt,name=destination_chain_id,json=destinationChainId,proto3,oneof" json:"destination_chain_id,omitempty"`
	SourceClientId      *string      `protobuf:"bytes,3,opt,name=source_client_id,json=sourceClientId,proto3,oneof" json:"source_client_id,omitempty"`
	DestinationClientId *string      `` /* 126-byte string literal not displayed */
	State               *PacketState `protobuf:"varint,5,opt,name=state,proto3,enum=ibc.v2.relayer.PacketState,oneof" json:"state,omitempty"`
	SourceTxHash        *string      `protobuf:"bytes,6,opt,name=source_tx_hash,json=sourceTxHash,proto3,oneof" json:"source_tx_hash,omitempty"`
	SequenceNumber      *uint64      `protobuf:"varint,7,opt,name=sequence_number,json=sequenceNumber,proto3,oneof" json:"sequence_number,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketFilter) Descriptor deprecated

func (*PacketFilter) Descriptor() ([]byte, []int)

Deprecated: Use PacketFilter.ProtoReflect.Descriptor instead.

func (*PacketFilter) GetDestinationChainId

func (x *PacketFilter) GetDestinationChainId() string

func (*PacketFilter) GetDestinationClientId

func (x *PacketFilter) GetDestinationClientId() string

func (*PacketFilter) GetSequenceNumber

func (x *PacketFilter) GetSequenceNumber() uint64

func (*PacketFilter) GetSourceChainId

func (x *PacketFilter) GetSourceChainId() string

func (*PacketFilter) GetSourceClientId

func (x *PacketFilter) GetSourceClientId() string

func (*PacketFilter) GetSourceTxHash

func (x *PacketFilter) GetSourceTxHash() string

func (*PacketFilter) GetState

func (x *PacketFilter) GetState() PacketState

func (*PacketFilter) ProtoMessage

func (*PacketFilter) ProtoMessage()

func (*PacketFilter) ProtoReflect

func (x *PacketFilter) ProtoReflect() protoreflect.Message

func (*PacketFilter) Reset

func (x *PacketFilter) Reset()

func (*PacketFilter) String

func (x *PacketFilter) String() string

type PacketSelection

type PacketSelection int32
const (
	PacketSelection_PACKET_SELECTION_UNSPECIFIED PacketSelection = 0
	// Recorded for delivery by this relayer. Delivery happens afterwards and
	// can still fail; query the packet's state to follow it.
	PacketSelection_PACKET_SELECTION_SELECTED PacketSelection = 1
	// Configured and routed, but this request did not select it.
	PacketSelection_PACKET_SELECTION_NOT_SELECTED PacketSelection = 2
	// No configured client or route, so this relayer skips it.
	PacketSelection_PACKET_SELECTION_UNCONFIGURED PacketSelection = 3
)

func (PacketSelection) Descriptor

func (PacketSelection) Enum

func (x PacketSelection) Enum() *PacketSelection

func (PacketSelection) EnumDescriptor deprecated

func (PacketSelection) EnumDescriptor() ([]byte, []int)

Deprecated: Use PacketSelection.Descriptor instead.

func (PacketSelection) Number

func (PacketSelection) String

func (x PacketSelection) String() string

func (PacketSelection) Type

type PacketSelector

type PacketSelector struct {
	SourceClientId string `protobuf:"bytes,1,opt,name=source_client_id,json=sourceClientId,proto3" json:"source_client_id,omitempty"`
	SequenceNumber uint64 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketSelector) Descriptor deprecated

func (*PacketSelector) Descriptor() ([]byte, []int)

Deprecated: Use PacketSelector.ProtoReflect.Descriptor instead.

func (*PacketSelector) GetSequenceNumber

func (x *PacketSelector) GetSequenceNumber() uint64

func (*PacketSelector) GetSourceClientId

func (x *PacketSelector) GetSourceClientId() string

func (*PacketSelector) ProtoMessage

func (*PacketSelector) ProtoMessage()

func (*PacketSelector) ProtoReflect

func (x *PacketSelector) ProtoReflect() protoreflect.Message

func (*PacketSelector) Reset

func (x *PacketSelector) Reset()

func (*PacketSelector) String

func (x *PacketSelector) String() string

type PacketState

type PacketState int32
const (
	PacketState_PACKET_STATE_UNSPECIFIED PacketState = 0
	// The packet was discovered but has not been selected by this relayer
	// instance. Another relayer may still deliver it.
	PacketState_PACKET_STATE_NOT_SELECTED PacketState = 1
	// The relayer is still processing the packet.
	PacketState_PACKET_STATE_PENDING PacketState = 2
	// The packet completed with a successful acknowledgement on the source
	// chain.
	PacketState_PACKET_STATE_SUCCEEDED PacketState = 3
	// The packet completed with a timeout refund on the source chain.
	PacketState_PACKET_STATE_TIMED_OUT PacketState = 4
	// The packet completed with an error acknowledgement on the source chain.
	PacketState_PACKET_STATE_REJECTED PacketState = 5
	// A permanent error prevents the relayer from processing the packet.
	PacketState_PACKET_STATE_RELAY_FAILED PacketState = 6
)

func (PacketState) Descriptor

func (PacketState) Enum

func (x PacketState) Enum() *PacketState

func (PacketState) EnumDescriptor deprecated

func (PacketState) EnumDescriptor() ([]byte, []int)

Deprecated: Use PacketState.Descriptor instead.

func (PacketState) Number

func (x PacketState) Number() protoreflect.EnumNumber

func (PacketState) String

func (x PacketState) String() string

func (PacketState) Type

type PacketStatus

type PacketStatus struct {
	State PacketState `protobuf:"varint,1,opt,name=state,proto3,enum=ibc.v2.relayer.PacketState" json:"state,omitempty"`
	// Together with source_client_id and send_tx.chain_id, identifies the packet.
	SequenceNumber uint64 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"`
	// Together with sequence_number and send_tx.chain_id, identifies the packet.
	SourceClientId string `protobuf:"bytes,3,opt,name=source_client_id,json=sourceClientId,proto3" json:"source_client_id,omitempty"`
	// The source-chain SendPacket transaction. Always present.
	SendTx *TransactionInfo `protobuf:"bytes,4,opt,name=send_tx,json=sendTx,proto3" json:"send_tx,omitempty"`
	// The destination-chain receive transaction, once submitted or discovered.
	RecvTx *TransactionInfo `protobuf:"bytes,5,opt,name=recv_tx,json=recvTx,proto3" json:"recv_tx,omitempty"`
	// The source-chain acknowledgement transaction. Present for succeeded and
	// rejected packets, and may be present while pending.
	AckTx *TransactionInfo `protobuf:"bytes,6,opt,name=ack_tx,json=ackTx,proto3" json:"ack_tx,omitempty"`
	// The source-chain timeout transaction. Present for timed-out packets, and
	// may be present while pending.
	TimeoutTx *TransactionInfo `protobuf:"bytes,7,opt,name=timeout_tx,json=timeoutTx,proto3" json:"timeout_tx,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketStatus) Descriptor deprecated

func (*PacketStatus) Descriptor() ([]byte, []int)

Deprecated: Use PacketStatus.ProtoReflect.Descriptor instead.

func (*PacketStatus) GetAckTx

func (x *PacketStatus) GetAckTx() *TransactionInfo

func (*PacketStatus) GetRecvTx

func (x *PacketStatus) GetRecvTx() *TransactionInfo

func (*PacketStatus) GetSendTx

func (x *PacketStatus) GetSendTx() *TransactionInfo

func (*PacketStatus) GetSequenceNumber

func (x *PacketStatus) GetSequenceNumber() uint64

func (*PacketStatus) GetSourceClientId

func (x *PacketStatus) GetSourceClientId() string

func (*PacketStatus) GetState

func (x *PacketStatus) GetState() PacketState

func (*PacketStatus) GetTimeoutTx

func (x *PacketStatus) GetTimeoutTx() *TransactionInfo

func (*PacketStatus) ProtoMessage

func (*PacketStatus) ProtoMessage()

func (*PacketStatus) ProtoReflect

func (x *PacketStatus) ProtoReflect() protoreflect.Message

func (*PacketStatus) Reset

func (x *PacketStatus) Reset()

func (*PacketStatus) String

func (x *PacketStatus) String() string

type PacketsRequest

type PacketsRequest struct {
	Filter *PacketFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
	// Zero applies the default of 100; values above 1000 are capped.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// Opaque next_cursor from a previous response. Empty starts at the newest
	// packet.
	Cursor string `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketsRequest) Descriptor deprecated

func (*PacketsRequest) Descriptor() ([]byte, []int)

Deprecated: Use PacketsRequest.ProtoReflect.Descriptor instead.

func (*PacketsRequest) GetCursor

func (x *PacketsRequest) GetCursor() string

func (*PacketsRequest) GetFilter

func (x *PacketsRequest) GetFilter() *PacketFilter

func (*PacketsRequest) GetLimit

func (x *PacketsRequest) GetLimit() uint32

func (*PacketsRequest) ProtoMessage

func (*PacketsRequest) ProtoMessage()

func (*PacketsRequest) ProtoReflect

func (x *PacketsRequest) ProtoReflect() protoreflect.Message

func (*PacketsRequest) Reset

func (x *PacketsRequest) Reset()

func (*PacketsRequest) String

func (x *PacketsRequest) String() string

type PacketsResponse

type PacketsResponse struct {
	Packets []*PacketStatus `protobuf:"bytes,1,rep,name=packets,proto3" json:"packets,omitempty"`
	// More packets match beyond this page.
	HasMore bool `protobuf:"varint,2,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"`
	// Cursor for the next page, set only when has_more.
	NextCursor string `protobuf:"bytes,3,opt,name=next_cursor,json=nextCursor,proto3" json:"next_cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*PacketsResponse) Descriptor deprecated

func (*PacketsResponse) Descriptor() ([]byte, []int)

Deprecated: Use PacketsResponse.ProtoReflect.Descriptor instead.

func (*PacketsResponse) GetHasMore

func (x *PacketsResponse) GetHasMore() bool

func (*PacketsResponse) GetNextCursor

func (x *PacketsResponse) GetNextCursor() string

func (*PacketsResponse) GetPackets

func (x *PacketsResponse) GetPackets() []*PacketStatus

func (*PacketsResponse) ProtoMessage

func (*PacketsResponse) ProtoMessage()

func (*PacketsResponse) ProtoReflect

func (x *PacketsResponse) ProtoReflect() protoreflect.Message

func (*PacketsResponse) Reset

func (x *PacketsResponse) Reset()

func (*PacketsResponse) String

func (x *PacketsResponse) String() string

type ProcessReadiness

type ProcessReadiness struct {
	Event           string   `json:"event"`
	ChainsConnected []string `json:"chainsConnected"`
	HTTP            string   `json:"http"`
}

ProcessReadiness announces the relayer's connected chains and bound HTTP address.

type RelayRequest

type RelayRequest struct {
	TxHash        string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	SourceChainId string `protobuf:"bytes,2,opt,name=source_chain_id,json=sourceChainId,proto3" json:"source_chain_id,omitempty"`
	// Selection is required and controls only this relayer instance.
	//
	// Types that are valid to be assigned to Selection:
	//
	//	*RelayRequest_AllPackets
	//	*RelayRequest_SelectedPackets
	Selection isRelayRequest_Selection `protobuf_oneof:"selection"`
	// contains filtered or unexported fields
}

func (*RelayRequest) Descriptor deprecated

func (*RelayRequest) Descriptor() ([]byte, []int)

Deprecated: Use RelayRequest.ProtoReflect.Descriptor instead.

func (*RelayRequest) GetAllPackets

func (x *RelayRequest) GetAllPackets() *AllPackets

func (*RelayRequest) GetSelectedPackets

func (x *RelayRequest) GetSelectedPackets() *SelectedPackets

func (*RelayRequest) GetSelection

func (x *RelayRequest) GetSelection() isRelayRequest_Selection

func (*RelayRequest) GetSourceChainId

func (x *RelayRequest) GetSourceChainId() string

func (*RelayRequest) GetTxHash

func (x *RelayRequest) GetTxHash() string

func (*RelayRequest) ProtoMessage

func (*RelayRequest) ProtoMessage()

func (*RelayRequest) ProtoReflect

func (x *RelayRequest) ProtoReflect() protoreflect.Message

func (*RelayRequest) Reset

func (x *RelayRequest) Reset()

func (*RelayRequest) String

func (x *RelayRequest) String() string

type RelayRequest_AllPackets

type RelayRequest_AllPackets struct {
	AllPackets *AllPackets `protobuf:"bytes,3,opt,name=all_packets,json=allPackets,proto3,oneof"`
}

type RelayRequest_SelectedPackets

type RelayRequest_SelectedPackets struct {
	SelectedPackets *SelectedPackets `protobuf:"bytes,4,opt,name=selected_packets,json=selectedPackets,proto3,oneof"`
}

type RelayResponse

type RelayResponse struct {

	// Every send packet in the transaction, including those this relayer will
	// not deliver.
	Packets []*ObservedPacket `protobuf:"bytes,1,rep,name=packets,proto3" json:"packets,omitempty"`
	// contains filtered or unexported fields
}

func (*RelayResponse) Descriptor deprecated

func (*RelayResponse) Descriptor() ([]byte, []int)

Deprecated: Use RelayResponse.ProtoReflect.Descriptor instead.

func (*RelayResponse) GetPackets

func (x *RelayResponse) GetPackets() []*ObservedPacket

func (*RelayResponse) ProtoMessage

func (*RelayResponse) ProtoMessage()

func (*RelayResponse) ProtoReflect

func (x *RelayResponse) ProtoReflect() protoreflect.Message

func (*RelayResponse) Reset

func (x *RelayResponse) Reset()

func (*RelayResponse) String

func (x *RelayResponse) String() string

type RelayerApiServiceClient

type RelayerApiServiceClient interface {
	// Relay tracks the packets emitted by a source transaction and submits the
	// transactions required to complete them.
	Relay(context.Context, *connect.Request[RelayRequest]) (*connect.Response[RelayResponse], error)
	// Packets lists the packets this relayer is aware of, most recent first.
	Packets(context.Context, *connect.Request[PacketsRequest]) (*connect.Response[PacketsResponse], error)
}

RelayerApiServiceClient is a client for the ibc.v2.relayer.RelayerApiService service.

func NewRelayerApiServiceClient

func NewRelayerApiServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RelayerApiServiceClient

NewRelayerApiServiceClient constructs a client for the ibc.v2.relayer.RelayerApiService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type RelayerApiServiceHandler

type RelayerApiServiceHandler interface {
	// Relay tracks the packets emitted by a source transaction and submits the
	// transactions required to complete them.
	Relay(context.Context, *connect.Request[RelayRequest]) (*connect.Response[RelayResponse], error)
	// Packets lists the packets this relayer is aware of, most recent first.
	Packets(context.Context, *connect.Request[PacketsRequest]) (*connect.Response[PacketsResponse], error)
}

RelayerApiServiceHandler is an implementation of the ibc.v2.relayer.RelayerApiService service.

type SelectedPackets

type SelectedPackets struct {
	Packets []*PacketSelector `protobuf:"bytes,1,rep,name=packets,proto3" json:"packets,omitempty"`
	// contains filtered or unexported fields
}

SelectedPackets selects exactly the listed packets. The request fails if any packet is absent or not configured and routed. Packets already selected, in flight, or terminal are successful no-ops.

func (*SelectedPackets) Descriptor deprecated

func (*SelectedPackets) Descriptor() ([]byte, []int)

Deprecated: Use SelectedPackets.ProtoReflect.Descriptor instead.

func (*SelectedPackets) GetPackets

func (x *SelectedPackets) GetPackets() []*PacketSelector

func (*SelectedPackets) ProtoMessage

func (*SelectedPackets) ProtoMessage()

func (*SelectedPackets) ProtoReflect

func (x *SelectedPackets) ProtoReflect() protoreflect.Message

func (*SelectedPackets) Reset

func (x *SelectedPackets) Reset()

func (*SelectedPackets) String

func (x *SelectedPackets) String() string

type TransactionInfo

type TransactionInfo struct {
	TxHash  string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TransactionInfo) Descriptor deprecated

func (*TransactionInfo) Descriptor() ([]byte, []int)

Deprecated: Use TransactionInfo.ProtoReflect.Descriptor instead.

func (*TransactionInfo) GetChainId

func (x *TransactionInfo) GetChainId() string

func (*TransactionInfo) GetTxHash

func (x *TransactionInfo) GetTxHash() string

func (*TransactionInfo) ProtoMessage

func (*TransactionInfo) ProtoMessage()

func (*TransactionInfo) ProtoReflect

func (x *TransactionInfo) ProtoReflect() protoreflect.Message

func (*TransactionInfo) Reset

func (x *TransactionInfo) Reset()

func (*TransactionInfo) String

func (x *TransactionInfo) String() string

type UnimplementedRelayerApiServiceHandler

type UnimplementedRelayerApiServiceHandler struct{}

UnimplementedRelayerApiServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedRelayerApiServiceHandler) Packets

func (UnimplementedRelayerApiServiceHandler) Relay

Jump to

Keyboard shortcuts

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