INFURA / infura

Official Public Repository for INFURA
https://infura.io
380 stars 62 forks source link

getPastEvents via infura stopped working a couple of days ago #138

Open borboss366 opened 6 years ago

borboss366 commented 6 years ago

I try to getPastEvents via web3 infura. Queries are ok. But when I try to connect to call getPastEvents on my contract, it either does not return anything and logs CloseEvent error to the console or works very slowly and returns only part of the events. A week ago everything worked perfectly.

This is how I create the web3 library -

const provider = new Web3.providers.WebsocketProvider("wss://rinkeby.infura.io/ws");
provider.on("error", e => console.error("WS Error", e));
provider.on("end", e => console.error("WS End", e));
let web3 = new Web3(provider);

This is how I call getPastEvents, where this.state.lastBlockNumber is the last mined block -

let started = await contract.getPastEvents(
      "Started",
      {
        fromBlock: 2500000,
        toBlock: this.state.lastBlockNumber
      }
    );

This is the close event, logged in the browser - CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", …}

nhatminh12369 commented 6 years ago

I'm encountering the same issue when calling getPastEvents on Rinkerby test net as well. I started noticing it yesterday. I'm using the HTTP provider and this is the error: Failed to load resource: the server responded with a status of 500

dpurhar27 commented 6 years ago

+1 noticed it started yesterday. Was working before that fine. I'm using the Infura WS on Rinkeby to listen to events from the contract. It'll connect then instantly drop the connection and when I attempt to reconnect it says I've connected but when I try to listen to past events they return this:

CONNECTION ERROR: Couldn't connect to node on IPC

It also doesn't hear new events incoming.

nhatminh12369 commented 6 years ago

Seem like the issue has been fixed. I tried just now and it worked.