// https://docs.solana.com/cluster/rpc-endpoints
// Maximum number of requests per 10 seconds per IP: 100 (10/s)
// Maximum number of requests per 10 seconds per IP for a single RPC: 40 (4/s)
// Maximum concurrent connections per IP: 40
// Maximum connection rate per 10 seconds per IP: 40
// Maximum amount of data per 30 second: 100 MB
// "https://api.devnet.solana.com",
// https://shdw.genesysgo.com/genesysgo/the-genesysgo-rpc-network
// SendTransaction Limit: 10 RPS + 200 Burst
// getProgramAccounts Limit: 15 RPS + 5 burst
// Global Limit on the rest of the calls: 200 RPS
"https://devnet.genesysgo.net",
],
mode: "round-robin",
network: "devnet",
});
if (!SKIP_AIRDROP) { // airdrop 1 sol to new addresses, confirm and send sol to SENDER for (let i = 0; i < Math.ceil((TOTAL_SOL + 1) / 1); i++) { // generate new keypair const keypair = Keypair.generate();
// airdrop sol to the generated address
const airdropSig = await cm
.connSync({ airdrop: true })
.requestAirdrop(keypair.publicKey, LAMPORTS_PER_SOL);
logger.debug("Airdropped 1 SOL to", sender.publicKey.toBase58());
// wait for confirmation
logger.debug("Confirming airdrop transaction...");
await TransactionWrapper.confirmTx({
connectionManager: cm,
changeConn: false,
signature: airdropSig,
commitment: "max",
airdrop: true,
});
logger.debug("Airdrop transaction confirmed");
// send sol to SENDER
const tx = TransactionBuilder.create()
.addSolTransferIx({
from: keypair.publicKey,
to: sender.publicKey,
amountLamports: LAMPORTS_PER_SOL - 5000,
})
.build();
const wrapper = await TransactionWrapper.create({
connectionManager: cm,
changeConn: false,
signer: keypair.publicKey,
transaction: tx,
}).addBlockhashAndFeePayer(keypair.publicKey);
const signedTx = await wrapper.sign({ signer: keypair as Signer });
const sig = await wrapper.sendAndConfirm({
serialisedTx: signedTx.serialize(),
commitment: "max",
});
logger.debug(
"Sent 1 SOL to",
sender.publicKey.toBase58(),
"with signature",
sig
);
await sleep(1000);
}
}
// fetch balance of the generated address logger.debug("Fetching balance of", sender.publicKey.toBase58()); let senderBal = await cm // default value for changeConn = true .connSync({ changeConn: true }) .getBalance(sender.publicKey, COMMITMENT); logger.debug(Sender balance: ${senderBal});
// generate receivers logger.debug(Generating ${NO_OF_RECEIVERS} receivers...); const receivers: Keypair[] = []; for (let i = 0; i < NO_OF_RECEIVERS; i++) { receivers.push(Keypair.generate()); } logger.debug("Receivers generated");