1

I have a nodejs 'server' running that listens for events on the blockchain. Currently I have this line in my code:

var provider = new Web3.providers.HttpProvider("http://localhost:8545");

But I'm fed up paying $40 every month for my node. I want to switch to infura. I signed up, added my project, got project ID. Then changed this line of code to:

var provider = new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/PROJECTID");

And I get a whole load of errors as per https://i.imgur.com/CW7InGp.png. What's going on? What am I doing wrong?

Error: The method eth_newFilter does not exist/is not available

closed as unclear what you're asking by smarx, shane, Ismael, Achala Dissanayake, Richard Horrocks Jun 16 at 11:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    "And I get a whole load of errors." Maybe tell us what those errors are. :-) – smarx Jun 12 at 17:25
  • good point :) updated my Q with the errors. I think it's the same set of errors when I use localhost when parity isn't running. It just can't connect to a node. – pumpkinfeet Jun 12 at 19:24
  • are you listening for events using websockets? – AnAllergyToAnalogy Jun 12 at 19:31
  • 1
    Possible duplicate of Infura web3 provider for Events (.get & .watch) – Ismael Jun 12 at 19:48
  • 1
    @pumpkinfeet Infura only support events through websockets. – Ismael Jun 12 at 19:49

Browse other questions tagged or ask your own question.