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

Ping block explorer APIs as a CI step #91

Open
bbenligiray opened this issue Sep 20, 2023 · 1 comment
Open

Ping block explorer APIs as a CI step #91

bbenligiray opened this issue Sep 20, 2023 · 1 comment

Comments

@bbenligiray
Copy link
Member

Or even better, (re)verify a contract to check if contract verification works, and omit the API information if it doesn't. This would prevent these kind of errors.

@andreogle
Copy link
Member

Might need some ideas for how to do this reliably for all chains.

As a first attempt, I tried to simply ping the chain.explorer.api.url with a HEAD request (aka a GET but only returns the headers) and then check that the status value is < 400. This works for maybe 50% for the existing chains, but for the rest, they return a 400 error. I think most are some kind of Etherscan API fork and seem to require module and action parameters with the request. So I then tried adding these basic query string params to all requests:

{
  module: 'account',
  action: 'eth_get_balance',
  address: '0x0000000000000000000000000000000000000000'
}

This seems to work for all chains except boba-bnb and boba-ethereum. I don't yet know if there is some kind of parameter combination that would work for all chain APIs.

I'm happy to try the contract (re)verification, but not quite sure what I would need to add to each chain object to allow this and how each chain would be different. e.g. what contract are we verifying?

From the Etherscan docs, it seems like there is quite a lot of data required to do this

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

2 participants