0

I have created a smart-contract and deployed to the Rinkeby Network, it has a client-side application which has been established with React. Now, I would like to observe and audit every transaction or callback happens in my smart-contract and I need to record these events whenever it happens. In other words, I need to track the transaction near-real-time and record the logs to my SQL or InfluxDB directly.

Would you please show me a way how to do that.

Thank you.

1 Answer 1

0

You can watch for solidity events using myContract.events.MyEvent([options][, callback]) with web3 (https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html#contract-events).

Note that you have to connect to your node via websocket in order to subscribe to events.

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.