Closed alexanderbkl closed 1 year ago
I'm pretty certain that what's happening here is that you're hitting the rate limit which imposes a maximum of 30 requests in any 10-second period from the same IP. After this, you'll get a 429 response like this:
{
"code": "ERROR_RATE_LIMITED",
"message": "You are being rate limited"
}
You can reproduce this just by rapidly refreshing your w3name URL in the browser. I think that the No 'Access-Control-Allow-Origin' header is present on the requested resource.
error is just because the 429 status error response doesn't provide that header, but the problem is ultimately that you're being rate limited.
I don't think that this will have been affected at all by the migration from the Web3Storage Name library to the new w3name
service; I'm pretty sure it will have had this same limit all along.
So the simple solution is to adapt your application so that it limits its requests to a max of 30 per 10 seconds. I'm not sure of your use case, but it might be worth using the w3name.resolve function, which is rate-limited automatically.
I'm using a w3name API to resolve an IPNS link and get a list of all the data stored inside of a JSON stored inside the IPNS. I use useEffect in React, at first it is normal but after a while when issuing many requests, causes a bunch of errors in the console as it is some sort of anti-spam:
The reason I think it is possible that this might be causing the issue, is because there has been a library migration from Web3Storage Name library to w3name; besides that the incident report matches the time I was testing out the API.