spammer

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EstimateFunc

type EstimateFunc = func() time.Duration

EstimateFunc returns the time estimate required for the block to be issued by the rate setter.

type IssuePayloadFunc

type IssuePayloadFunc = func(payload payload.Payload, parentsCount ...int) (*tangleold.Block, error)

IssuePayloadFunc is a function which issues a payload.

type Spammer

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

Spammer spams blocks with a static data payload.

func New

func New(issuePayloadFunc IssuePayloadFunc, log *logger.Logger, estimateFunc EstimateFunc) *Spammer

New creates a new spammer.

func (*Spammer) Shutdown

func (s *Spammer) Shutdown()

Shutdown shuts down the spammer.

func (*Spammer) Start

func (s *Spammer) Start(rate int, timeUnit time.Duration, imif string)

Start starts the spammer to spam with the given blocks per time unit, according to a inter block issuing function (IMIF)

Jump to

Keyboard shortcuts

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