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

1 Answer 1

1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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