-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
rpc: new RPC implementation with pub/sub support #2035
Conversation
Current coverage is
|
A few things I've noticed while adding the
|
Also I think naming these API handlers as |
Just so that it's not lost, here's my PR against this PR bas-vk#1 |
@karalabe, made the rename changes as proposed. |
I second Peter that Service is better avoided as a field name in |
As for the api naming. I agree that its best to just call it |
Also, if we all get pedantic about naming of services, protocols then I gotta say, the web3.js selectors aka rpc.Api#Namespace should also be: ethereum, swarm and whisper, not eth, shh, bzz. |
|
||
web3 := utils.NewPublicWeb3Api(stack) | ||
server.RegisterName("web3", web3) | ||
net := utils.NewPublicNetApi(stack.Server(), ethereum.NetVersion()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only use of ethereum here. NetVersion should clearly not be there.
32fefdb
to
4b28705
Compare
Found during testing: JSON-RPC notifications sent by the client generate a response with id 0. Please fix. |
When I was requesting to rename "Api" to "API", I probably should've said that this also applies to things like "PublicEthereumApi". |
Can the core APIs be moved out of package core please? I tried moving it to package eth and a bunch of work is required to make it work (can't access Another issue with the APIs in package core is that even though they are supposed to be "public", |
} | ||
} | ||
|
||
responses[i] = codec.CreateResponse(req.id, reply[0].Interface()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find a way to share this code (inside the for loop) with exec
.
4b28705
to
f3fcf67
Compare
"logIndex": rpc.NewHexNumber(r.Index), | ||
"blockHash": r.BlockHash, | ||
"transactionHash": r.TxHash, | ||
"transactionIndex": rpc.NewHexNumber(r.TxIndex), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpc.NewHexNumber(...)
here should be replaced by fmt.Sprintf("%x", ...)
to avoid the dependency on rpc.
d1e2312
to
eae8146
Compare
👍 |
I've skimmed through the PR before building my own admin/debug ports on top of it and it seemed solid. Apart from a few issues I've mentioned above and were already sorted out; and a few cleaning refactoring that will either way get done as we're progressing with the RPC updates, it seems ok for me. 👍 |
rpc: new RPC implementation with pub/sub support
* integrate #2035 via latest develop. fixes #2041 * refactor apis * fix tests for windows, add simple download test * separate dns api and chequebook api * http proxy api in separate subpackage * remove legacy rpc code partially, adding only legacy to make v2 work * TODO: add dns tests see #2048 * TODO: further refactor due to #2040
* integrate #2035 via latest develop. fixes #2041 * refactor apis * fix tests for windows, add simple download test * separate dns api and chequebook api * http proxy api in separate subpackage * remove legacy rpc code partially, adding only legacy to make v2 work * TODO: add dns tests see #2048 * TODO: further refactor due to #2040
* integrate #2035 via latest develop. fixes #2041 * refactor apis * fix tests for windows, add simple download test * separate dns api and chequebook api * http proxy api in separate subpackage * remove legacy rpc code partially, adding only legacy to make v2 work * TODO: add dns tests see #2048 * TODO: further refactor due to #2040
* integrate #2035 via latest develop. fixes #2041 * refactor apis * fix tests for windows, add simple download test * separate dns api and chequebook api * http proxy api in separate subpackage * remove legacy rpc code partially, adding only legacy to make v2 work * TODO: add dns tests see #2048 * TODO: further refactor due to #2040
* integrate #2035 via latest develop. fixes #2041 * refactor apis * fix tests for windows, add simple download test * separate dns api and chequebook api * http proxy api in separate subpackage * remove legacy rpc code partially, adding only legacy to make v2 work * TODO: add dns tests see #2048 * TODO: further refactor due to #2040
all: pull snap sync PRs from upstream v1.13.5
This PR includes a new RPC implementation that is build on top of the new node architecture in the node. It adds support for pub/sub.
The new implementation lacks support for the
admin
anddebug
modules which the current interface provides since there is a debate how we can accommodate these in the new architecture.Therefore a new flag
--ipcexp
flag is added. This will start the new RPC implementation. By default the old IPC interface is started.closes #1935