mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
- Remove unused packages: engine/dag/{getter,bootstrap,vertex/vertexmock},
engine/pq/{bootstrap,block}, core/{tracker,verify}
- Add sync.RWMutex to protocol/wave for thread-safe map access
- Increase engine/dag test coverage from 11.7% to 98.3%
- Add comprehensive tests for DAG consensus, vertex, and engine
- All 27 packages pass tests, 16 at 100% coverage
43 lines
834 B
Go
43 lines
834 B
Go
package interfaces
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
// Engine defines the consensus engine interface
|
|
type Engine interface {
|
|
// Start starts the engine
|
|
Start(context.Context, uint32) error
|
|
|
|
// Stop stops the engine
|
|
Stop(context.Context) error
|
|
|
|
// HealthCheck performs health check
|
|
HealthCheck(context.Context) (interface{}, error)
|
|
|
|
// IsBootstrapped checks if bootstrapped
|
|
IsBootstrapped() bool
|
|
}
|
|
|
|
// VM defines a virtual machine
|
|
type VM interface {
|
|
// Initialize initializes the VM
|
|
Initialize(context.Context, *VMConfig) error
|
|
|
|
// Shutdown shuts down the VM
|
|
Shutdown(context.Context) error
|
|
|
|
// Version returns VM version
|
|
Version(context.Context) (string, error)
|
|
}
|
|
|
|
// VMConfig defines VM configuration
|
|
type VMConfig struct {
|
|
ChainID ids.ID
|
|
NetworkID uint32
|
|
NodeID ids.NodeID
|
|
PublicKey []byte
|
|
}
|