Help us shape the future of Go! Take the 2026 Go Developer Survey

evm

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0, LGPL-3.0, BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VM

type VM struct {
	IsPlugin bool
}

VM implements the linear-chain ChainVM interface for the C-Chain

func (*VM) BuildBlock

func (vm *VM) BuildBlock(ctx context.Context) (chain.Block, error)

BuildBlock builds a new block

func (*VM) Connected added in v1.16.39

func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error

Connected is called when a new node is connected

func (*VM) Disconnected added in v1.16.39

func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error

Disconnected is called when a node is disconnected

func (*VM) GetBlock

func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (chain.Block, error)

GetBlock returns a block by its ID

func (*VM) GetBlockIDAtHeight added in v0.15.4

func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)

GetBlockIDAtHeight returns the block ID at a specific height

func (*VM) HealthCheck added in v0.15.4

func (vm *VM) HealthCheck(ctx context.Context) (block.HealthCheckResult, error)

HealthCheck returns health status of the VM

func (*VM) Initialize

func (vm *VM) Initialize(
	ctx context.Context,
	init vm.Init,
) error

Initialize implements the linear-chain ChainVM interface

func (*VM) LastAccepted

func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)

LastAccepted returns the ID of the last accepted block

func (*VM) NewHTTPHandler added in v0.15.5

func (vm *VM) NewHTTPHandler(ctx context.Context) (http.Handler, error)

NewHTTPHandler returns the HTTP handlers for the VM

func (*VM) ParseBlock

func (vm *VM) ParseBlock(ctx context.Context, b []byte) (chain.Block, error)

ParseBlock parses a block from bytes

func (*VM) SetPreference

func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error

SetPreference sets the preferred block

func (*VM) SetState added in v0.15.4

func (vm *VM) SetState(ctx context.Context, state uint32) error

SetState sets the VM state

func (*VM) Shutdown

func (vm *VM) Shutdown(ctx context.Context) error

Shutdown shuts down the VM

func (*VM) Version added in v0.15.4

func (vm *VM) Version(ctx context.Context) (string, error)

Version returns the VM version

func (*VM) WaitForEvent added in v0.15.5

func (vm *VM) WaitForEvent(ctx context.Context) (block.Message, error)

WaitForEvent blocks until an event occurs that should trigger block building

Jump to

Keyboard shortcuts

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