Versions in this module Expand all Collapse all v0 v0.1.3 Oct 3, 2023 v0.1.2 Oct 3, 2023 Changes in this version + var DefaultSpamDetails = &SpamDetails v0.1.1 Oct 1, 2023 v0.1.0 Sep 29, 2023 Changes in this version + var ErrFailGetReferences = errors.New("failed to get references") + var ErrFailPostTransaction = errors.New("failed to post transaction") + var ErrFailPrepareBlock = errors.New("failed to prepare block") + var ErrFailSendDataBlock = errors.New("failed to send a data block") + var ErrFailToPrepareBatch = errors.New("custom conflict batch could not be prepared") + var ErrInputsNotSolid = errors.New("not all inputs are solid") + var ErrInsufficientClients = errors.New("insufficient clients to send conflicts") + var ErrTransactionIsNil = errors.New("provided transaction is nil") + func BigWalletsNeeded(rate int, timeUnit, duration time.Duration) int + func CommitmentsSpammingFunction(s *Spammer) + func CustomConflictSpammingFunc(s *Spammer) + func DataSpammingFunction(s *Spammer) + type ClockSync struct + LatestCommittedSlotClock *SlotClock + func NewClockSync(slotDuration time.Duration, syncInterval time.Duration, ...) *ClockSync + func (c *ClockSync) Shutdown() + func (c *ClockSync) Start() + func (c *ClockSync) Synchronize() + type CommitmentManager struct + Params *CommitmentManagerParams + func NewCommitmentManager() *CommitmentManager + func (c *CommitmentManager) GenerateCommitment(clt evilwallet.Client) (*commitment.Commitment, slot.Index, error) + func (c *CommitmentManager) SetCommitmentType(commitmentType string) + func (c *CommitmentManager) SetForkAfter(forkAfter int) + func (c *CommitmentManager) Setup(l Logger) + func (c *CommitmentManager) Shutdown() + type CommitmentManagerParams struct + ClockResyncTime time.Duration + CommitmentType string + GenesisTime time.Time + OptionalForkAfter int + ParentRefsCount int + SlotDuration time.Duration + ValidClientURL string + type CommitmentSpamDetails struct + CommitmentType string + type ErrorCounter struct + func NewErrorCount() *ErrorCounter + func (e *ErrorCounter) CountError(err error) + func (e *ErrorCounter) GetErrorsSummary() string + func (e *ErrorCounter) GetTotalErrorCount() int64 + type IdentityManager struct + func NewIdentityManager() *IdentityManager + func (i *IdentityManager) AddIdentity(privateKey, aliasName string) + func (i *IdentityManager) GetIdentity() *identity.LocalIdentity + func (i *IdentityManager) SetLogger(log Logger) + type Logger interface + Debug func(args ...interface{}) + Debugf func(template string, args ...interface{}) + Error func(args ...interface{}) + Errorf func(template string, args ...interface{}) + Info func(args ...interface{}) + Infof func(template string, args ...interface{}) + Warn func(args ...interface{}) + Warnf func(template string, args ...interface{}) + type Options func(*Spammer) + func WithBatchesSent(maxBatchesSent int) Options + func WithClientURL(clientURL string) Options + func WithCommitmentType(commitmentType string) Options + func WithErrorCounter(errCounter *ErrorCounter) Options + func WithEvilScenario(scenario *evilwallet.EvilScenario) Options + func WithEvilWallet(initWallets *evilwallet.EvilWallet) Options + func WithForkAfter(forkingAfter int) Options + func WithIdentity(alias, privateKey string) Options + func WithLogTickerInterval(interval time.Duration) Options + func WithNumberOfSpends(n int) Options + func WithRateSetter(enable bool) Options + func WithSpamDuration(maxDuration time.Duration) Options + func WithSpamRate(rate int, timeUnit time.Duration) Options + func WithSpammingFunc(spammerFunc func(s *Spammer)) Options + func WithTimeDelayForDoubleSpend(timeDelay time.Duration) Options + func WithValidClientURL(validClient string) Options + type SlotClock struct + func (c *SlotClock) Get() slot.Index + func (c *SlotClock) GetRelative() slot.Index + func (c *SlotClock) Update(value slot.Index) + type SpamDetails struct + MaxBatchesSent int + MaxDuration time.Duration + Rate int + TimeUnit time.Duration + type SpamType int + const SpamCommitments + const SpamEvilWallet + type Spammer struct + Clients evilwallet.Connector + CommitmentManager *CommitmentManager + ErrCounter *ErrorCounter + EvilScenario *evilwallet.EvilScenario + EvilWallet *evilwallet.EvilWallet + IdentityManager *IdentityManager + NumberOfSpends int + SpamDetails *SpamDetails + SpamType SpamType + State *State + TimeDelayBetweenConflicts time.Duration + UseRateSetter bool + func NewSpammer(options ...Options) *Spammer + func (s *Spammer) BatchesPrepared() uint64 + func (s *Spammer) BlocksSent() uint64 + func (s *Spammer) CheckIfAllSent() + func (s *Spammer) PostTransaction(tx *devnetvm.Transaction, clt evilwallet.Client) + func (s *Spammer) Spam() + func (s *Spammer) StopSpamming() + type SpammerFunc func(*Spammer) + type State struct