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??

1
  • 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 Commented Aug 7, 2018 at 7:54

1 Answer 1

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.

1
  • 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_eth
    Commented Apr 26, 2018 at 12:39

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.