I'm not able to watch and log event sent by smart contract using the Ropsten test network. The same code works on local test network.
Contract Event code:
event CreateOptionEvent(address indexed _who, uint256 indexed _date, uint256 indexed _id);
function createOption( ...PARAMS HERE... ){
[...]
emit CreateOptionEvent(msg.sender, now, optionId);
}
Web app event code:
createEvent = myContractInstance.CreateOptionEvent({ fromBlock: 0, toBlock: 'latest' })
createEvent.watch((err, result) => {
if (err) {
console.log(err)
return;
}
console.log(result.args._id)
})
After I correctly create an option (transaction success on metamask
) nothing is logged.
What should I try to do?
-> % truffle version
Truffle v4.1.11 (core: 4.1.11)
Solidity v0.4.24 (solc-js)