0

when i'm working on ganache all event that i have emit are store in my nodejs server but when i turn to kovan or ropsten my server don't catch event . i'm working with infura

this my code

  no products are added when I’m on a network other than ganache

server.js show this

  (node:11608) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
Ebay on Ethereum server listening on port 3001
Error: The method eth_newFilter does not exist/is not available
    at Object.InvalidResponse (/var/www/krypteth/node_modules/truffle-contract/node_modules/web3/lib/web3/errors.js:35:16)
    at /var/www/krypteth/node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js:86:36
    at XMLHttpRequest.request.onreadystatechange (/var/www/krypteth/node_modules/web3/lib/web3/httpprovider.js:128:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:509:12)
    at IncomingMessage.<anonymous> (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:469:24)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Error: The method eth_newFilter does not exist/is not available
    at Object.InvalidResponse (/var/www/krypteth/node_modules/truffle-contract/node_modules/web3/lib/web3/errors.js:35:16)
    at /var/www/krypteth/node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js:86:36
    at XMLHttpRequest.request.onreadystatechange (/var/www/krypteth/node_modules/web3/lib/web3/httpprovider.js:128:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:509:12)
    at IncomingMessage.<anonymous> (/var/www/krypteth/node_modules/xhr2/lib/xhr2.js:469:24)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

this my app js web3 provider

window.addEventListener('load', function() {
  // Checking if Web3 has been injected by the browser (Mist/MetaMask)
  if (typeof web3 !== 'undefined') {
    console.warn("Using web3 detected from external source. If you find that your accounts don't appear or you have 0 MetaCoin, $
    // Use Mist/MetaMask's provider
    window.web3 = new Web3(web3.currentProvider);
  } else {
    console.warn("No web3 detected. Falling back to http://127.0.0.1:9545. You should remove this fallback when you deploy live,$
    // fallback - use your fallback strategy (local node / hosted node + in-dapp id mgmt / fail)
    window.web3 = new Web3(new Web3.providers.HttpProvider("https://kovan.infura.io/v3/<my-key>"));
  }

  App.start();
});

and my server.js provider code

var provider = new Web3.providers.HttpProvider("https://kovan.infura.io/v3/<my-key>");
1

Retracted ... just leaving this here for the comments thread.

  • Infura does support events with the websocket interface ethereum.stackexchange.com/a/45418 (at least on mainnet, I don't know if the support includes testnets). – Ismael Feb 8 '19 at 3:10
  • Now I'm curious about reliability and limitations. Have they got it all worked out? – Rob Hitchens - B9lab Feb 8 '19 at 6:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.