8

I'm trying to figure out how to log events happening in a contract at a private Ethereum network. It looks like Events are the way to go. However, I can't seem to find any good example of how to interface with contract's Events through JSON RPC.

How can I use contracts Events through JSON RPC?

ThePiachu
  • 562
  • 1
  • 6
  • 14

2 Answers2

1

I agree with Mikko Ohtamaa. Do it through an API that wraps the JSON-RPC calls for you. However, to answer your question, I believe "eth_getTransactionReceipt" is the RPC call your looking for. It delivers an Array "logs" which should contain the fired events.

Max Binnewies
  • 677
  • 4
  • 11
-1

How you frame the question doesn't make sense. Usually you want to use a language specific client library that wraps the underlying Ethereum JSON-RPC questio (You do not want to build this wrapper library yourself unless you are very experienced in programming). Because you did not open your question enough and explain what kind of run-time environment you have, it is not possible to give an accurate answer.

However most notable Ethereum JSON-RPC libraries include

You'll find one for your programming language unless you are using very eccentric run-time environment.

Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127