load

package
v0.0.0-...-9e22ca1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: GPL-3.0, LGPL-3.0 Imports: 21 Imported by: 0

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

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

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

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

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

func (*Loader[T]) ConfirmReachedTip

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

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