Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

rate limit error #171

Open
es-taheri opened this issue May 3, 2023 · 1 comment
Open

rate limit error #171

es-taheri opened this issue May 3, 2023 · 1 comment

Comments

@es-taheri
Copy link

es-taheri commented May 3, 2023

{"Error":"request rate exceeded the allowed_rps(10), and the query server is suspended for 5 s"}
How Can I fix this rate limit error?
Code :
$fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
try {
$tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
} catch (\IEXBase\TronAPI\Exception\TronException $e) {
SendMessage(REPORT_CHANNEL, "❗️Tron Blockchain Error While Checking Payments On Cron : " . $e->getMessage());
break;
}
$tron->setAddress($u_wallet_trx_address);
$balance = $tron->getBalance(null, true);
$tron->setPrivateKey($u_wallet_trx_pvkey);
$result = $tron->send(trx_wallet, $balance - '0.000001')['result'];

@xiaolan36
Copy link

vendor\iexbase\tron-api\src\Provider\HttpProvider.php
__construct() join in
$headers=array_merge($headers,[
'TRON-PRO-API-KEY' => 'youkey',
'Accept' => 'application/json'
]);

key: https://www.trongrid.io/dashboard

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants