spammer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvgSpamMetricsCaller

func AvgSpamMetricsCaller(handler interface{}, params ...interface{})

AvgSpamMetricsCaller is used to signal new AvgSpamMetrics.

func SpamStatsCaller

func SpamStatsCaller(handler interface{}, params ...interface{})

SpamStatsCaller is used to signal new SpamStats.

Types

type AvgSpamMetrics

type AvgSpamMetrics struct {
	NewMessages              uint32  `json:"newMsgs"`
	AverageMessagesPerSecond float32 `json:"avgMsgs"`
}

AvgSpamMetrics are average metrics of the created spam.

type SendMessageFunc added in v1.0.0

type SendMessageFunc = func(msg *storage.Message) error

SendMessageFunc is a function which sends a message to the network.

type SpamStats

type SpamStats struct {
	Tipselection float32 `json:"tipselect"`
	ProofOfWork  float32 `json:"pow"`
}

SpamStats are stats for a single spam message.

type Spammer

type Spammer struct {
	// contains filtered or unexported fields
}

Spammer is used to issue messages to the IOTA network to create load on the tangle.

func New

func New(networkID uint64, message string, index string, indexSemiLazy string, tipselFunc SpammerTipselFunc, powHandler *pow.Handler, sendMessageFunc SendMessageFunc, serverMetrics *metrics.ServerMetrics) *Spammer

New creates a new spammer instance.

func (*Spammer) DoSpam

func (s *Spammer) DoSpam(ctx context.Context) (time.Duration, time.Duration, error)

type SpammerEvents

type SpammerEvents struct {
	// Fired when a single spam message is issued.
	SpamPerformed *events.Event
	// Fired when average spam metrics were updated by the worker.
	AvgSpamMetricsUpdated *events.Event
}

SpammerEvents are the events issued by the spammer.

type SpammerTipselFunc

type SpammerTipselFunc = func() (isSemiLazy bool, tips hornet.MessageIDs, err error)

SpammerTipselFunc selects tips for the spammer.

Jump to

Keyboard shortcuts

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