Documentation
¶
Overview ¶
Package zap provides ZAP transport implementation for VM RPC.
Index ¶
- Variables
- func Dial(ctx context.Context, addr string, config *zapwire.Config) (*zapwire.Conn, error)
- func NewListener() (net.Listener, error)
- type Client
- func (c *Client) Close() error
- func (c *Client) GetBlock(ctx context.Context, blkID ids.ID) (vm.Block, error)
- func (c *Client) Initialize(ctx context.Context, init vm.Init) error
- func (c *Client) LastAccepted(ctx context.Context) (ids.ID, error)
- func (c *Client) ParseBlock(ctx context.Context, blockBytes []byte) (vm.Block, error)
- func (c *Client) SetPreference(ctx context.Context, blkID ids.ID) error
- func (c *Client) Shutdown(ctx context.Context) error
- type Sender
- func (s *Sender) SendError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, ...) error
- func (s *Sender) SendGossip(ctx context.Context, config p2p.SendConfig, msg []byte) error
- func (s *Sender) SendRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, ...) error
- func (s *Sender) SendResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotConnected = errors.New("zap: not connected") ErrInvalidResponse = errors.New("zap: invalid response") )
Functions ¶
func NewListener ¶
NewListener creates a new TCP listener on an available port. This is used for the ZAP handshake during VM subprocess bootstrap.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements vm.VM over ZAP transport
func (*Client) Initialize ¶
Initialize implements vm.VM
func (*Client) LastAccepted ¶
LastAccepted implements vm.VM
func (*Client) ParseBlock ¶
ParseBlock implements vm.VM
func (*Client) SetPreference ¶
SetPreference implements vm.VM
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender implements p2p.Sender over ZAP transport
func (*Sender) SendError ¶
func (s *Sender) SendError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error
SendError sends an error response to a previous request
func (*Sender) SendGossip ¶
SendGossip sends a gossip message
Click to show internal directories.
Click to hide internal directories.