0

I have a small dapp that uses web3.js to interact with a contract. I have one event listener:

let activateEvent = nexusContract.events.Activate({ _member: defaultAccount })

activateEvent.watch((error, result) => {
  console.log(error, result)
})

However, the event callback never fires. I've checked it on the Solidity end of the things, and the smart contract is definitely firing events. What am I doing wrong?

I've also tried this syntax too:

activateEvent.on('data', (error, result) => console.log(error, result))

But to not avail.

The version of web3.js I'm using is 1.0.0-beta.34, and I'm using with MetaMask on the mainnet.

  • Are you trying to get a receipt, or transactionHash ? – Adibas03 Jul 22 at 18:10
  • what is the provider that you are using? You should use web socket provider – Sanjay S B Jul 23 at 6:25

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.