neo
neo copied to clipboard
Get Contract Events by Contract Hash
Summary or problem description
ApplicationLog already saves a log of all the events per transaction. Searchable by contract hash or transaction hash. You can also already view this information in neo-cli by command log contract. This is very useful for syncing or looking at missed contract events. If user were to do this they would need to build a plugin to watch for this activity on their own.
Do you have any solution you want to propose?
Enable this data to end-user by HTTP RPC. What this will do is allow users to get the events by a contract hash, returning transaction hash (a list of events).
Method Name: getcontractlog
Example of Command:
neo> log contract 0xf0151f528127558851b39c2cd8aa47da7418ab28 0 3
Transaction Hash: 0x16890a963a9325bcce5fa874840ee9385fb52a81b08ba87a90cc0881842b03ad
Event Name: Transfer
State Parameters:
arg1: {"type":"ByteString","value":"Llmh1poEZKFMPOkBa0p1QYFoqys="}
arg2: {"type":"ByteString","value":"352hGohJmxzp1lmMC322MRwTfag="}
arg3: {"type":"Integer","value":"3339600000000"}
--------------------------------
Transaction Hash: 0x5f577775c8980b9d3f17e0c241a77c19232e39ff973fad9a4e3c854074c0f657
Event Name: Transfer
State Parameters:
arg1: {"type":"ByteString","value":"BrY0XpYy7nFjXOnPMsMBAxx5HRc="}
arg2: {"type":"ByteString","value":"YeKHeeCXGEps8sSRlxbc4v97b1U="}
arg3: {"type":"Integer","value":"128176221000"}
--------------------------------
neo>
Where in the software does this update applies to?
- RPC (HTTP)