Documentation ¶
Index ¶
- Variables
- type BlockClient
- type Factory
- type Plugin
- type VMClient
- func (vm *VMClient) BuildBlock() (snowman.Block, error)
- func (vm *VMClient) CreateHandlers() map[string]*common.HTTPHandler
- func (vm *VMClient) GetBlock(id ids.ID) (snowman.Block, error)
- func (vm *VMClient) Initialize(ctx *snow.Context, db database.Database, genesisBytes []byte, ...) error
- func (vm *VMClient) LastAccepted() ids.ID
- func (vm *VMClient) ParseBlock(bytes []byte) (snowman.Block, error)
- func (vm *VMClient) SetPreference(id ids.ID)
- func (vm *VMClient) SetProcess(proc *plugin.Client)
- func (vm *VMClient) Shutdown()
- type VMServer
- func (vm *VMServer) BlockAccept(_ context.Context, req *vmproto.BlockAcceptRequest) (*vmproto.BlockAcceptResponse, error)
- func (vm *VMServer) BlockReject(_ context.Context, req *vmproto.BlockRejectRequest) (*vmproto.BlockRejectResponse, error)
- func (vm *VMServer) BlockVerify(_ context.Context, req *vmproto.BlockVerifyRequest) (*vmproto.BlockVerifyResponse, error)
- func (vm *VMServer) BuildBlock(_ context.Context, _ *vmproto.BuildBlockRequest) (*vmproto.BuildBlockResponse, error)
- func (vm *VMServer) CreateHandlers(_ context.Context, req *vmproto.CreateHandlersRequest) (*vmproto.CreateHandlersResponse, error)
- func (vm *VMServer) GetBlock(_ context.Context, req *vmproto.GetBlockRequest) (*vmproto.GetBlockResponse, error)
- func (vm *VMServer) Initialize(_ context.Context, req *vmproto.InitializeRequest) (*vmproto.InitializeResponse, error)
- func (vm *VMServer) LastAccepted(_ context.Context, _ *vmproto.LastAcceptedRequest) (*vmproto.LastAcceptedResponse, error)
- func (vm *VMServer) ParseBlock(_ context.Context, req *vmproto.ParseBlockRequest) (*vmproto.ParseBlockResponse, error)
- func (vm *VMServer) SetPreference(_ context.Context, req *vmproto.SetPreferenceRequest) (*vmproto.SetPreferenceResponse, error)
- func (vm *VMServer) Shutdown(_ context.Context, _ *vmproto.ShutdownRequest) (*vmproto.ShutdownResponse, error)
Constants ¶
This section is empty.
Variables ¶
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "VM_PLUGIN",
MagicCookieValue: "dynamic",
}
Handshake is a common handshake that is shared by plugin and host.
var PluginMap = map[string]plugin.Plugin{ "vm": &Plugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type BlockClient ¶
type BlockClient struct {
// contains filtered or unexported fields
}
BlockClient is an implementation of Block that talks over RPC.
type Plugin ¶
type Plugin struct { plugin.NetRPCUnsupportedPlugin // contains filtered or unexported fields }
Plugin is the implementation of plugin.Plugin so we can serve/consume this. We also implement GRPCPlugin so that this plugin can be served over gRPC.
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient ...
type VMClient ¶
type VMClient struct {
// contains filtered or unexported fields
}
VMClient is an implementation of VM that talks over RPC.
func (*VMClient) BuildBlock ¶
BuildBlock ...
func (*VMClient) CreateHandlers ¶
func (vm *VMClient) CreateHandlers() map[string]*common.HTTPHandler
CreateHandlers ...
func (*VMClient) Initialize ¶
func (vm *VMClient) Initialize( ctx *snow.Context, db database.Database, genesisBytes []byte, toEngine chan<- common.Message, fxs []*common.Fx, ) error
Initialize ...
func (*VMClient) ParseBlock ¶
ParseBlock ...
type VMServer ¶
type VMServer struct {
// contains filtered or unexported fields
}
VMServer is a VM that is managed over RPC.
func (*VMServer) BlockAccept ¶
func (vm *VMServer) BlockAccept(_ context.Context, req *vmproto.BlockAcceptRequest) (*vmproto.BlockAcceptResponse, error)
BlockAccept ...
func (*VMServer) BlockReject ¶
func (vm *VMServer) BlockReject(_ context.Context, req *vmproto.BlockRejectRequest) (*vmproto.BlockRejectResponse, error)
BlockReject ...
func (*VMServer) BlockVerify ¶
func (vm *VMServer) BlockVerify(_ context.Context, req *vmproto.BlockVerifyRequest) (*vmproto.BlockVerifyResponse, error)
BlockVerify ...
func (*VMServer) BuildBlock ¶
func (vm *VMServer) BuildBlock(_ context.Context, _ *vmproto.BuildBlockRequest) (*vmproto.BuildBlockResponse, error)
BuildBlock ...
func (*VMServer) CreateHandlers ¶
func (vm *VMServer) CreateHandlers(_ context.Context, req *vmproto.CreateHandlersRequest) (*vmproto.CreateHandlersResponse, error)
CreateHandlers ...
func (*VMServer) GetBlock ¶
func (vm *VMServer) GetBlock(_ context.Context, req *vmproto.GetBlockRequest) (*vmproto.GetBlockResponse, error)
GetBlock ...
func (*VMServer) Initialize ¶
func (vm *VMServer) Initialize(_ context.Context, req *vmproto.InitializeRequest) (*vmproto.InitializeResponse, error)
Initialize ...
func (*VMServer) LastAccepted ¶
func (vm *VMServer) LastAccepted(_ context.Context, _ *vmproto.LastAcceptedRequest) (*vmproto.LastAcceptedResponse, error)
LastAccepted ...
func (*VMServer) ParseBlock ¶
func (vm *VMServer) ParseBlock(_ context.Context, req *vmproto.ParseBlockRequest) (*vmproto.ParseBlockResponse, error)
ParseBlock ...
func (*VMServer) SetPreference ¶
func (vm *VMServer) SetPreference(_ context.Context, req *vmproto.SetPreferenceRequest) (*vmproto.SetPreferenceResponse, error)
SetPreference ...
func (*VMServer) Shutdown ¶
func (vm *VMServer) Shutdown(_ context.Context, _ *vmproto.ShutdownRequest) (*vmproto.ShutdownResponse, error)
Shutdown ...