As a developer, I want an event to access ethereum logs
Type: Feature
why only log, maybe better some general method ethereum/rpc for https://github.com/ethereum/wiki/wiki/JSON-RPC#json-rpc-methods
GitHub
The Ethereum Wiki. Contribute to ethereum/wiki development by creating an account on GitHub.
Log is for https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs
We could have a generic rpc too but it would be fairly hard to use from extensions. We want some higher level too.
GitHub
The Ethereum Wiki. Contribute to ethereum/wiki development by creating an account on GitHub.
Hi @jeluard i started working on this. Is it planned to go on gitcoin soon?
@tbenr Sure it is coming! Could you share some details about what you are doing? logs is more complex than send-transaction for instance, and I am afraid I didn't provide much guidance.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
__This issue now has a funding of 320.0 DAI (320.0 USD @ $1.0/DAI) attached to it as part of the Status.im fund.__
Hi @jeluard i applied the work on gitcoin with a brief description of the approach.
@tbenr Somehow can't find it. Could you point me to it?
https://gitcoin.co/issue/status-im/status-react/6601/1784
Add ethereum/log events | status-im Funded Issue Detail | Gitcoin
Gitcoin is the easiest way to monetize or incentivize work in Open Source Software.
Sorry can't find a description of the approach. Can you paste it here?
Did you consider that logs can access multiple elements, as opposed to call that only access a single object? How those would be returned to the caller?
Also how about incoming logs?
I dont know how to get it back :) anyway it was short, something like: i'll add a event in "capacities", then a new handler in extensions/ethereum.cljs which will leverage status/call-private-rpc to call eth_getLogs. Some additional analysis has to be done to manage parameters (expose sha3 to help setting up topics?).
but I may not caught the whole complexity (ie result handling).
Do you have some hints on specific use cases i can focus on?
Looks fine. Forget my previous comment, it's something higher level that we will address independently.
What would make sense is to have something a bit simpler than eth_getLogs: specifically the call should be self-sufficient and not require previous calls to access topics.
@jeluard ok!
@jeluard I successfully implemented this new event:
'ethereum/log
{:permissions [:read]
:value :extensions/ethereum-log
:arguments {:fromBlock? :string
:toBlock? :string
:address? :string
:topics? :vector
:blockhash? :string
:on-result :event}}
this is a 1-1 param mapping with the underlining eth_getLogs.
a usage example:
events/tbtest
(let [{{tbtest :tbtest} :params} properties]
[ethereum/log {:fromBlock "0x4431D0"
:toBlock "latest"
:address "0xd200aa1f51188b41990333bc567d5a55b7df3c31"
:topics ["0xc04ab144c3f6fd32b71825eb92c20af3c8b2f2b6680dfaf3645b527f098c245b"]
:on-result [put-tbtest]}])
what comes to my mind to simplify the interface is:
:topics-helper defined as::topics-helper? {:method :string
:idxparam1? {:type #{:address :uint256} :value :string}
:idxparam2? {:type #{:address :uint256} :value :string}
:idxparam3? {:type #{:address :uint256} :value :string}}
which populates topics encoding (hashing) :method and :idxparam<n> accordingly with type.
Issue Status: 1. Open 2. Cancelled
__Work has been started__.
These users each claimed they can complete the work by 2聽months, 3聽weeks ago.
Please review their action plans below:
1) tbenr has been approved to start work.
add a new event in "capacities", implement a new handler in "ethereum.cljs" which calls call-private-rpc from native status-go module. Some work to do to study getlogs parameters and see if it is the case to expose some "helper" functions to manage some of them (topics?)
Learn more on the Gitcoin Issue Details page.
@tbenr Awesome job!
Your suggestions make a lot of sense.
I would expect to use topics this way (on top of the current way):
:topics [{:event "NewThing"
:params ["uint256" "address"]}]
There are two different bounties linked to this issue:
https://gitcoin.co/issue/status-im/status-react/6601/1784 (320 DAI, work started)
https://gitcoin.co/issue/status-im/status-react/6601/1807 (300 DAI, not started yet)
Is it correct?
Add ethereum/log events | status-im Funded Issue Detail | Gitcoin
Gitcoin is the easiest way to monetize or incentivize work in Open Source Software.
Add ethereum/log events | status-im Funded Issue Detail | Gitcoin
Gitcoin is the easiest way to monetize or incentivize work in Open Source Software.
@Neurone Looks like a mistake. @andytudhope can you take a look at it?
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
__Work for 320.0 DAI (320.0 USD @ $1.0/DAI) has been submitted by__:
@StatusSceptre please take a look at the submitted work:
Issue Status: 1. Open 2. Cancelled
__The funding of 320.0 DAI (320.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter__
Hey @tbenr - sorry, the process of paying out this bounty was a nightmare, due to several user and platform errors crashing into each other 馃槄 Here is your bounty though: https://etherscan.io/tx/0x0df587d43f3107589f039ad47020e606545ff35d8eda917cda1b3a0d7fa90a2b
Ethereum (ETH) detailed transaction info for 0x0df587d43f3107589f039ad47020e606545ff35d8eda917cda1b3a0d7fa90a2b
Doh!
I lost my first gitcoin submission record!
Btw thanks for paying out 馃憤
Yeah, I'm really sorry about that 馃槥 We'll make sure to make it up to you on the next one - plenty more extension bounty issues now available!