I want to fork the polygon mainnet using hardhat but don't know why it's giving me this error:
Error HH604: Error running JSON-RPC server: Invalid JSON-RPC response's result.
Errors: Invalid value null supplied to : RpcBlockWithTransactions | null/transactions: RpcTransaction Array/0: RpcTransaction/accessList: Array<{ address: DATA, storageKeys: Array<DATA> | null }> | undefined, Invalid value null supplied to : RpcBlockWithTransactions | null/transactions: RpcTransaction Array/2: RpcTransaction/accessList: Array<{ address: DATA, storageKeys: Array<DATA> | null }> | undefined
or sometimes it gives me this error:
Error HH110: Invalid JSON-RPC response received: {
"message":"No API key found in request"
}
I am also providing the API with rpc URL but still I am getting this error. I am able to make a curl request but don't know why this is happening. Is it a problem from my side or from the node provider?
This is the command I am running in the terminal for forking:
yarn hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/<api-key>