Documentation
¶
Index ¶
- type Config
- type Nebula
- func (n *Nebula[V]) GetCommittedVertices() []V
- func (n *Nebula[V]) GetFrontier() []V
- func (n *Nebula[V]) IsFinalized(vertex V) bool
- func (n *Nebula[V]) OnObserve(ctx context.Context, vertex V)
- func (n *Nebula[V]) ProposeVertex(ctx context.Context, parents []V) (V, error)
- func (n *Nebula[V]) Start(ctx context.Context) error
- func (n *Nebula[V]) Stop(ctx context.Context) error
- func (n *Nebula[V]) Tick(ctx context.Context) error
- type VID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
PollSize int // sample size for voting
Alpha float64 // threshold ratio
Beta uint32 // confidence threshold
RoundTO time.Duration // round timeout
GenesisSet []byte // genesis vertex set
}
Config holds configuration for Nebula consensus mode
type Nebula ¶
type Nebula[V VID] struct { // contains filtered or unexported fields }
Nebula implements DAG consensus using the internal Field engine
func NewNebula ¶
func NewNebula[V VID](cfg Config, cut prism.Cut[V], tx wave.Transport[V], store field.Store[V], prop field.Proposer[V], com field.Committer[V]) *Nebula[V]
NewNebula creates a new Nebula instance with Field engine
func (*Nebula[V]) GetCommittedVertices ¶
func (n *Nebula[V]) GetCommittedVertices() []V
GetCommittedVertices returns vertices that have been committed in order
func (*Nebula[V]) GetFrontier ¶
func (n *Nebula[V]) GetFrontier() []V
GetFrontier returns the current DAG frontier (tips)
func (*Nebula[V]) IsFinalized ¶
IsFinalized checks if a vertex is finalized in the DAG
func (*Nebula[V]) OnObserve ¶
OnObserve should be called when observing new vertices from the network
func (*Nebula[V]) ProposeVertex ¶
ProposeVertex proposes a new vertex to the DAG
Click to show internal directories.
Click to hide internal directories.