Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why #3

Open
Ghaining opened this issue Sep 3, 2021 · 13 comments
Open

why #3

Ghaining opened this issue Sep 3, 2021 · 13 comments

Comments

@Ghaining
Copy link

Ghaining commented Sep 3, 2021

(node:11683) UnhandledPromiseRejectionWarning: Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.4.4)

@sathishpuranik
Copy link

sathishpuranik commented Sep 5, 2021

Same issue for me as well. It seems non-https requests are blocked by Mac network. Any leads @Anish-Agnihotri ?

@Anish-Agnihotri
Copy link
Owner

Hey folks, do you have a local mainnet RPC endpoint deployed to http://localhost:8545/?

The scripts in all index.js files use a local RPC endpoint. I think this issue may be that Ethers cannot detect an RPC endpoint for you.

If that is the issue, try replacing this URL with an RPC endpoint from Infura/Alchemy/Quicknode/etc., or run a local node?

@pdarcos
Copy link

pdarcos commented Sep 5, 2021

Hi @Anish-Agnihotri
I'm running OpenEthereum node locally on port 8547 so I obviously changed to that port in your script but I still get the error "(node:68106) UnhandledPromiseRejectionWarning: Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.4.4)"

I tried changing the script to use the Cloudflare Gateway and it seems to work for a while but then I also get an error.

@Anish-Agnihotri
Copy link
Owner

I see; unfortunately don't have an OpenEthereum node handy to troubleshoot but I'll try to find one.

Cloudflare Gateway may be failing because of a rate-limit. I tried with Infura and Alchemy, and both seem to work for me.

@pdarcos
Copy link

pdarcos commented Sep 5, 2021

Yeah you're probably right. Must be some rate limiting going on.
I'm going to try with Infura. Do you have an example configuration for Infura I can use as a guide?

Thanks

Cloudflare:
Collecting xLoot: 8269
Collecting xLoot: 8270
(node:69481) UnhandledPromiseRejectionWarning: Error: call revert exception (method="getHead(uint256)", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0)

@pdarcos
Copy link

pdarcos commented Sep 5, 2021

Nevermind. I seem to have gotten it to work with Infura.
So far so good.

Thanks

@pdarcos
Copy link

pdarcos commented Sep 5, 2021

Looks I spoke too soon.

I guess Infura also has problems apparently

Collecting xLoot:  10779
(node:71326) UnhandledPromiseRejectionWarning: Error: missing revert data in call exception (error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"server":"awselb/2.0","date":"Sun, 05 Sep 2021 15:55:54 GMT","content-type":"text/html","content-length":"122","connection":"close"},"body":"<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n","requestBody":"{\"method\":\"eth_call\",\"params\":[{\"to\":\"0x1dfe7ca09e99d10835bf73044a23b73fc20623df\",\"data\":\"0xef68075a0000000000000000000000000000000000000000000000000000000000002a1b\"},\"latest\"],\"id\":22266,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/766t6hbfb96f44f1b88d366e873f6e61"}, data="0x", code=CALL_EXCEPTION, version=providers/5.4.4)

Can you change the script to save the output every once in awhile so we don't have to start with token 8001 each time the script crashes?

Thanks

@Anish-Agnihotri
Copy link
Owner

Very weird, I was able to do a full run-through with Infura properly. I'll dig into this and yes, will add chunk saves every couple hundred to prevent having to restart.

@pdarcos
Copy link

pdarcos commented Sep 5, 2021

I just tried with Etherscan and after about 90 tokens or so I get a bad gateway response (502) and the script stops

@ashervillle
Copy link

Hi! Everything works fine with getDefaultProvider and etherscan API key but when I'm trying to make it work with local RPC endpoint (geth --rpc) throws Error: call revert exception (method="getChest(uint256)", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0).
Tried to troubleshoot it with google for a while but it seems I can't find a solution without going deeper in the whole theme and I don't have much time at the moment.
Any ideas? Can you tell me some keywords for google about setting up a proper local mainnet RPC endpoint (what worked for you)?
Sorry for bad english

@pdarcos
Copy link

pdarcos commented Sep 7, 2021

Interesting that etherscan worked for you @ashervillle . Did you not get an error message from their server after a few hundred calls?
In my case it works for a while until I get an error message from the server and the script stops (and doesn't yet save state so we have to start all over again).

As for your question on the local RPC endpoint I believe you'll have to run a full node yourself (google openethereum).
Hope that helps.

Cheers

@pdarcos
Copy link

pdarcos commented Sep 13, 2021

Any update on this? @Anish-Agnihotri are you still going to implement saving state so we don't have to start all over when/if the script stops because the provider gives a bad response?

@ashervillle do you have a normal free etherscan account or a paid one? Still trying to figure out why I start getting error responses after a few hundred API calls.

Thanks

@pdarcos
Copy link

pdarcos commented Aug 30, 2023

Thanks for the warning @joeleonjr !

I'm assuming it was my Infura API key which I have now rotated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants