I am running a geth node and tried to perform a load testing by giving multiple transactions (1000 tx) from front end.
As the application is not crypto related and need the blocks to be mined faster, the console.go file is tweaked so that the block difficulty is always set to 1. Our case is not a crypto oriented and hence we have made the minimum gas price as 1.
Please check and help me on it.
More details as below
System information Geth Version: 1.8.18-unstable Git Commit: 3e1cfba Architecture: amd64 Protocol Versions: [63 62] Network Id: 1 Go Version: go1.11.1 Operating System: linux
Expected behaviour Expected behavior is for the tx to get mined.
Actual behaviour I am able to push in 1000 Tx, from front end, all the transactions are only sending 1 wei from account1 to account2. I increased nonce for the tx correctly and so there is no issue and all 1000 tx are created successfully.
I see the tx are struck in pending when viewed with web3.txpool
Steps to reproduce the behaviour Below is the Nethereum code used to create the 1000 tx. All the tx are created but waiting in pending queue.
for (int i = 0; i < 1000; i++)
{
string data = "Test string";
var gasPrice = 10+i;
var privateKey = "XXXXXXXXXXXXXXX";
var senderAddress = "0xa5a85c234bca3D4BF29f7Bd7AD7D458dea8Ea8E9";
var receiveAddress = "0x1b55195c2610f7c0069cb89db1b3e973ff447a49";
var txCount = await web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(senderAddress);
var nonce = txCount.Value+i;
var value = 1;
var encoded = Web3.OfflineTransactionSigner.SignTransaction(privateKey, receiveAddress, value, nonce, gasPrice, 100000, data.ToHexUTF8());
Debug.WriteLine(Web3.OfflineTransactionSigner.GetSenderAddress(encoded));
Debug.WriteLine(encoded);
var txId = await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync("0x" + encoded);
var receipt = await web3.Eth.Transactions.GetTransactionByHash.SendRequestAsync(txId);
}
PS: When I worked with 10 tx(before trying with 1000 tx) for the same above code, it worked fine and the tx are mined immediately.