-
Notifications
You must be signed in to change notification settings - Fork 146
Implement all JSON-RPC endpoints #26
Comments
eth_syncing would be good so we can get a node up on ethstats.net 👍 |
@MysticRyuujin yes, we should be able to get that one done quite easily. Will try to get a release out today with that endpoint enabled. |
Quick question: @pipermerriam I think you mentioned that you don't want the JSON-RPC exposed via HTTP directly because there's some tooling developed that exposes a standard HTTP JSON API Server that can connect to any of the popular nodes. Do you have a pointer for that? And as a follow up question, do I understand it correctly that as of today, the only way for people to connect to the JSON-RPC API is to write this sort of boilerplace code themselves? If yes, would it be reasonable to at least implement some sort of CLI command to give uses something to test out the JSON-RPC API without implementing such boiler plate code on their end? |
@cburgdorf I think users can use
|
@voith Yes, that's true and in fact, I guess that is the preferred way for most use cases. However, that only exposes you to an interface of web3 which then talks to the JSON-RPC API itself. So, if the underlying JSON-RPC API exposes an API that web3 does not support there's no simple way to run requests against the underlying JSON-API directly I assume. However, I realize that web3 basically seems to expose the entire underlying API so that may just be the way to go 👍 |
IMO, web3 should implement all the API's mentioned in the JSON-RPC spec. Also, web3 has node specifc modules eg. parity. If |
Yes, I guess from a users perspective web3 seems the go to solution to query the API. 👍 I'd still be interested to learn deeper about the generic JSON RPC HTTP API that @pipermerriam mentioned at some point. I think connecting to a local node via HTTP would be quite common (e.g. building some sort of website interface that sits on top of a local node) but if I recall correctly Piper mentioned he doesn't want to include such a server in Trinity directly because there's a generic solution being developed that would work with any node (geth, trinity, parity etc) making such functionality directly in Trinity redundant. |
@cburgdorf I just did a quick search and can't seem to find it. I'll let you know when I do. Regardless of whether that tool is being actively developed or looks promising, I still want to hold out on the HTTP API to reduce scope. Since we can get at all of these things using web3.py I think this should be sufficient but let me know if I'm missing something. |
I don't know if it's possible to use Trinity with MEW or MyCrypto w/o HTTP API? Just a thought. |
The IPC -> HTTP daemon: https://github.com/ethereum/cpp-ethereum/blob/develop/scripts/jsonrpcproxy.py |
I just noticed that admin.nodeInfo doesn't work and it's not on this list. Will that be supported? |
@MysticRyuujin That method is non-standard across geth/parity, also not in the closest thing we have to a json-rpc standard. I expect us to implement something like it, maybe at a different endpoint name. Either way, the method is not part of this particular issue, which is focused on the endpoints from that "spec". |
!!!!!!!!!!!!!!!!!!!!!!!!! YES !!!!!!!!!!!!!!!!!!!!!!!!! So glad someone is EIP-ing this. |
@pipermerriam @carver all the
The ticks have to be updated likewise I guess. |
Also I want to kind of complete these, so that the API would be in a better state. I want to start off with the first 3 modules and I was thinking of the following approach.
|
Getting a useful estimate of gas price is notoriously difficult to do well. Check out some other attempts here: https://github.com/ethereum/web3.py/blob/master/web3/gas_strategies/time_based.py I think it's okay to do something simple, but I don't think the --
|
One place to start is the existing tests of some other endpoints, here: https://github.com/ethereum/py-evm/blob/master/tests/trinity/core/json-rpc/test_ipc.py |
@pipermerriam @carver I just noticed the |
Since we don't support mining my opinion is:
|
RE: Average mechanism seems fine though it will return Which suggests this should eventually be pluggable which makes me think that initial implementation should be dead simple since we'll very likely replace it with something that a user can control (probably via a plugin). |
|
@pipermerriam we could probably cache the most recent |
@pipermerriam as part of implementing EDIT : I would also like to add this method to the |
I believe we can close this for the same reason that we closed #20 (they seemed fairly overlapping) but feel free to reopen in case I misunderstood. |
Yeah, I think the "write" methods were the main difference, and since trinity won't host keys for the foreseeable future, I'm good with closing 👍 |
Checklist of endpoints to support, and which are supported in master or pull requests
web_*
methodsweb3_clientVersion
Fix ordering of p2p.abc module #834web3_sha3
Add get_cmd_id_offsets helper function #836net_*
methodsnet_listening
net_peerCount
net_version
Relocatebcc_libp2p/factories.py
#840eth_*
write methodseth_*
read-only methodseth_protocolVersion
eth_syncing
eth_coinbase
eth_mining
eth_hashrate
eth_gasPrice
eth_accounts
eth_blockNumber
eth_getBalance
eth_getStorageAt
eth_getTransactionCount
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getUncleCountByBlockHash
eth_getUncleCountByBlockNumber
block inteth_getUncleCountByBlockNumber
block stringeth_getCode
eth_call
eth_estimateGas
eth_getBlockByHash
eth_getBlockByNumber
block inteth_getBlockByNumber
block stringeth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionReceipt
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
block inteth_getUncleByBlockNumberAndIndex
block string(deprecated)eth_getCompilers
eth_getLogs
eth_getWork
The text was updated successfully, but these errors were encountered: