nova

package
v1.22.11 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: BSD-3-Clause Imports: 5 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 {
	SampleSize  int           // k parameter for sampling
	Alpha       float64       // threshold ratio
	Beta        uint32        // confidence threshold
	RoundTO     time.Duration // round timeout
	GenesisHash [32]byte      // genesis block hash
}

Config holds configuration for Nova consensus mode

type Nova

type Nova[T comparable] struct {
	// contains filtered or unexported fields
}

Nova implements linear blockchain consensus using the internal Ray engine

func NewNova

func NewNova[T comparable](cfg Config, cut prism.Cut[T], tx wave.Transport[T], source ray.Source[T], sink ray.Sink[T]) *Nova[T]

NewNova creates a new Nova instance with Ray engine

func (*Nova[T]) GetPreference

func (n *Nova[T]) GetPreference() (T, bool)

GetPreference returns the current preferred block

func (*Nova[T]) Height

func (n *Nova[T]) Height() uint64

Height returns the current blockchain height

func (*Nova[T]) IsFinalized

func (n *Nova[T]) IsFinalized(block T) bool

IsFinalized checks if a block is finalized

func (*Nova[T]) ProposeBlock

func (n *Nova[T]) ProposeBlock(ctx context.Context, block T) error

ProposeBlock proposes a new block for the current height

func (*Nova[T]) Start

func (n *Nova[T]) Start(ctx context.Context) error

Start begins Nova consensus operation

func (*Nova[T]) Stop

func (n *Nova[T]) Stop(ctx context.Context) error

Stop ends Nova consensus operation

func (*Nova[T]) Tick

func (n *Nova[T]) Tick(ctx context.Context) error

Tick performs one consensus round for linear chain progression

Jump to

Keyboard shortcuts

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