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

PollingBlockTracker - encountered an error while attempting to update latest block: #110

Open
faizyboy1 opened this issue Jul 19, 2022 · 3 comments

Comments

@faizyboy1
Copy link

faizyboy1 commented Jul 19, 2022

I am creating my dapp through walletconnect and infura when i use walletconnect web3provider and pass infura id to initalize the web3provider this error starts to appear and it sends so many requests to infura endpoint more than 100k in few hours and exceed the limits of requests of infura and it make difficult to further test and develop the dapp. The error is occuring in poling .js file while fetching the latest block. I have no clue what to do. I have not post any query on github so if any thing left from my side i can explain further thanks.

const provider = new WalletConnectProvider({

      infuraId: "8031b681fe9f440ba9dedc43c6d3e780",
      connector: connector,
      // chainId: connector.chainId,
      qrcode: false,
    });

poling.js

async _updateLatestBlock () {
    // fetch + set latest block
    console.log("Updating latest Block1");
    const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay));
    await waitFor(5000);
    const latestBlock = await this._fetchLatestBlock()
    this._newPotentialLatest(latestBlock)
  }

i tried to tackle by myself by adding two lines of setTimeout Thanks

@mcmire
Copy link
Contributor

mcmire commented Jul 19, 2022

It seems that @walletconnect/web3-provider uses our web3-provider-engine package, which is using an older version of this package. However, we no longer support web3-provider-engine, and it seems that WalletConnect doesn't support @walletconnect/web3-provider, either, as the last real commit was in 2019 and this provider doesn't appear in their active development branch.

@walletconnect/web3-provider seems very specific to MetaMask, so if that's the case, then why not use our guide to get the current MetaMask provider and then pass that to ethers via its Web3Provider class? This way you don't need to pass an Infura key (since you're going through MetaMask to make requests). Or, if you want to talk to Infura directly, then you can use ethers.providers.InfuraProvider.

@Shehryar2
Copy link

@mcmire Thanks for the reply. I am using mobile development to create my dapp so i am using walletconnect to connect with metamsk or any other wallet.

@anhnh-yoong
Copy link

@mcmire Thanks for the reply. Can I disable alert?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants