load

package
v0.6.4-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0, LGPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MetricsEndpoint = "/metrics" // Endpoint for the Prometheus Metrics Server
)

Variables

This section is empty.

Functions

func DistributeFunds

func DistributeFunds(ctx context.Context, client ethclient.Client, keys []*key.Key, numKeys int, minFundsPerAddr *big.Int, m *metrics.Metrics) ([]*key.Key, error)

DistributeFunds ensures that each address in keys has at least [minFundsPerAddr] by sending funds from the key with the highest starting balance. This function returns a set of at least [numKeys] keys, each having a minimum balance [minFundsPerAddr].

func ExecuteLoader

func ExecuteLoader(ctx context.Context, config config.Config) error

ExecuteLoader creates txSequences from config and has txAgents execute the specified simulation.

func NewSingleAddressTxWorker added in v0.5.2

func NewSingleAddressTxWorker(ctx context.Context, client ethclient.Client, address common.Address) *ethereumTxWorker

NewSingleAddressTxWorker creates and returns a new ethereumTxWorker that confirms transactions by checking the latest nonce of [address] and assuming any transaction with a lower nonce was already accepted.

func NewTxReceiptWorker added in v0.5.10

func NewTxReceiptWorker(ctx context.Context, client ethclient.Client) *ethereumTxWorker

NewTxReceiptWorker creates and returns a new ethereumTxWorker that confirms transactions by checking for the corresponding transaction receipt.

Types

type Loader added in v0.5.10

type Loader[T txs.THash] struct {
	// contains filtered or unexported fields
}

Loader executes a series of worker/tx sequence pairs. Each worker/txSequence pair issues [batchSize] transactions, confirms all of them as accepted, and then moves to the next batch until the txSequence is exhausted.

func New added in v0.5.10

func New[T txs.THash](
	clients []txs.Worker[T],
	txSequences []txs.TxSequence[T],
	batchSize uint64,
	metrics *metrics.Metrics,
) *Loader[T]

func (*Loader[T]) ConfirmReachedTip added in v0.5.10

func (l *Loader[T]) ConfirmReachedTip(ctx context.Context) error

ConfirmReachedTip finds the max height any client has reached and then ensures every client reaches at least that height.

This allows the network to continue to roll forward and creates a synchronization point to ensure that every client in the loader has reached at least the max height observed of any client at the time this function was called.

func (*Loader[T]) Execute added in v0.5.10

func (l *Loader[T]) Execute(ctx context.Context) error

Jump to

Keyboard shortcuts

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