Documentation
¶
Index ¶
- Variables
- type Account
- type AccountPool
- func (ap *AccountPool) Add(ctx context.Context, privateKey *ecdsa.PrivateKey, startNonce *uint64) error
- func (ap *AccountPool) AddN(ctx context.Context, privateKeys ...*ecdsa.PrivateKey) error
- func (ap *AccountPool) AddRandom(ctx context.Context) error
- func (ap *AccountPool) AddRandomN(ctx context.Context, n uint64) error
- func (ap *AccountPool) AddReusableNonce(ctx context.Context, address common.Address, nonce uint64) error
- func (ap *AccountPool) AllAccountsReady() (bool, int, int)
- func (ap *AccountPool) FundAccounts(ctx context.Context) error
- func (ap *AccountPool) Next(ctx context.Context) (Account, error)
- func (ap *AccountPool) Nonces(ctx context.Context, onlyUsed bool) *sync.Map
- func (ap *AccountPool) NoncesOf(address common.Address) (startNonce, nonce uint64)
- func (ap *AccountPool) NumberOfPendingTxs(ctx context.Context) (uint64, error)
- func (ap *AccountPool) RefreshNonce(ctx context.Context, address common.Address) error
- func (ap *AccountPool) ReturnFunds(ctx context.Context) error
- type BlobCommitment
- type IndexedActivity
- type Latency
- type Summary
- type SummaryOutput
Constants ¶
This section is empty.
Variables ¶
var LoadtestCmd = &cobra.Command{ Use: "loadtest", Short: "Run a generic load test against an Eth/EVM style JSON-RPC endpoint.", Long: loadTestUsage, Args: cobra.NoArgs, PersistentPreRun: func(cmd *cobra.Command, args []string) { rpcUrl := flag_loader.GetRpcUrlFlagValue(cmd) privateKey := flag_loader.GetPrivateKeyFlagValue(cmd) if rpcUrl != nil { inputLoadTestParams.RPCUrl = *rpcUrl } if privateKey != nil { inputLoadTestParams.PrivateKey = *privateKey } }, PreRunE: func(cmd *cobra.Command, args []string) error { zerolog.DurationFieldUnit = time.Second zerolog.DurationFieldInteger = true return checkLoadtestFlags() }, RunE: func(cmd *cobra.Command, args []string) error { return runLoadTest(cmd.Context()) }, }
LoadtestCmd represents the loadtest command
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.1.80
type Account struct {
// contains filtered or unexported fields
}
Structure used by the account pool to control the current state of an account
func (*Account) PrivateKey ¶ added in v0.1.80
func (a *Account) PrivateKey(ctx context.Context) *ecdsa.PrivateKey
Returns the private key of the account
type AccountPool ¶ added in v0.1.80
type AccountPool struct {
// contains filtered or unexported fields
}
Structure to control accounts used by the tests
func NewAccountPool ¶ added in v0.1.80
func NewAccountPool(ctx context.Context, client *ethclient.Client, fundingPrivateKey *ecdsa.PrivateKey, fundingAmount *big.Int, rateLimit float64) (*AccountPool, error)
Creates a new account pool with the given funding private key. The funding private key is used to fund the accounts in the pool. The funding amount is the amount of ether to send to each account. The client is used to interact with the network to get account information and also to send transactions to fund accounts.
func (*AccountPool) Add ¶ added in v0.1.80
func (ap *AccountPool) Add(ctx context.Context, privateKey *ecdsa.PrivateKey, startNonce *uint64) error
Adds an account to the pool with the given private key
func (*AccountPool) AddN ¶ added in v0.1.80
func (ap *AccountPool) AddN(ctx context.Context, privateKeys ...*ecdsa.PrivateKey) error
Adds multiple accounts to the pool with the given private keys
func (*AccountPool) AddRandom ¶ added in v0.1.80
func (ap *AccountPool) AddRandom(ctx context.Context) error
Adds a random account to the pool
func (*AccountPool) AddRandomN ¶ added in v0.1.80
func (ap *AccountPool) AddRandomN(ctx context.Context, n uint64) error
Adds N random accounts to the pool
func (*AccountPool) AddReusableNonce ¶ added in v0.1.80
func (ap *AccountPool) AddReusableNonce(ctx context.Context, address common.Address, nonce uint64) error
Adds a reusable nonce to the account with the given address
func (*AccountPool) AllAccountsReady ¶ added in v0.1.90
func (ap *AccountPool) AllAccountsReady() (bool, int, int)
func (*AccountPool) FundAccounts ¶ added in v0.1.80
func (ap *AccountPool) FundAccounts(ctx context.Context) error
Funds all accounts in the pool
func (*AccountPool) Next ¶ added in v0.1.80
func (ap *AccountPool) Next(ctx context.Context) (Account, error)
Returns the next account in the pool
func (*AccountPool) NoncesOf ¶ added in v0.1.80
func (ap *AccountPool) NoncesOf(address common.Address) (startNonce, nonce uint64)
func (*AccountPool) NumberOfPendingTxs ¶ added in v0.1.80
func (ap *AccountPool) NumberOfPendingTxs(ctx context.Context) (uint64, error)
NumberOfPendingTxs returns the difference between the internal nonce and the network pending nonce for all accounts in the pool. It uses caching to avoid making too many requests to the network.
func (*AccountPool) RefreshNonce ¶ added in v0.1.80
Refreshes the nonce for the given address
func (*AccountPool) ReturnFunds ¶ added in v0.1.80
func (ap *AccountPool) ReturnFunds(ctx context.Context) error
type BlobCommitment ¶
type IndexedActivity ¶
type IndexedActivity struct {
BlockNumbers []string
TransactionIDs []string
BlockIDs []string
Addresses []string
ERC20Addresses []string
ERC721Addresses []string
Contracts []string
BlockNumber uint64
Transactions []rpctypes.PolyTransaction
}
IndexedActivity is used to hold a bunch of values for testing an RPC