Documentation
¶
Index ¶
- type Config
- type Nova
- func (n *Nova[T]) GetPreference() (T, bool)
- func (n *Nova[T]) Height() uint64
- func (n *Nova[T]) IsFinalized(block T) bool
- func (n *Nova[T]) ProposeBlock(ctx context.Context, block T) error
- func (n *Nova[T]) Start(ctx context.Context) error
- func (n *Nova[T]) Stop(ctx context.Context) error
- func (n *Nova[T]) Tick(ctx context.Context) error
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 ¶
GetPreference returns the current preferred block
func (*Nova[T]) IsFinalized ¶
IsFinalized checks if a block is finalized
func (*Nova[T]) ProposeBlock ¶
ProposeBlock proposes a new block for the current height
Click to show internal directories.
Click to hide internal directories.