mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
58 lines
1.4 KiB
Go
58 lines
1.4 KiB
Go
package consensus
|
|
|
|
import (
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
// Fx represents a feature extension
|
|
type Fx interface {
|
|
Initialize(interface{}) error
|
|
}
|
|
|
|
// State represents consensus state
|
|
type State interface {
|
|
GetTimestamp() int64
|
|
SetTimestamp(int64)
|
|
}
|
|
|
|
// AcceptorGroup manages a group of acceptors
|
|
type AcceptorGroup interface {
|
|
RegisterAcceptor(chainID ids.ID, acceptorName string, acceptor Acceptor, dieOnError bool) error
|
|
DeregisterAcceptor(chainID ids.ID, acceptorName string) error
|
|
}
|
|
|
|
// acceptorGroupImpl implements AcceptorGroup
|
|
type acceptorGroupImpl struct {
|
|
// Add fields as needed
|
|
}
|
|
|
|
// NewAcceptorGroup creates a new acceptor group
|
|
func NewAcceptorGroup() AcceptorGroup {
|
|
return &acceptorGroupImpl{}
|
|
}
|
|
|
|
// RegisterAcceptor registers an acceptor
|
|
func (a *acceptorGroupImpl) RegisterAcceptor(chainID ids.ID, acceptorName string, acceptor Acceptor, dieOnError bool) error {
|
|
return nil
|
|
}
|
|
|
|
// DeregisterAcceptor deregisters an acceptor
|
|
func (a *acceptorGroupImpl) DeregisterAcceptor(chainID ids.ID, acceptorName string) error {
|
|
return nil
|
|
}
|
|
|
|
// QuantumIDs contains various quantum network and chain IDs
|
|
type QuantumIDs struct {
|
|
// QuantumID is the root quantum network identifier
|
|
QuantumID uint32
|
|
NodeID ids.NodeID
|
|
// NetID identifies networks within the quantum network
|
|
NetID ids.ID
|
|
ChainID ids.ID
|
|
// P-Chain is the quantum validation chain
|
|
PChainID ids.ID
|
|
XChainID ids.ID
|
|
CChainID ids.ID
|
|
AVAXAssetID ids.ID
|
|
}
|