spammer

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 19 Imported by: 4

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 {
	New              uint32  `json:"new"`
	AveragePerSecond float32 `json:"avg"`
}

AvgSpamMetrics are average metrics of the created spam.

type SendBundleFunc

type SendBundleFunc = func(b bundle.Bundle) error

SendBundleFunc is a function which sends a bundle to the network.

type SpamStats

type SpamStats struct {
	GTTA float32 `json:"gtta"`
	POW  float32 `json:"pow"`
}

SpamStats are stats for a single spam transaction/bundle.

type Spammer

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

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

func New

func New(txAddress string, message string, tag string, tagSemiLazy string, tipselFunc SpammerTipselFunc, mwm int, powHandler *pow.Handler, sendBundleFunc SendBundleFunc) *Spammer

New creates a new spammer instance.

func (*Spammer) DoSpam

func (s *Spammer) DoSpam(bundleSize int, valueSpam bool, shutdownSignal <-chan struct{}) (time.Duration, time.Duration, error)

type SpammerEvents

type SpammerEvents struct {
	// Fired when a single spam transaction/bundle 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.Hashes, 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