Documentation
¶
Index ¶
- type Callbacks
- type Config
- type LongSender
- func (l *LongSender) GetStats() (sent, failed int64, tps float64)
- func (l *LongSender) Run(ctx context.Context, keys []*ecdsa.PrivateKey, initialNonces []uint64) (*Result, error)
- func (l *LongSender) WithCallbacks(callbacks *Callbacks) *LongSender
- func (l *LongSender) WithGasLimit(gasLimit uint64) *LongSender
- func (l *LongSender) WithGasPrice(gasPrice *big.Int) *LongSender
- type Result
- type SendClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
OnSent func(hash common.Hash)
OnFailed func(err error)
OnTPS func(currentTPS float64)
OnMetrics func(sent, failed int64, tps float64)
}
Callbacks for metrics integration
type Config ¶
type Config struct {
Duration time.Duration // Total test duration (0 = run until canceled)
TPS float64 // Target transactions per second
Burst int // Rate limiter burst size
Workers int // Number of concurrent workers
}
Config holds configuration for the LongSender
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default LongSender configuration
type LongSender ¶
type LongSender struct {
// contains filtered or unexported fields
}
LongSender provides duration-based continuous transaction sending
func New ¶
func New(client SendClient, config *Config) *LongSender
New creates a new LongSender instance
func (*LongSender) GetStats ¶
func (l *LongSender) GetStats() (sent, failed int64, tps float64)
GetStats returns current statistics
func (*LongSender) Run ¶
func (l *LongSender) Run(ctx context.Context, keys []*ecdsa.PrivateKey, initialNonces []uint64) (*Result, error)
Run executes the long sender with the given keys and initial nonces
func (*LongSender) WithCallbacks ¶
func (l *LongSender) WithCallbacks(callbacks *Callbacks) *LongSender
WithCallbacks sets the callbacks for metrics integration
func (*LongSender) WithGasLimit ¶
func (l *LongSender) WithGasLimit(gasLimit uint64) *LongSender
WithGasLimit sets the gas limit for transactions
func (*LongSender) WithGasPrice ¶
func (l *LongSender) WithGasPrice(gasPrice *big.Int) *LongSender
WithGasPrice sets the gas price for transactions
type Result ¶
type Result struct {
TotalSent int64
TotalFailed int64
TotalDuration time.Duration
AverageTPS float64
ActualTPS float64
Errors []error
}
Result holds the results of a long sender run
type SendClient ¶
type SendClient interface {
// SendTransaction sends a signed transaction to the network
SendTransaction(ctx context.Context, tx *types.Transaction) error
// PendingNonceAt returns the pending nonce for an account
PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
// SuggestGasPrice suggests a gas price
SuggestGasPrice(ctx context.Context) (*big.Int, error)
// ChainID returns the chain ID
ChainID(ctx context.Context) (*big.Int, error)
}
SendClient defines the interface for sending transactions
Click to show internal directories.
Click to hide internal directories.