I am using the NODE API on the Test network (https://nodes-testnet.wavesnodes.com) and when I make multiple requests from an invoke script I am getting the following error: 503 Service Temporarily Unavailable
This error does not always appear, even decreasing the number of requests the error still appears in constant cases.
Does anyone know how to solve this problem?
for (let i = 1; i < bets.length; i++) {
const paramsProv = {
fee: 500000,
dApp: config.roulette.contract,
call: {
function: 'playRoulette',
args: [
{ type: 'integer', value: bets[i] },
{ type: 'string', value: signedScript.id }
]
},
payment: [{ assetId: config.asset.wbet, amount: amounts[i] * 100000000 }],
version: 1,
chainId: config.waves.chain
}
const signedRoletteScript = invokeScript(paramsProv, seed);
roulettePlays.push(broadcast(signedRoletteScript, config.waves.node));
}
await Promise.all(roulettePlays);
There are limits for requests per second for public nodes (https://nodes-testnet.wavesnodes.com). You can find exact numbers here - https://docs.wavesplatform.com/en/waves-node/api-limitations-of-the-pool-of-public-nodes
For your endpoint, it is 100 per second from one IP address.