2

Hi I ran a simple voting example connecting to https://rinkeby.infura.io/ since I do not run local Eth node. Everything works fine except event watching.

var event2 = contractInstance.EventTester(); event2.watch(function(error, result){ if (!error){ console.log(result); }else {console.log(‘ERROR’)} });

When I submit a transaction I do not see that the event was fired (it is called in the contract function). Am I missing anything ?

  • you're doing something wrong because these work – David 天宇 Wong Oct 25 '17 at 19:37
1

I have been having horrible problems catching events in Rinkeby test net using Metamask. I know things work because I can use Metamask though localhost (testrpc) and it works fine, but it is extremely intermittent with Metamask.

This seems to be a really common issue. I have solved it by instead logging the tx hash that is returned when you make a tx, and then calling web3.eth.getTransactionReceipt(txhash) until it returns not null, and parsing the events from there.

Hopefully this helps. Of course this isn’t viable in all situations.

Your Answer

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

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