I am using Ganache as my test network and I am running React as my front end.

My ComponentWillMount() is as follows:

componentWillMount() {
    .then(results => {
        web3: results.web3
      }, () => {
        let filter = this.state.web3.eth.filter('latest');
        filter.watch(function(error, result) {
          console.log('Filter', result);
    .catch(() => {
      console.log('Error finding web3.')

I use a button to call issue() function:

issue() {
    const issuance = contract(IssuanceContract)

    var issuanceInstance

    this.state.web3.eth.getAccounts((error, accounts) => {

      issuance.deployed().then((instance) => {
        issuanceInstance = instance

        return issuanceInstance.Issue('Test', {from: accounts[0]})
      }).then((receipt) => {
        console.log('Transaction receipt', receipt);

Upon searching a lot in stackexchange, I tried to add Events into solidity code:

event EventIssue(uint itemId)

And I fire the event from the Issue function:


I get the output of the receipt, but no output for filter (neither for error). In Metamask I can see that the transaction is pending, and then it gets mined, and I was assuming that when it gets mined I see the output using the filter. Am I missing something?

Update 23/02/2018: This doesn't work either:

issuanceInstance.EventIssue('latest').watch((error, result) => {

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.