rpcchainvm

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: BSD-3-Clause Imports: 35 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "VM_PLUGIN",
	MagicCookieValue: "dynamic",
}

Handshake is a common handshake that is shared by plugin and host.

View Source
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.

func (*BlockClient) Accept

func (b *BlockClient) Accept() error

Accept ...

func (*BlockClient) Bytes

func (b *BlockClient) Bytes() []byte

Bytes ...

func (*BlockClient) ID

func (b *BlockClient) ID() ids.ID

ID ...

func (*BlockClient) Parent

func (b *BlockClient) Parent() snowman.Block

Parent ...

func (*BlockClient) Reject

func (b *BlockClient) Reject() error

Reject ...

func (*BlockClient) Status

func (b *BlockClient) Status() choices.Status

Status ...

func (*BlockClient) Verify

func (b *BlockClient) Verify() error

Verify ...

type Factory

type Factory struct{ Path string }

Factory ...

func (*Factory) New

func (f *Factory) New(ctx *snow.Context) (interface{}, error)

New ...

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 New

func New(vm block.ChainVM) *Plugin

New ...

func (*Plugin) GRPCClient

func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient ...

func (*Plugin) GRPCServer

func (p *Plugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer ...

type VMClient

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

VMClient is an implementation of VM that talks over RPC.

func NewClient

func NewClient(client vmproto.VMClient, broker *plugin.GRPCBroker) *VMClient

NewClient returns a database instance connected to a remote database instance

func (*VMClient) Bootstrapped added in v0.5.3

func (vm *VMClient) Bootstrapped() error

Bootstrapped ...

func (*VMClient) Bootstrapping added in v0.5.3

func (vm *VMClient) Bootstrapping() error

Bootstrapping ...

func (*VMClient) BuildBlock

func (vm *VMClient) BuildBlock() (snowman.Block, error)

BuildBlock ...

func (*VMClient) CreateHandlers

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

CreateHandlers ...

func (*VMClient) GetBlock

func (vm *VMClient) GetBlock(id ids.ID) (snowman.Block, error)

GetBlock ...

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) LastAccepted

func (vm *VMClient) LastAccepted() ids.ID

LastAccepted ...

func (*VMClient) ParseBlock

func (vm *VMClient) ParseBlock(bytes []byte) (snowman.Block, error)

ParseBlock ...

func (*VMClient) SetPreference

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

SetPreference ...

func (*VMClient) SetProcess

func (vm *VMClient) SetProcess(proc *plugin.Client)

SetProcess ...

func (*VMClient) Shutdown

func (vm *VMClient) Shutdown() error

Shutdown ...

type VMServer

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

VMServer is a VM that is managed over RPC.

func NewServer

func NewServer(vm block.ChainVM, broker *plugin.GRPCBroker) *VMServer

NewServer returns a vm instance connected to a remote vm instance

func (*VMServer) BlockAccept

BlockAccept ...

func (*VMServer) BlockReject

BlockReject ...

func (*VMServer) BlockVerify

BlockVerify ...

func (*VMServer) Bootstrapped added in v0.5.3

Bootstrapped ...

func (*VMServer) Bootstrapping added in v0.5.3

Bootstrapping ...

func (*VMServer) BuildBlock

BuildBlock ...

func (*VMServer) CreateHandlers

CreateHandlers ...

func (*VMServer) GetBlock

GetBlock ...

func (*VMServer) Initialize

Initialize ...

func (*VMServer) ParseBlock

ParseBlock ...

func (*VMServer) SetPreference

SetPreference ...

func (*VMServer) Shutdown

Shutdown ...

Jump to

Keyboard shortcuts

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