I am trying to build a simple Dapp. Tested already in local testnet (test rpc), next wanted to test it in rinkeby.

Since I used web3 in server side, unable to capture injected web3 from metamask, so I am trying to use infura api. It is able to get the contract details, but fails with an event that too with error "Invalid JSON Response".

Here is the route.js code I am trying to connnect to infura https://gist.github.com/parthi2929/7af62a5e24576864146db2d9d5379a61

Please find the rest of project files here (working with testrpc) https://github.com/parthi2929/my-second-dapp

  1. Why the event fires in first place (as per contract should fire only when setInstructor called).
  2. Why event has error response (Invalid JSON response).

Note: Some people might ask to deploy geth to load rinkeby blockchain and connect to that, but the point is, I want to avoid running localhost and test it. That is why trying infura api which is supposed to have all blockchain data, and it also seem to have as it could get my account balance and contract info properly. Somewhere in event handling we are failing.

Please help.

  • To isolate server socket complications, I also created a simple client side script to test infura and got the same result (but with metamask injected web3, it works fine). Please check here here. github.com/parthi2929/test-dapp-NOTWORKING – parthi2929 Dec 11 '17 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.