0

Running into a problem attempting to test with hardhat by forking mainnet. I'm following the instructions here: https://hardhat.org/hardhat-network/docs/guides/forking-other-networks. I have a mainnet app configured in my Alchemy account and am using its API key. The problem I'm seeing is, when I run

npx hardhat node --fork https://eth-mainnet.g.alchemy.com/v2/[API_KEY]

(with a valid API key of course) it fails with:

Error HH604: Error running JSON-RPC server: Too Many Requests error received from eth-goerli.g.alchemy.com.

Looking at the app logs in the Alchemy dashboard, sure enough, there are tons of 429 errors associated with calls to eth_getTransactionCount. This is a brand new app I've created in Alchemy as well. I tried pinning to a specifick block as well but it didn't seem to make a difference.

Why am I getting rate-limited simply trying to start the hardhat node?

enter image description here

1
  • That is something you have to ask Alchemy customer support. I'd guess that hardhat is making too many queries, when alchemy returns errors it retries again so the problem increases.
    – Ismael
    Nov 20 at 17:19

1 Answer 1

0

A 429 error is a code that specifies that your app has exceeded its compute unit per second capacity (throughput). Throughput is a measure of the number of requests your application can send per second. It is often known as the applications "rate limit". If a large number of requests are sent at the same time, you may hit your throughput capacity.

See: https://docs.alchemy.com/reference/throughput

1
  • Thanks, I understand what a 429 error is. The question is, why am i get rate-limited just trying to start the hardhat node?
    – Madbreaks
    Nov 16 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.