0

I'm reading through the documentation here https://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html

and it says "In order to listen for this event, you would use..."

Coin.Sent().watch({}, '', function(error, result) {
     if (!error) {
        console.log("Coin transfer: " + result.args.amount +
        " coins were sent from " + result.args.from +
        " to " + result.args.to + ".");
        console.log("Balances now:\n" +
        "Sender: " + Coin.balances.call(result.args.from) +
        "Receiver: " + Coin.balances.call(result.args.to));
     }
})

Now, this is not part of the contract itself, so where would I run this code?

1

It's a JavaScript code. You can use this javascript as client (web3j) to observe events

  • Hmm How would I allow connect a client to the EVM? – gerbil Jan 1 '18 at 8:57
  • There are geth, parity. For dev ethereumjs-testrpc is great – Imran Hasan Jan 1 '18 at 9:04

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.