diff --git a/sz-poc-offsite-2025/evm/load/load.js b/sz-poc-offsite-2025/evm/load/load.js new file mode 100644 index 0000000..c86f62d --- /dev/null +++ b/sz-poc-offsite-2025/evm/load/load.js @@ -0,0 +1,31 @@ +// load-script-rate.js +import { ethers } from "ethers"; + +const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + +async function main() { + const provider = new ethers.JsonRpcProvider("http://localhost:8545"); + const sender = ethers.Wallet.fromPhrase( + "test test test test test test test test test test test junk" + ).connect(provider); + + const to = "0x1000000000000000000000000000000000000000"; + const value = ethers.parseEther("0.01"); + const maxTxs = 10000; // total number of txs to send + + console.log(`Sending up to ${maxTxs} txs at ~1 tx/s…`); + let nonce = await provider.getTransactionCount(sender.address); + + for (let i = 0; i < maxTxs; i++) { + // fire‐and‐forget each sendTransaction + sender.sendTransaction({ to, value, gasLimit: 21_000, nonce: nonce + i }) + .then(tx => console.log(` → tx #${i} sent: ${tx.hash}`)) + .catch(err => console.error(` ! error on tx #${i}:`, err)); + + await sleep(1000); + } + + console.log("Done scheduling txs."); +} + +main().catch(console.error); \ No newline at end of file diff --git a/sz-poc-offsite-2025/evm/load/package.json b/sz-poc-offsite-2025/evm/load/package.json new file mode 100644 index 0000000..96ae6e5 --- /dev/null +++ b/sz-poc-offsite-2025/evm/load/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file