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

Ankr #137

Closed
wants to merge 14 commits into from
Closed

Ankr #137

wants to merge 14 commits into from

Conversation

AlexTheLion123
Copy link
Contributor

Details

  • Adds ankr.py that has a function to read block data and a function to extract timestamps
  • Adds Ankr Reoganization Montior

Tasks

"""Check if a node has GoEthereum GraphQL API turned on.


You can check if GraphQL has been turned on for your node with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong comment

return blocks


def extract_timestamps_ankr_get_block(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must use Web3 instance, not direct endpoint_url, because otherwise the function won't be compatible or in line with the rest of the library.

For making custom RPC requests, see anvil.py for examples.

If you need to fish out the endpoint_url from web3 object you need to do:

provider = web3.provider
if isinstance(provider, HTTPProvider):
    endpoint_uri = provider.endpoint_uri

As the provider may also use WebsocketProvider and in that case we should fail with an exception until a special support is added.


start_block, end_block = reorg_mon.load_initial_block_headers(block_count=5)

block = reorg_mon.get_block_by_number(start_block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we always download the same blocks in the test, you can actually check real block numbers and timestamps here. They will always stay stable as long as the start block is the same.

@AlexTheLion123
Copy link
Contributor Author

Closed due to no longer working with Ankr

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

Successfully merging this pull request may close these issues.

Ankr specific timestamp reader
2 participants