factories

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// UseQuasar enables the Quasar unified engine.
	UseQuasar bool

	// UseLegacy enables legacy Snowman/Avalanche engines.
	UseLegacy bool
}

Config configures which consensus engine to use.

type Factory

type Factory interface {
	// NewDAG creates a new DAG consensus engine.
	NewDAG(ctx *core.Context, vm interface{}) dag.Engine

	// NewLinear creates a new linear consensus engine.
	NewLinear(ctx *core.Context, vm interface{}) chain.Engine
}

Factory is the main consensus engine factory.

func New

func New(config Config) Factory

New creates a consensus factory based on config.

type QuasarFactory

type QuasarFactory struct{}

QuasarFactory creates Quasar consensus engines.

func NewQuasarFactory

func NewQuasarFactory() *QuasarFactory

NewQuasarFactory creates a new Quasar factory.

func (*QuasarFactory) NewDAG

func (f *QuasarFactory) NewDAG(ctx *core.Context, vm interface{}) dag.Engine

NewDAG creates a new DAG consensus engine using Quasar.

func (*QuasarFactory) NewLinear

func (f *QuasarFactory) NewLinear(ctx *core.Context, vm interface{}) chain.Engine

NewLinear creates a new linear consensus engine using Quasar.

Jump to

Keyboard shortcuts

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