-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client JSON-RPC Support (old) #982
Comments
How can we approach this? I'm lost, here is my general impression: |
some clue from ganache-core it should be a good start to use node.js built-in web server since JSON-RPC only has a single endpoint. express is pretty powerful with route path config and static file host, but JSON-RPC doesn't need these features. maybe we should go with built-in HTTP server? |
before go deep into this issue I want to have a rough WIP commit to see if we are on the same page, here we go: yurenju/ethereumjs-client@6d917a5 This is WIP commit only to verify the idea. This commit refers py-evm implementation to have a $ node lib/index.js --rpc and use curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1b4", true],"id":1}' http://127.0.0.1:8545 then you should get @holgerd77 any thought? Is it too rough? Let me how should I contribute on this issue :D |
@yurenju cool that you are taking on this! From a first look I would say that this is going into the right direction. I am in Croatia on holidays at the moment, so can't look into this deeper, back on the weekend and will have a closer look next week. If you want you can already submit this as a PR and we can continue from there or you can await a deeper review, as you like. |
Cool, if this is the right direction I would like to finish one API call like btw I also went Croatia last year, pretty cool country especially Rovinj & Dubrovnik. enjoy your vacation and no rush to reply here!! |
PR ethereumjs/ethereumjs-client#30 is sent |
Issue #17: Implemented eth_getBlockByNumber()
@yurenju Thanks for putting together a clean and solid foundation for RPC. Should i implement eth_protocolVersion , or you guys are already working on it.Let me know which ones i can pickup to implement. |
@bit-warrior, I'm not working on it so go ahead for it, thank you :D I will take a few weeks to work on another side project so feel free to implement the rest of APIs! |
@yurenju @bit-warrior I'd like to work on these too! :) @bit-warrior can we coordinate, are you working on anything else other than |
As @yurenju noted, the RPC methods are already implemented javascript in truffle/ganache. So much of that code would be duplicated here (unless refactored out of truffle). Also, it would be good to do this in a test-driven way (TDD). It will take some work but a start is it at http://cdetrio.github.io/eth-compat-table |
I see some RPC testing scripts was added in ethereumjs/ethereumjs-client#30 . There is already a graveyard of umpteen unmaintained rpc test runners already, it would be good to standardize on one cross-client RPC test suite. See also ethereum/EIPs#217 |
@cdetrio Any suggestion on how to continue with this regarding the truffle/ganache overlap? |
Maybe @benjamincburns (from Truffle/Ganache) wants to join the discussion here. |
@cdetrio http://cdetrio.github.io/eth-compat-table seems pretty cool, and we should leverage that. I notice it was forked from ethereum/interfaces, I'm not familar with EIP process, will it be merged back to upstream via PR? |
@fgimenez sorry i missed to reply you earlier. I have started with the easy ones :-) i m working on below right now After that i m looking to implement "eth_getTransactionByHash" but not sure how to get data. |
@bit-warrior no worries :) Nice, I'll take |
Thanks for the shoutout @holgerd77 - is there anything I can do to help out? As an aside, the metamask folks are working on a new iteration of their provider engine for implementing parts of the RPC. We haven't switched over to it in Ganache yet, but it looks nice. Might be worth a peek. https://github.com/kumavis/json-rpc-engine cc @kumavis |
@benjamincburns Thanks for letting us know, we will definitely have a closer look here. |
I've opened a PR for |
|
I guess |
@ryanio I've read in some internal chats - I think from someone from the geth team - that RPC methods would be valuable for debugging and comparing results when clients are joining the Yolo testnet. So if you are not sure what to work on next adding (some) RPC methods is always a good candidate I guess. Maybe you want to have a closer look what might be the more useful ones to have, not sure, haven't given this any thought yet (others can suggest as well of course). |
@holgerd77 sounds good, I really like the setup of the RPC modules code with the methods on the classes, it makes it natural to use in TypeScript. I'm seeing that it's currently callback based though, I can start with a PR updating it to async/promises then start adding some useful methods. I started a tracking table in #1114 to visualize some more namespaces I found. |
Ok, great! 😄 Will then close here in favor of #1114 |
Description
Implementation of the
JSON-RPC
interface as described in https://github.com/ethereum/wiki/wiki/JSON-RPC.This encompasses a server implementation and the implementation of the various API calls.
Possible Implementation
It probably best to start with an early-on implementation of 2-3 exemplary API calls and then refine this for some time to work out a good internal structure to build upon and extend with the further calls.
There are various Javascript libraries out there touching the topic, not sure if any can be of help here or be integrated/used, this should be examined more closely.
UI
The RPC server should be constantly running and be available via some configured address and port.
Implement all JSON-RPC Endpoints
Update (2018-07-10): This has been adressed in ethereumjs/ethereumjs-client#30 by @yurenju, providing a very solid structure for implementation and testing. It is now possible to implement the single RPC endpoints (limited by the functionality already implemented in the core client code).
Checklist of endpoints to support, and which are supported in master or pull requests (taken from Py-EVM:
Note: On a first round I've just copied over all calls, this might be limited by functionality which eventually shall not be implemented in the client (mining related stuff e.g.).
Reference Implementations / Links
The text was updated successfully, but these errors were encountered: