Documentation ¶
Index ¶
- Constants
- type CapabilityPoolingAndActivation
- type ClaimType
- type DeviantBitSet
- type FirstPhase
- type NodeBroadcast
- type NodeJoinClaim
- type NodeLeaveClaim
- type NodeListVote
- type NodePulseProof
- type NodeViolationBlame
- type PacketHeader
- type PacketType
- type PhaseManager
- type PulseData
- type PulseDataExt
- type ReferendumClaim
- type ReferendumType
- type ReferendumVote
- type SecondPhase
Constants ¶
View Source
const ( NetworkConsistency = PacketType(iota + 1) Referendum )
View Source
const ( TypeNodeClaim = ClaimType(iota + 1) TypeNodeViolationBlame TypeCapabilityPollingAndActivation TypeNodeBroadcast )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapabilityPoolingAndActivation ¶
type CapabilityPoolingAndActivation struct { PollingFlags uint16 CapabilityType uint16 CapabilityRef uint64 // contains filtered or unexported fields }
CapabilityPoolingAndActivation is a type 3.
func (*CapabilityPoolingAndActivation) Length ¶
func (cpa *CapabilityPoolingAndActivation) Length() uint16
func (*CapabilityPoolingAndActivation) Type ¶
func (cpa *CapabilityPoolingAndActivation) Type() ClaimType
type DeviantBitSet ¶
type FirstPhase ¶
type FirstPhase struct {
// contains filtered or unexported fields
}
FirstPhase is a first phase.
func (*FirstPhase) HandlePulse ¶
func (fp *FirstPhase) HandlePulse(localClaims []ReferendumClaim, data *PulseData) error
type NodeBroadcast ¶
type NodeBroadcast struct { EmergencyLevel uint8 // contains filtered or unexported fields }
NodeBroadcast is a broadcast of info. Must be brief and only one entry per node. Type 4.
func (*NodeBroadcast) Length ¶
func (nb *NodeBroadcast) Length() uint16
func (*NodeBroadcast) Type ¶
func (nb *NodeBroadcast) Type() ClaimType
type NodeJoinClaim ¶
type NodeJoinClaim struct { NodeID uint32 RelayNodeID uint32 ProtocolVersionAndFlags uint32 JoinsAfter uint32 NodeRoleRecID uint32 NodeRef core.RecordRef NodePK ecdsa.PrivateKey // contains filtered or unexported fields }
NodeJoinClaim is a type 1, len == 272.
func NewNodeJoinClaim ¶
func NewNodeJoinClaim() *NodeJoinClaim
func (*NodeJoinClaim) Length ¶
func (njc *NodeJoinClaim) Length() uint16
func (*NodeJoinClaim) Type ¶
func (njc *NodeJoinClaim) Type() ClaimType
type NodeLeaveClaim ¶
type NodeLeaveClaim struct {
// contains filtered or unexported fields
}
NodeLeaveClaim can be the only be issued by the node itself and must be the only claim record. Should be executed with the next pulse. Type 1, len == 0.
func (*NodeLeaveClaim) Length ¶
func (nlc *NodeLeaveClaim) Length() uint16
func (*NodeLeaveClaim) Type ¶
func (nlc *NodeLeaveClaim) Type() ClaimType
type NodeListVote ¶
type NodePulseProof ¶
type NodeViolationBlame ¶
type NodeViolationBlame struct { BlameNodeID uint32 TypeViolation uint8 // contains filtered or unexported fields }
NodeViolationBlame is a type 2.
func NewNodViolationBlame ¶
func NewNodViolationBlame() *NodeViolationBlame
func (*NodeViolationBlame) Length ¶
func (nvb *NodeViolationBlame) Length() uint16
func (*NodeViolationBlame) Type ¶
func (nvb *NodeViolationBlame) Type() ClaimType
type PacketHeader ¶
type PacketType ¶
type PacketType uint8
type PhaseManager ¶
type PhaseManager struct {
// contains filtered or unexported fields
}
func NewPhaseManager ¶
func NewPhaseManager() *PhaseManager
NewPhaseManager creates and returns a new phase manager.
func (*PhaseManager) OnPulse ¶
func (pm *PhaseManager) OnPulse(pulse *PulseData) error
Start starts calculate args on phases.
type PulseData ¶
type PulseData struct { PulseNumer uint32 Data *PulseDataExt }
PulseData is a pulse data.
type PulseDataExt ¶
type PulseDataExt struct { NextPulseDelta uint16 PrevPulseDelta uint16 OriginID uint16 EpochPulseNo uint32 PulseTimestamp uint32 Entropy core.Entropy }
PulseDataExt is a pulse data extension.
type ReferendumClaim ¶
type ReferendumType ¶
type ReferendumType uint8
type ReferendumVote ¶
type ReferendumVote struct { Type ReferendumType Length uint16 }
type SecondPhase ¶
type SecondPhase struct { }
SecondPhase is a second phase.
func (*SecondPhase) Calculate ¶
func (sp *SecondPhase) Calculate(proof []NodePulseProof, claims []ReferendumClaim) error
Click to show internal directories.
Click to hide internal directories.