Hi Devs,
I need a clarification on the usage of the API-KEY.
From time to time my dApp gets 403 and 503 errors. Looking here:
i understand that for errors 503 the reason is due to the IP frequency limit that can be overcome using a tron-apy-key.
Using tron api key should also fix the 403 error due to rate-limit per day.
Here is explained how to set the tron api key:
https://developers.tron.network/reference/api-key
My dApp is html + javascript developed and in order to use this API-KEY i use this method inside the JS:
window.tronWeb.setHeader({âTRON-PRO-API-KEYâ: âxxx-yyy-zzzâ});
and after setting this i proceed instantiating and calling the contracts i need.
instanceContract = await window.tronWeb.contract(abi_contract, mainContract);
In this way i can perform all my needed requests and get the correct results from the contract but unfortunatelly setting the key that way doesnât seems to fix the above errors so iâm asking myself if i call the right way or not.