Documentation
¶
Index ¶
- func NewAdapter(sender AppSender) core.AppSender
- type Adapter
- func (a *Adapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (a *Adapter) SendAppGossip(ctx context.Context, msg []byte) error
- func (a *Adapter) SendAppRequest(ctx context.Context, nodeIDs []ids.NodeID, requestID uint32, msg []byte) error
- func (a *Adapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
- func (a *Adapter) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- func (a *Adapter) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error
- type AppSender
- type SendConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
NewAdapter creates a new adapter that converts AppSender to core.AppSender
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter adapts an AppSender to core.AppSender interface
func (*Adapter) SendAppError ¶
func (a *Adapter) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendAppError implements core.AppSender
func (*Adapter) SendAppGossip ¶
SendAppGossip implements core.AppSender
func (*Adapter) SendAppRequest ¶
func (a *Adapter) SendAppRequest(ctx context.Context, nodeIDs []ids.NodeID, requestID uint32, msg []byte) error
SendAppRequest implements core.AppSender
func (*Adapter) SendAppResponse ¶
func (a *Adapter) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, msg []byte) error
SendAppResponse implements core.AppSender
type AppSender ¶
type AppSender interface {
// SendAppRequest sends an application-level request to the given nodes.
// The VM corresponding to this AppSender may receive either:
// * An AppResponse from nodeID with ID [requestID]
// * An AppRequestFailed from nodeID with ID [requestID]
// A nil return value guarantees that the VM corresponding to this AppSender
// will receive exactly one of the above messages.
SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, message []byte) error
// SendAppResponse sends an application-level response to a request.
// This response must be in response to an AppRequest that the VM corresponding
// to this AppSender received from [nodeID] with ID [requestID].
SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, message []byte) error
// SendAppGossip sends an application-level gossip message.
SendAppGossip(ctx context.Context, config SendConfig, message []byte) error
// SendAppGossipSpecific sends an application-level gossip message to a set of peers.
SendAppGossipSpecific(ctx context.Context, nodeIDs set.Set[ids.NodeID], message []byte) error
// SendCrossChainAppRequest sends an application-level request to a specific chain.
SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, message []byte) error
// SendCrossChainAppResponse sends an application-level response to a specific chain.
// This response must be in response to a CrossChainAppRequest that the VM corresponding
// to this AppSender received from [chainID] with ID [requestID].
SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, message []byte) error
}
AppSender sends application-level messages to VMs
Click to show internal directories.
Click to hide internal directories.