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) BuildBlock(ctx context.Context) (block.Block, error)
- func (c *Client) Close() error
- func (c *Client) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (c *Client) CreateHandlers(ctx context.Context) (map[string]http.Handler, error)
- func (c *Client) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (c *Client) GetBlock(ctx context.Context, blkID ids.ID) (block.Block, error)
- func (c *Client) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)
- func (c *Client) HealthCheck(ctx context.Context) (block.HealthCheckResult, error)
- func (c *Client) Initialize(ctx context.Context, init block.Init) error
- func (c *Client) LastAccepted(ctx context.Context) (ids.ID, error)
- func (c *Client) NewHTTPHandler(ctx context.Context) (http.Handler, error)
- func (c *Client) ParseBlock(ctx context.Context, blockBytes []byte) (block.Block, error)
- func (c *Client) SetPreference(ctx context.Context, blkID ids.ID) error
- func (c *Client) SetState(ctx context.Context, state uint32) error
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) Version(ctx context.Context) (string, error)
- func (c *Client) WaitForEvent(ctx context.Context) (block.Message, 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 ¶
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 chain.ChainVM over ZAP transport
func (*Client) BuildBlock ¶ added in v1.23.4
BuildBlock implements chain.ChainVM
func (*Client) Connected ¶ added in v1.23.4
func (c *Client) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
Connected implements chain.ChainVM
func (*Client) CreateHandlers ¶ added in v1.23.4
CreateHandlers calls the VM's CreateHandlers and returns reverse proxy handlers
func (*Client) Disconnected ¶ added in v1.23.4
Disconnected implements chain.ChainVM
func (*Client) GetBlockIDAtHeight ¶ added in v1.23.4
GetBlockIDAtHeight implements chain.ChainVM
func (*Client) HealthCheck ¶ added in v1.23.4
HealthCheck implements chain.ChainVM
func (*Client) Initialize ¶
Initialize implements chain.ChainVM
func (*Client) LastAccepted ¶
LastAccepted implements chain.ChainVM
func (*Client) NewHTTPHandler ¶ added in v1.23.4
NewHTTPHandler implements chain.ChainVM
func (*Client) ParseBlock ¶
ParseBlock implements chain.ChainVM
func (*Client) SetPreference ¶
SetPreference implements chain.ChainVM
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