rpcchainvm

package
v1.7.15-rc.6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: BSD-3-Clause Imports: 56 Imported by: 46

Documentation

Overview

Package rpcchainvm is a generated GoMock package.

Package rpcchainvm is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Handshake is a common handshake that is shared by plugin and host.
	Handshake = plugin.HandshakeConfig{
		ProtocolVersion:  protocolVersion,
		MagicCookieKey:   "VM_PLUGIN",
		MagicCookieValue: "dynamic",
	}

	// PluginMap is the map of plugins we can dispense.
	PluginMap = map[string]plugin.Plugin{
		"vm": &vmPlugin{},
	}
)

Functions

func New

func New(vm block.ChainVM) plugin.Plugin

New will be called by the server side of the plugin to pass into the server side PluginMap for dispatching.

func NewFactory added in v1.7.6

func NewFactory(path string, processTracker resource.ProcessTracker) vms.Factory

func Serve added in v1.7.10

func Serve(vm block.ChainVM)

Serve serves a ChainVM plugin using sane gRPC server defaults.

Types

type MockFactory added in v1.7.6

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

MockFactory is a mock of Factory interface.

func NewMockFactory added in v1.7.6

func NewMockFactory(ctrl *gomock.Controller) *MockFactory

NewMockFactory creates a new mock instance.

func (*MockFactory) EXPECT added in v1.7.6

func (m *MockFactory) EXPECT() *MockFactoryMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFactory) New added in v1.7.6

func (m *MockFactory) New(arg0 *snow.Context) (interface{}, error)

New mocks base method.

type MockFactoryMockRecorder added in v1.7.6

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

MockFactoryMockRecorder is the mock recorder for MockFactory.

func (*MockFactoryMockRecorder) New added in v1.7.6

func (mr *MockFactoryMockRecorder) New(arg0 interface{}) *gomock.Call

New indicates an expected call of New.

type MockPluginDirectory added in v1.7.6

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

MockPluginDirectory is a mock of PluginDirectory interface.

func NewMockPluginDirectory added in v1.7.6

func NewMockPluginDirectory(ctrl *gomock.Controller) *MockPluginDirectory

NewMockPluginDirectory creates a new mock instance.

func (*MockPluginDirectory) EXPECT added in v1.7.6

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPluginDirectory) GetVMs added in v1.7.6

func (m *MockPluginDirectory) GetVMs(manager vms.Manager) (map[ids.ID]vms.Factory, map[ids.ID]vms.Factory, error)

GetVMs mocks base method.

type MockPluginDirectoryMockRecorder added in v1.7.6

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

MockPluginDirectoryMockRecorder is the mock recorder for MockPluginDirectory.

func (*MockPluginDirectoryMockRecorder) GetVMs added in v1.7.6

func (mr *MockPluginDirectoryMockRecorder) GetVMs(manager interface{}) *gomock.Call

GetVMs indicates an expected call of GetVMs.

type VMClient

type VMClient struct {
	*chain.State
	// contains filtered or unexported fields
}

VMClient is an implementation of a VM that talks over RPC.

func NewClient

func NewClient(client vmpb.VMClient) *VMClient

NewClient returns a VM connected to a remote VM

func (*VMClient) AppGossip added in v1.5.3

func (vm *VMClient) AppGossip(nodeID ids.NodeID, msg []byte) error

func (*VMClient) AppRequest added in v1.5.3

func (vm *VMClient) AppRequest(nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte) error

func (*VMClient) AppRequestFailed added in v1.5.3

func (vm *VMClient) AppRequestFailed(nodeID ids.NodeID, requestID uint32) error

func (*VMClient) AppResponse added in v1.5.3

func (vm *VMClient) AppResponse(nodeID ids.NodeID, requestID uint32, response []byte) error

func (*VMClient) BatchedParseBlock added in v1.6.4

func (vm *VMClient) BatchedParseBlock(blksBytes [][]byte) ([]snowman.Block, error)

func (*VMClient) Connected added in v1.4.8

func (vm *VMClient) Connected(nodeID ids.NodeID, nodeVersion *version.Application) error

func (*VMClient) CreateHandlers

func (vm *VMClient) CreateHandlers() (map[string]*common.HTTPHandler, error)

func (*VMClient) CreateStaticHandlers added in v1.4.8

func (vm *VMClient) CreateStaticHandlers() (map[string]*common.HTTPHandler, error)

func (*VMClient) Disconnected added in v1.4.8

func (vm *VMClient) Disconnected(nodeID ids.NodeID) error

func (*VMClient) Gather added in v1.7.0

func (vm *VMClient) Gather() ([]*dto.MetricFamily, error)

func (*VMClient) GetAncestors added in v1.6.4

func (vm *VMClient) GetAncestors(
	blkID ids.ID,
	maxBlocksNum int,
	maxBlocksSize int,
	maxBlocksRetrivalTime time.Duration,
) ([][]byte, error)

func (*VMClient) GetBlockIDAtHeight added in v1.7.5

func (vm *VMClient) GetBlockIDAtHeight(height uint64) (ids.ID, error)

func (*VMClient) GetLastStateSummary added in v1.7.11

func (vm *VMClient) GetLastStateSummary() (block.StateSummary, error)

func (*VMClient) GetOngoingSyncStateSummary added in v1.7.11

func (vm *VMClient) GetOngoingSyncStateSummary() (block.StateSummary, error)

func (*VMClient) GetStateSummary added in v1.7.11

func (vm *VMClient) GetStateSummary(summaryHeight uint64) (block.StateSummary, error)

func (*VMClient) HealthCheck added in v1.2.1

func (vm *VMClient) HealthCheck() (interface{}, error)

func (*VMClient) Initialize

func (vm *VMClient) Initialize(
	ctx *snow.Context,
	dbManager manager.Manager,
	genesisBytes []byte,
	upgradeBytes []byte,
	configBytes []byte,
	toEngine chan<- common.Message,
	fxs []*common.Fx,
	appSender common.AppSender,
) error

func (*VMClient) ParseStateSummary added in v1.7.11

func (vm *VMClient) ParseStateSummary(summaryBytes []byte) (block.StateSummary, error)

func (*VMClient) SetPreference

func (vm *VMClient) SetPreference(id ids.ID) error

func (*VMClient) SetProcess

func (vm *VMClient) SetProcess(ctx *snow.Context, proc *plugin.Client, processTracker resource.ProcessTracker)

SetProcess gives ownership of the server process to the client.

func (*VMClient) SetState added in v1.7.5

func (vm *VMClient) SetState(state snow.State) error

func (*VMClient) Shutdown

func (vm *VMClient) Shutdown() error

func (*VMClient) StateSyncEnabled added in v1.7.11

func (vm *VMClient) StateSyncEnabled() (bool, error)

func (*VMClient) VerifyHeightIndex added in v1.7.5

func (vm *VMClient) VerifyHeightIndex() error

func (*VMClient) Version added in v1.4.10

func (vm *VMClient) Version() (string, error)

type VMServer

type VMServer struct {
	vmpb.UnsafeVMServer
	// contains filtered or unexported fields
}

VMServer is a VM that is managed over RPC.

func NewServer

func NewServer(vm block.ChainVM) *VMServer

NewServer returns a vm instance connected to a remote vm instance

func (*VMServer) AppGossip added in v1.5.3

func (vm *VMServer) AppGossip(_ context.Context, req *vmpb.AppGossipMsg) (*emptypb.Empty, error)

func (*VMServer) AppRequest added in v1.5.3

func (vm *VMServer) AppRequest(_ context.Context, req *vmpb.AppRequestMsg) (*emptypb.Empty, error)

func (*VMServer) AppRequestFailed added in v1.5.3

func (vm *VMServer) AppRequestFailed(_ context.Context, req *vmpb.AppRequestFailedMsg) (*emptypb.Empty, error)

func (*VMServer) AppResponse added in v1.5.3

func (vm *VMServer) AppResponse(_ context.Context, req *vmpb.AppResponseMsg) (*emptypb.Empty, error)

func (*VMServer) BatchedParseBlock added in v1.6.4

func (vm *VMServer) BatchedParseBlock(
	ctx context.Context,
	req *vmpb.BatchedParseBlockRequest,
) (*vmpb.BatchedParseBlockResponse, error)

func (*VMServer) BlockAccept

func (vm *VMServer) BlockAccept(_ context.Context, req *vmpb.BlockAcceptRequest) (*emptypb.Empty, error)

func (*VMServer) BlockReject

func (vm *VMServer) BlockReject(_ context.Context, req *vmpb.BlockRejectRequest) (*emptypb.Empty, error)

func (*VMServer) BlockVerify

func (*VMServer) BuildBlock

func (*VMServer) Connected added in v1.6.4

func (vm *VMServer) Connected(_ context.Context, req *vmpb.ConnectedRequest) (*emptypb.Empty, error)

func (*VMServer) CreateHandlers

func (*VMServer) CreateStaticHandlers added in v1.4.8

func (vm *VMServer) CreateStaticHandlers(context.Context, *emptypb.Empty) (*vmpb.CreateStaticHandlersResponse, error)

func (*VMServer) Disconnected added in v1.6.4

func (vm *VMServer) Disconnected(_ context.Context, req *vmpb.DisconnectedRequest) (*emptypb.Empty, error)

func (*VMServer) Gather added in v1.7.0

func (*VMServer) GetAncestors added in v1.6.4

func (*VMServer) GetBlock

func (*VMServer) GetBlockIDAtHeight added in v1.7.5

func (*VMServer) GetLastStateSummary added in v1.7.11

func (vm *VMServer) GetLastStateSummary(
	ctx context.Context,
	empty *emptypb.Empty,
) (*vmpb.GetLastStateSummaryResponse, error)

func (*VMServer) GetOngoingSyncStateSummary added in v1.7.11

func (vm *VMServer) GetOngoingSyncStateSummary(
	context.Context,
	*emptypb.Empty,
) (*vmpb.GetOngoingSyncStateSummaryResponse, error)

func (*VMServer) GetStateSummary added in v1.7.11

func (vm *VMServer) GetStateSummary(
	ctx context.Context,
	req *vmpb.GetStateSummaryRequest,
) (*vmpb.GetStateSummaryResponse, error)

func (*VMServer) Health added in v1.0.3

func (vm *VMServer) Health(ctx context.Context, req *emptypb.Empty) (*vmpb.HealthResponse, error)

func (*VMServer) Initialize

func (*VMServer) ParseBlock

func (*VMServer) ParseStateSummary added in v1.7.11

func (vm *VMServer) ParseStateSummary(
	ctx context.Context,
	req *vmpb.ParseStateSummaryRequest,
) (*vmpb.ParseStateSummaryResponse, error)

func (*VMServer) SetPreference

func (vm *VMServer) SetPreference(_ context.Context, req *vmpb.SetPreferenceRequest) (*emptypb.Empty, error)

func (*VMServer) SetState added in v1.7.5

func (vm *VMServer) SetState(_ context.Context, stateReq *vmpb.SetStateRequest) (*vmpb.SetStateResponse, error)

func (*VMServer) Shutdown

func (vm *VMServer) Shutdown(context.Context, *emptypb.Empty) (*emptypb.Empty, error)

func (*VMServer) StateSummaryAccept added in v1.7.11

func (*VMServer) StateSyncEnabled added in v1.7.11

func (*VMServer) VerifyHeightIndex added in v1.7.5

func (*VMServer) Version added in v1.4.10

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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