Documentation
¶
Index ¶
Constants ¶
View Source
const ( DecideUndecided = coretypes.DecideUndecided DecideAccept = coretypes.DecideAccept DecideReject = coretypes.DecideReject )
Decision constants re-exported from core/types
View Source
const ( StatusUnknown = choices.Unknown StatusProcessing = choices.Processing StatusRejected = choices.Rejected StatusAccepted = choices.Accepted )
Status constants re-exported from choices
Variables ¶
View Source
var ( // ErrBlockNotFound is returned when a block is not found ErrBlockNotFound = errors.New("block not found") // ErrInvalidBlock is returned when a block is invalid ErrInvalidBlock = errors.New("invalid block") // ErrInvalidVote is returned when a vote is invalid ErrInvalidVote = errors.New("invalid vote") // ErrNoQuorum is returned when there is no quorum ErrNoQuorum = errors.New("no quorum") // ErrAlreadyVoted is returned when a validator has already voted ErrAlreadyVoted = errors.New("already voted") // ErrNotValidator is returned when the node is not a validator ErrNotValidator = errors.New("not a validator") // ErrTimeout is returned when an operation times out ErrTimeout = errors.New("operation timeout") // ErrNotInitialized is returned when the engine is not initialized ErrNotInitialized = errors.New("engine not initialized") )
Common consensus errors
View Source
var GenesisID = ids.Empty
GenesisID is the ID of the genesis block
Functions ¶
This section is empty.
Types ¶
type Block ¶ added in v1.22.0
type Block struct {
ID ID `json:"id"`
ParentID ID `json:"parent_id"`
Height uint64 `json:"height"`
Payload []byte `json:"payload"`
Time time.Time `json:"time"`
}
Block represents a block in the blockchain
type Certificate ¶ added in v1.22.0
type Certificate struct {
BlockID ID `json:"block_id"`
Height uint64 `json:"height"`
Votes []Vote `json:"votes"`
Timestamp time.Time `json:"timestamp"`
Signatures [][]byte `json:"signatures"`
}
Certificate represents a consensus certificate
type Config ¶ added in v1.22.0
type Config struct {
// Consensus parameters
Alpha int `json:"alpha"` // Quorum size
K int `json:"k"` // Sample size
MaxOutstanding int `json:"max_outstanding"` // Max outstanding polls
MaxPollDelay time.Duration `json:"max_poll_delay"` // Max delay between polls
// Network parameters
NetworkTimeout time.Duration `json:"network_timeout"`
MaxMessageSize int `json:"max_message_size"`
// Security parameters
SecurityLevel int `json:"security_level"` // NIST security level
QuantumResistant bool `json:"quantum_resistant"` // Use PQ crypto
GPUAcceleration bool `json:"gpu_acceleration"` // Use GPU acceleration
}
Config represents consensus configuration
func DefaultConfig ¶ added in v1.22.0
func DefaultConfig() Config
DefaultConfig returns default consensus configuration
Click to show internal directories.
Click to hide internal directories.