manual

package
v0.0.0-...-24f7fd5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// env variables
	ETH_TX_LIST  = "ETH_TX_LIST"
	ETH_ADDR_LOG = "ETH_ADDR_LOG"
)

Variables

This section is empty.

Functions

func NewTxSpammer

func NewTxSpammer(params []TxParams) shared.Service

Types

type Spammer

type Spammer struct {
	Sender *TxSender
}

func (*Spammer) Loop

func (s *Spammer) Loop(quitChan <-chan bool) (<-chan bool, error)

type TxGenerator

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

TxGenerator generates and signs txs

func NewTxGenerator

func NewTxGenerator(params []TxParams) *TxGenerator

NewTxGenerator creates a new tx generator

func (TxGenerator) GenerateTx

func (gen TxGenerator) GenerateTx(params TxParams) ([]byte, error)

GenerateTx generates tx from the provided params

type TxParams

type TxParams struct {
	// Name of this tx in the .toml file
	Name string

	// HTTP Client for this tx type
	Client *rpc.Client

	// DynamicFeeTx properties - Start
	ChainID   *big.Int
	Nonce     uint64
	GasTipCap *big.Int // a.k.a. maxPriorityFeePerGas
	GasFeeCap *big.Int // a.k.a. maxFeePerGas
	Gas       uint64
	To        *common.Address // nil means contract creation
	Value     *big.Int
	Data      []byte

	// Sender key, if left the senderKeyPath is empty we generate a new key
	SenderKey             *ecdsa.PrivateKey
	StartingNonce         uint64
	ContractAddrWritePath string

	// Sending params
	Sender common.Address
	// How often we send a tx of this type
	Frequency time.Duration
	// Total number of txs of this type to send
	TotalNumber uint64
	// Delay before beginning to send
	Delay time.Duration
}

TxParams holds the parameters for a given transaction

func NewTxParams

func NewTxParams() ([]TxParams, error)

NewTxParams NewConfig returns a new tx spammer config

type TxSender

type TxSender struct {
	TxGen    *TxGenerator
	TxParams []TxParams
}

TxSender type for

func NewTxSender

func NewTxSender(params []TxParams) *TxSender

NewTxSender returns a new tx sender

func (*TxSender) Send

func (s *TxSender) Send(quitChan <-chan bool) (<-chan bool, <-chan error)

Jump to

Keyboard shortcuts

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