interfaces

package
v1.22.41 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package interfaces provides consensus engine interfaces.

Index

Constants

View Source
const (
	Unknown       = vm.Unknown
	Starting      = vm.Starting
	Syncing       = vm.Syncing
	Bootstrapping = vm.Bootstrapping
	Ready         = vm.Ready
	Degraded      = vm.Degraded
	Stopping      = vm.Stopping
	Stopped       = vm.Stopped
)

Re-export State constants from vm package

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Start(context.Context, uint32) error
	Stop(context.Context) error
	HealthCheck(context.Context) (interface{}, error)
	IsBootstrapped() bool
}

Engine defines the consensus engine interface

type State added in v1.22.31

type State = vm.State

State is an alias to vm.State

type VM

type VM interface {
	// Initialize initializes this VM
	Initialize(
		ctx context.Context,
		chainCtx interface{},
		dbMgr interface{},
		genesisBytes []byte,
		upgradeBytes []byte,
		configBytes []byte,
		toEngine interface{},
		fxs []interface{},
		appSender interface{},
	) error

	// Shutdown is called when the node is shutting down
	Shutdown(context.Context) error

	// CreateHandlers returns HTTP handlers for this VM
	CreateHandlers(context.Context) (map[string]http.Handler, error)

	// CreateStaticHandlers returns static HTTP handlers for this VM
	CreateStaticHandlers(context.Context) (map[string]http.Handler, error)

	// HealthCheck returns the health of this VM
	HealthCheck(context.Context) (interface{}, error)

	// SetState sets the state of this VM
	SetState(context.Context, State) error

	// Version returns the version of this VM
	Version(context.Context) (string, error)
}

VM defines the common VM interface for consensus engines

Jump to

Keyboard shortcuts

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