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

add mesc support #473

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

sslivkoff
Copy link

What is this?

This is a PR to add MESC to ethereum-etl.

MESC is an RPC configuration standard that allows a user to share a single RPC configuration across all of the tools on their system. ethereum-etl does not currently allow for configuring a default rpc provider or configuring separate network-specific defaults. Adopting a standardized approach will increase ethereum-etl's interoperability and make it easier for users to manage multiple endpoints across multiple networks.

More information about MESC can be found in the MESC docs.

Backward Compatibility

MESC is an opt-in standard and this PR integrates it into ethereum-etl in a backward-compatible way. MESC is only used when a user has enabled MESC in their environment. Behavior of ethereum-etl is unchanged for users that have not enabled MESC.

Behavioral Changes

This PR introduces two behavioral changes to ethereum-etl:

  1. If a user has enabled MESC in their environment, use the user's MESC default instead of ethereum-etl's previous default of https://mainnet.infura.io. If a user has not set defaults in their MESC config, ethereum-etl falls back to using https://mainnet.infura.io as the default.

The follow commands are affected:

  • export_all
  • export_blocks_and_transactions
  • export_contracts
  • export_receipts_and_logs
  • export_tokens
  • extract_tokens
  • get_block_range_for_date
  • get_block_range_for_timestamps
  • stream
  1. If a user has enabled MESC in their environment, the -p / --provider-uri argument now allow users to specify providers using 1) an endpoint name, 2) a network name, 3) a chain id, or 4) a URI (as before). For example, each of the following is now allowed:

specify by endpoint name
export_blocks_and_transactions -p local_goerli ...

specify by network name
export_blocks_and_transactions -p goerli ...

specify by chain id
export_blocks_and_transactions -p 5 ...

specify by uri
export_blocks_and_transactions -p http://localhost:8545 ...

Dependency Changes

The mesc python implementation has no dependencies and is compatible with python 3.7 through python 3.12.

How to set up MESC?

There are two basic steps: create a mesc.json and set MESC_PATH to the path of this file. Details can be found in the MESC Quickstart Guide. The setup process can also be performed interactively with the mesc cli tool.

Why would ethereum-etl integrate MESC?

  • Multi-endpoint UX: Users will be able to easily choose between various networks and endpoints when exporting data.
  • Easier onboarding: As soon as a user installs ethereum-etl, they will immediately be able to use it with all of their configured MESC endpoints, no additional configuration needed.
  • Minimize dev maintenance burden: ethereum-etl will no longer has to maintain code for configuring endpoints, this gets outsourced to MESC.
  • Future-proof metadata. MESC can store metadata about each endpoint to track things like rate-limits, namespaces, and endpoint groupings. Integrating MESC would give ethereum-etl the ability to easily use this information in the future for new features.

A longer form discussion of these advantages can be found on the Why MESC? page of the MESC docs.

What do you think?

Let me know what you think and if you have any general questions about MESC.

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.

1 participant