0

is it possible to watch the events of any ethereum transaction? like for erc20 token. when we make any transaction of erc20 on the blockchain event get trigger. is same is possible for ETH transaction. if yes then how we get the ethereum log??

  • What does this mean " when we make any transaction of erc20 on the blockchain event get trigger." and its relevance with the question? Maybe I am missing something. Whenever we need to monitor state of an event(in this case a transaction) there are two options: 1) Polling: Similar to what @cleanunicorn suggested. Querying the status at certain intervals using the txn hash. 2) Socket Communication: Socket communication is basically used for notification models. Web3 provides SocketProvider aprt from HTTPProvider and IPCProvider, though it is still in beta. But, I hope you can find a way out usi – Valgrind1691 Aug 7 '18 at 7:54
0

Yes, that is possible. Watch for new blocks and process all transactions.

For each transaction you can run eth_getTransactionReceipt And the logs array will contain all the events

logs: Array - Array of log objects, which this transaction generated.

  • I am trying to find some other solution so that I can watch any transaction on a particular address. so that I don't need to filter out the entire block. like for any smart contract address. – rahul saini Apr 26 '18 at 12:39

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.