Documentation
¶
Index ¶
Constants ¶
View Source
const ( DroppingTickDuration = 2 * time.Second HitRate = 10 DelayResponseDuration = 10 * time.Second ViewIDThresholdMin = 10 ViewIDThresholdMax = 100 )
Constants used for attack model.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { AttackEnabled bool ViewIDThreshold uint64 // contains filtered or unexported fields }
Model contains different models of attacking.
func GetInstance ¶
func GetInstance() *Model
GetInstance returns attack model by using singleton pattern.
func (*Model) DelayResponse ¶
func (attack *Model) DelayResponse()
DelayResponse does attack by delaying response.
func (*Model) IncorrectResponse ¶
IncorrectResponse returns if the attack model enable incorrect responding.
func (*Model) NodeKilledByItSelf ¶
func (attack *Model) NodeKilledByItSelf()
NodeKilledByItSelf runs killing itself attack
func (*Model) SetAttackEnabled ¶
SetAttackEnabled sets attack model enabled.
func (*Model) UpdateConsensusReady ¶
UpdateConsensusReady enables an attack type given the current viewID.
Click to show internal directories.
Click to hide internal directories.