Documentation ¶
Index ¶
Constants ¶
const ( SPAMMER_STOP_ON_ERROR = "SPAMMER_STOP_ON_ERROR" // env variables ETH_KEY_DIR_PATH = "ETH_KEY_DIR_PATH" ETH_HTTP_PATH = "ETH_HTTP_PATH" ETH_CONTRACT_ADDR_PATH = "ETH_CONTRACT_ADDR_PATH" ETH_DEPLOYMENT_NUMBER = "ETH_DEPLOYMENT_NUMBER" ETH_DEPLOYMENT_BIN_PATH = "ETH_DEPLOYMENT_BIN_PATH" ETH_DEPLOYMENT_GAS_LIMIT = "ETH_DEPLOYMENT_GAS_LIMIT" ETH_DEPLOYMENT_GAS_FEE_CAP = "ETH_DEPLOYMENT_GAS_FEE_CAP" ETH_DEPLOYMENT_GAS_TIP_CAP = "ETH_DEPLOYMENT_GAS_TIP_CAP" ETH_CALL_FREQ = "ETH_CALL_FREQ" ETH_CALL_TOTAL_NUMBER = "ETH_CALL_TOTAL_NUMBER" ETH_CALL_ABI_PATH = "ETH_CALL_ABI_PATH" ETH_CALL_METHOD_NAME = "ETH_CALL_METHOD_NAME" ETH_CALL_GAS_LIMIT = "ETH_CALL_GAS_LIMIT" ETH_CALL_GAS_FEE_CAP = "ETH_CALL_GAS_FEE_CAP" ETH_CALL_GAS_TIP_CAP = "ETH_CALL_GAS_TIP_CAP" ETH_SEND_FREQ = "ETH_SEND_FREQ" ETH_SEND_TOTAL_NUMBER = "ETH_SEND_TOTAL_NUMBER" ETH_SEND_AMOUNT = "ETH_SEND_AMOUNT" ETH_SEND_GAS_LIMIT = "ETH_SEND_GAS_LIMIT" ETH_SEND_GAS_FEE_CAP = "ETH_SEND_GAS_FEE_CAP" ETH_SEND_GAS_TIP_CAP = "ETH_SEND_GAS_TIP_CAP" ETH_BLOBTX_FREQ = "ETH_BLOBTX_FREQ" ETH_BLOBTX_TOTAL_NUMBER = "ETH_BLOBTX_TOTAL_NUMBER" ETH_BLOBTX_AMOUNT = "ETH_BLOBTX_AMOUNT" ETH_BLOBTX_GAS_LIMIT = "ETH_BLOBTX_GAS_LIMIT" ETH_BLOBTX_GAS_FEE_CAP = "ETH_BLOBTX_GAS_FEE_CAP" ETH_BLOBTX_GAS_TIP_CAP = "ETH_BLOBTX_GAS_TIP_CAP" ETH_BLOBTX_BLOB_FEE_CAP = "ETH_BLOBTX_BLOB_FEE_CAP" ETH_BLOBTX_BLOB_COUNT = "ETH_BLOBTX_BLOB_COUNT" // toml bindings SpammerStopOnError = "service.stopOnError" )
Variables ¶
This section is empty.
Functions ¶
func NewTxSpammer ¶
NewTxSpammer creates a new tx spamming service
Types ¶
type BlobParams ¶
type BlobTxConfig ¶
type BlobTxConfig struct { ChainID *big.Int GasLimit uint64 GasFeeCap *big.Int GasTipCap *big.Int Amount *big.Int BlobFeeCap *uint256.Int BlobCount int Frequency time.Duration TotalNumber int }
SendConfig holds the parameters for the blob txs
func NewBlobTxConfig ¶
func NewBlobTxConfig(chainID *big.Int) (*BlobTxConfig, error)
NewBlobTxConfig constructs and returns a new SendConfig
type CallConfig ¶
type CallConfig struct { ChainID *big.Int GasLimit uint64 GasFeeCap *big.Int GasTipCap *big.Int Amount *big.Int MethodName string ABI abi.ABI ContractAddrs []common.Address Frequency time.Duration TotalNumber int }
CallConfig holds the parameters for the contract calling txs
func NewCallConfig ¶
func NewCallConfig(chainID *big.Int) (*CallConfig, error)
NewCallConfig constructs and returns a new CallConfig
type Config ¶
type Config struct { // Whether to stop service on any error from tx generation or sending StopOnSendError bool // HTTP client for sending transactions RpcClient *rpc.Client EthClient *ethclient.Client // Key pairs for the accounts we will use to deploy contracts and send txs SenderKeys []*ecdsa.PrivateKey SenderAddrs []common.Address // Tx signer for the chain we are working with Signer types.Signer // Configuration for the initial contract deployment DeploymentConfig *DeploymentConfig // Configuration for the contract calling txs CallConfig *CallConfig // Configuration for the eth transfer txs SendConfig *SendConfig // Configuration for the blob txs BlobTxConfig *BlobTxConfig }
Config holds all the parameters for the auto tx spammer
type ContractDeployer ¶
type ContractDeployer struct {
// contains filtered or unexported fields
}
ContractDeployer is responsible for deploying contracts
func NewContractDeployer ¶
func NewContractDeployer(config *Config, gen *TxGenerator) *ContractDeployer
NewContractDeployer returns a new ContractDeployer
type DeploymentConfig ¶
type DeploymentConfig struct { ChainID *big.Int GasLimit uint64 GasFeeCap *big.Int GasTipCap *big.Int Data []byte Number uint64 }
DeploymentConfig holds the parameters for the contract deployment contracts
func NewDeploymentConfig ¶
func NewDeploymentConfig(chainID *big.Int) (*DeploymentConfig, error)
NewDeploymentConfig constructs and returns a new DeploymentConfig
type EthSender ¶
type EthSender struct {
// contains filtered or unexported fields
}
EthSender sends eth value transfer txs
func NewEthSender ¶
NewEthSender returns a new EthSender
func (*EthSender) Send ¶
func (s *EthSender) Send(quitChan <-chan bool, txChan <-chan *types.Transaction, sentCh chan<- *types.Transaction) (<-chan bool, <-chan error)
Send awaits txs off the provided work queue and sends them
type GenParams ¶
type GenParams struct { Sender common.Address SenderKey *ecdsa.PrivateKey ChainID *big.Int GasTipCap *big.Int GasFeeCap *big.Int GasLimit uint64 To *common.Address Amount *big.Int Data []byte BlobParams *BlobParams }
GenParams params for GenerateTx method calls
type SendConfig ¶
type SendConfig struct { ChainID *big.Int GasLimit uint64 GasFeeCap *big.Int GasTipCap *big.Int Amount *big.Int Frequency time.Duration TotalNumber int }
SendConfig holds the parameters for the eth transfer txs
func NewSendConfig ¶
func NewSendConfig(chainID *big.Int) (*SendConfig, error)
NewSendConfig constructs and returns a new SendConfig
type Spammer ¶
type Spammer struct { Deployer *ContractDeployer Sender *EthSender TxGenerator *TxGenerator // contains filtered or unexported fields }
Spammer underlying struct type for spamming service
type TxGenerator ¶
type TxGenerator struct {
// contains filtered or unexported fields
}
TxGenerator generates and signs txs
func NewTxGenerator ¶
func NewTxGenerator(config *Config) *TxGenerator
NewTxGenerator creates a new tx generator
func (*TxGenerator) GenerateTxs ¶
func (gen *TxGenerator) GenerateTxs(quitChan <-chan bool) (<-chan bool, <-chan *types.Transaction, <-chan error)