question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mainnet-fork with multiple upstream providers

See original GitHub issue

Overview

Provide a simple overview of what you wish to see added. Please include:

  • What you are trying to do

I would like to be able to do the following:

ape test --network ethereum:mainnet-fork:hardhat:geth
...

and

ape test --network ethereum:mainnet-fork:hardhat:alchemy
  • Why Ape’s current functionality is inadequate to address your goal This makes it easier for one to use their local node for local tests and CICD tests with alchemy

Specification

Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!

Remember, your feature is much more likely to be included if it does not involve any breaking changes.

ape-config.yaml would allow more flexbility in choosing upstream provider for mainnet-fork, if one could set up their configurations in the following manner:

plugins:
  - vyper
  - alchemy
  - hardhat

ethereum:
  default_network: mainnet-fork
  mainnet_fork:
    default_provider: hardhat

hardhat:
  default_upstream_provider: geth
  geth:
    fork:
      ethereum:
        mainnet
  alchemy:
    fork:
      ethereum:
        mainnet
           
geth:
  ethereum:
    mainnet:
      uri: http://localhost:9090

Dependencies

Include links to any open issues that must be resolved before this feature can be implemented.

I don’t foresee any open issues blocking this, but it looks like a breaking change to me.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fubuloubucommented, Jul 22, 2022

This is one idea we had but in a slightly different way, basically provide fail-over functionality with how providers are chosen, so instead of one default that it tries to use or fails, you describe a preference order and it will keep trying for a connection down your preference list until it gets one (or times out)

This way, you can spend less time configuring your providers, and just describe what networks you want to connect to instead. For fork mode, upstream providers would be a subset of that list for it to cycle through.

How does this sound?

0reactions
fubuloubucommented, Jul 27, 2022

More accurate:

hardhat:
  fork:
    ethereum:
      mainnet:
        upstream_provider: 
        - geth
        - alchemy
Read more comments on GitHub >

github_iconTop Results From Across the Web

Forking other networks | Ethereum development ... - Hardhat
You can start an instance of Hardhat Network that forks mainnet. This means that it will simulate having the same state as mainnet, ......
Read more >
ApeWorX/ape-hardhat: Hardhat network provider for Ape
Specify the upstream archive-data provider in your ape-config.yaml : hardhat: fork: ethereum: mainnet: upstream_provider: alchemy.
Read more >
Using Fork on Hardhat in testing - Ethereum Stack Exchange
I am able to successfully query the node from a web3 application. When I try to run tests with "npx hardhat test" it...
Read more >
Chain identification & aliasing for The Graph Protocol
Graph Node, and The Graph Network currently relies on a freeform string label to match subgraph manifests with the correct upstream providers ......
Read more >
ape-ganache - PyPI
This is useful for multiprocessing and starting up multiple providers. Mainnet Fork. The ape-ganache plugin also includes a mainnet fork provider. It requires ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found