localtxgenerator

package
v0.0.0-...-a733917 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalTXGen

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

func New

func New(moduleConfig ModuleConfig, params ModuleParams) *LocalTXGen

func (*LocalTXGen) ApplyEvents

func (gen *LocalTXGen) ApplyEvents(_ context.Context, evts *stdtypes.EventList) error

ApplyEvents returns an error on any event it receives, except fot the Init event, which it silently ignores.

func (*LocalTXGen) ApplyTXs

func (gen *LocalTXGen) ApplyTXs(txs []*trantorpbtypes.Transaction) error

func (*LocalTXGen) Checkpoint

func (gen *LocalTXGen) Checkpoint(_ *checkpoint.StableCheckpoint) error

func (*LocalTXGen) EventsOut

func (gen *LocalTXGen) EventsOut() <-chan *stdtypes.EventList

EventsOut returns the channel to which LocalTXGen writes all output events (in this case just NewRequests events).

func (*LocalTXGen) ImplementsModule

func (gen *LocalTXGen) ImplementsModule()

func (*LocalTXGen) RestoreState

func (gen *LocalTXGen) RestoreState(_ *checkpoint.StableCheckpoint) error

func (*LocalTXGen) Snapshot

func (gen *LocalTXGen) Snapshot() ([]byte, error)

func (*LocalTXGen) Start

func (gen *LocalTXGen) Start()

Start starts generating transactions at the defined rate.

func (*LocalTXGen) Stop

func (gen *LocalTXGen) Stop()

Stop stops the transaction generation and waits until the internal transaction generation thread stops. A call to Stop without a prior call to Start blocks until Start is called (immediately receiving the stop signal). Note that, in such a case, the calls to Start and Stop will inevitably be concurrent, and some transactions might be submitted before Stop returns. After Stop returns, however, no transactions will be output.

func (*LocalTXGen) TrackStats

func (gen *LocalTXGen) TrackStats(tracker stats.Tracker)

type ModuleConfig

type ModuleConfig struct {
	Mempool stdtypes.ModuleID
}

func DefaultModuleConfig

func DefaultModuleConfig() ModuleConfig

type ModuleParams

type ModuleParams struct {
	ClientID    tt.ClientID
	PayloadSize int `json:",string"`
	NumClients  int `json:",string"`
}

func DefaultModuleParams

func DefaultModuleParams(clientID tt.ClientID) ModuleParams

Jump to

Keyboard shortcuts

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