Comment on page
In order to ensure fair allocation of requested resources, SolarPath currently imposes rate limits on all requests. If the access rate exceeds the limit, a 429 error code will be returned. Here are some solutions:
- Cache Ethereum data locally. For data that doesn't change frequently, you can cache the on-chain data locally after making a request, so that it can be used for subsequent requests.
- Limit RPC calls on DApp startup. Request the latest on-chain data and cache the data from older blocks only when the user accesses the DApp. This way, you can limit the number of RPC calls.
- Avoid real-time polling of SolarPath. Ethereum produces a new block approximately every 15 seconds, while the TRON network produces a new block approximately every 3 seconds. Requesting new data at a faster rate is usually unnecessary. In any case, please consider using EventHook to track on-chain data changes in real-time.
These approaches will help you optimize your usage of SolarPath and prevent the 429 error code.
- JSON-RPC is a stateless and lightweight remote procedure call (RPC) protocol based on the JSON-RPC 2.0 specification. It is commonly used for interacting with Ethereum. JSON-RPC defines a set of methods that developers can use to make requests using the HTTP protocol.
- NFT-API and TOKEN-API are a series of advanced methods provided by SolarPath specifically for interacting with smart contracts (ERC20/BEP20/TRC20/ERC721/ERC1155/BEP721/BEP1155). They serve a similar purpose to JSON-RPC but are designed to simplify development compared to JSON-RPC. Both APIs can be accessed via HTTP requests. In general, SolarPath recommends using the advanced features of these APIs.
SolarPath has implemented automatic refreshing for the exchange rate service based on its own characteristics. For more specific information, please refer to the documentation: