phases

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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

type ClaimType

type ClaimType uint8

type DeviantBitSet

type DeviantBitSet struct {
	CompressedSet   uint8
	HiBitLengthFlag uint8
	LowBitLength    uint8
	HiBitLength     uint8
	Payload         []byte
}

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 NodeListVote struct {
	NodeListCount uint16
	NodeListHash  uint32
}

type NodePulseProof

type NodePulseProof struct {
	NodeStateHash uint64
	NodeSignature uint64
}

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 PacketHeader struct {
	HasRouting   bool
	F01          bool
	F00          bool
	SubType      uint8
	Pulse        uint32
	OriginNodeID uint32
	TargetNodeID uint32
	PacketT      PacketType
}

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 ReferendumClaim interface {
	Type() ClaimType
	Length() uint16
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL