This project will help you test your RPC by creating n users subscribed to receive the new blocks and then fetch each block with its transactions using ethers library
function startWebsocket() {
let wsProvider = new ethers.providers.WebSocketProvider(PROVIDER_URL);
wsProvider.on('block', async (blockNumber) => {
fetchEVMBlockFor(wsProvider, blockNumber);
});
}
- Docker engine v20.10.17
- Docker compose v2.6.1
git clone https://github.com/JeremyTheintz/rpc-stress-testing
cd ./rpc-stress-testing
sh start.sh n your_rpc_url
Not on mac ? then replace
sh
bybash
from the shebang line of the script
sh start.sh 100 wss://your_rpc_url
sh stop.sh
Not on mac ? then replace
sh
bybash
from the shebang line of the script
Running too many instances will consume a lot of RAM and CPU, use at your own risk