Code Monkey home page Code Monkey logo

ape-infura's People

Contributors

antazoey avatar challet avatar dawnseeker8 avatar defidipshit avatar derekpierre avatar dtdang avatar eliseygusev avatar fubuloubu avatar notpeopling2day avatar sabotagebeats avatar sreyemnayr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ape-infura's Issues

Unable to develop off a fork

Environment information

n/a

What went wrong?

If you develop off a fork, the infura project ID does not appear in GitHub.
If you develop by pushing branches directly to the plug in (like members of apeworx can), then it works fine.

How can it be fixed?

Perhaps we have to skip tests that require a secret for external contributors or maybe use a mock HTTP provider

IPFS StorageAPI implementation

Overview

Implement StorageAPI using IPFS feature of infura

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.

Dependencies

ApeWorX/ape#208

Add Linea Testnet and Mainnet information to `ape-infura` plugin [APE-1170]

Overview

Linea testnet has already been public released few months ago, and linea mainnet will be available soon roughly on 18th July.
In ConsenSys, we have created a fork of this repo at apxworx-ape-infura to add the feature to this library to support linea goerli testnet and linea mainnet.

And this PR will be created soon to merge to this repo from our fork repo after we have successfully tested with linea chain.

  • What you are trying to do
    Add linea testnet and linea mainnet support to this plugin.
  • Why Ape's current functionality is inadequate to address your goal
    The current plugin doesn't include the linea chain network information.

Specification

Following is the detail of linea network information:

Network Name Linea goerli testnet Linea Mainnet
RPC URL https://linea-goerli.infura.io/v3/<PROJECT_ID> https://linea-mainnet.infura.io/v3/<PROJECT_ID>
Chain ID 59140 59144
Currency Symbol ETH ETH
Block Explorer URL https://goerli.lineascan.build/ https://explorer.linea.build/

above information will be added to appropriate python files in this plugin.

Dependencies

None.

Add PoA middleware dynamic checking [APE-838]

In the connect we need to add PoA dynamic checking:

       def check_poa(block_id) -> bool:
            try:
                block = self.web3.eth.get_block(block_id)
            except ExtraDataLengthError:
                return True
            else:
                return (
                    "proofOfAuthorityData" in block
                    or len(block.get("extraData", "")) > MAX_EXTRADATA_LENGTH
                )

      # Handle if using PoA
      if any(map(check_poa, (0, "latest"))):
          self._web3.middleware_onion.inject(geth_poa_middleware, layer=0)

Raise error when no environment variables set

Environment information

Latest

What went wrong?

Instead of trying to connect to https://rinkeby.infura.io/v3/None,
it should error earlier stating that it is missing env vars

How can it be fixed?

  • Check earlier for the needed info to be able to connect to Infura and fail early if noticed you can't before trying to make a HTTP request
  • Additionally, document that environment variables needed

raise VirtualMachineError

Overview

ape-http is too generic that is would be fragile to try and handle detecting these errors from every possible provider plugin. From observation, every provider returns these error messages in different formats, some JSON and some just text, all with different patterns etc, it is too complex to try and handle from a single provider. Every provider should handle this separately and more custom to its needs.

THUS

We need to raise VirtualMachineError and handle the errors accordingly to Infura error format and specific messages, similar to other existing provider plugins (use ape-http as a reference or follow ApeWorX/ape-hardhat#4).

Specification

See ape-http provider handling for methods get_transaction() and estimate_gas() as well as the utility method it uses.
Possible look into middleware layers for web3.

Dependencies

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

Deprecate goerli for arbitrum and optimism since no longer supported by Infura

Environment information

  • ape and plugin versions:
$ ape --version
0.7.7

$ ape plugins list
Installed Plugins
  etherscan    0.7.0
  infura       0.7.0
  polygon      0.7.1
  solidity     0.7.1
  • Python Version: 3.10.10
  • OS: macOS

What went wrong?

Tests fail because goerli for arbitrum and optimism are no longer supported by Infura (no endpoints available).

Please include information like:

  • what command you ran
  • the code that caused the failure (see this link for help with formatting code)
  • full output of the error you received

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

Can't install

Environment information

  • ape and plugin versions:
(venv) david@david-Inspiron-5502:~/projects/ape-sandbox$ ape --version
0.3.5
(venv) david@david-Inspiron-5502:~/projects/ape-sandbox$ ape plugins list
No plugins installed. Use '--all' to see available plugins.
(venv) david@david-Inspiron-5502:~/projects/ape-sandbox$ python --version
Python 3.8.10
(venv) david@david-Inspiron-5502:~/projects/ape-sandbox$ inxi -S
System:    Host: david-Inspiron-5502 Kernel: 5.15.0-41-generic x86_64 bits: 64 Desktop: Unity 
           Distro: Ubuntu 20.04.4 LTS (Focal Fossa) 

What went wrong?

(venv) david@david-Inspiron-5502:~/projects/ape-sandbox$ ape plugins install ape-infura
WARNING: Plugin 'ape-infura' is not an trusted plugin.
Install unknown 3rd party plugin 'ape-infura'? [y/N]: y
INFO: Installing ape-infura...
ERROR: Could not find a version that satisfies the requirement ape-ape-infura (from versions: none)
ERROR: No matching distribution found for ape-ape-infura
ERROR: Failed to install plugin 'ape-infura.

How can it be fixed?

¯\_(ツ)_/¯

Support Optimism

Overview

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

  • What you are trying to do
  • Why Ape's current functionality is inadequate to address your goal

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.

Dependencies

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

feat: add environment variables to readme

Overview

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

We should tell the users in the README.md to add the env var

# Used by the `ape-infura` plugin
export WEB3_INFURA_PROJECT_ID=<YOUR_INFURA_PROJECT_ID>
# Used by the `ape-alchemy` plugin
export WEB3_ALCHEMY_API_KEY=<YOUR_ALCHEMY_KEY>

look at the README in alchemy for reference:
https://github.com/ApeWorX/ape-alchmey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.