ironfish
ironfish copied to clipboard
Add http support for RPC
Summary
Add http support for RPC
Testing Plan
Run node with --rpc.tcp
and access http://localhost:$rpcTcpPort+1
. Example curl http://localhost:8021/node/getStatus
.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and what additional work is required, if any.
[ ] Yes
[x] No
I think the current RPC interface of TCP and IPC is not very convenient to call with go,java and etc. This implementation base on HTTP , and streaming by websocket.
This should go in their own adapters. I can move this code, or you can, if you have time.
This should go in their own adapters. I can move this code, or you can, if you have time.
Glad to have this feature endorsed. We will refactor the code.
Oh yeah, this is actually a very important feature that's on our roadmap. We're super glad to have this contribution.
I'm planning to support standard JSON 2.0 compatible interface for ironfish rpc call over http. Should I open another PR here since there is a PR open for http request. I have opened a FIP for what I want to do JSONRPC
Ok, I think we should port all of our adapters to use JSON RPC, I'm just not sure how it should work for our streaming responses. I'll have to look at the JSON RPC 2.0 spec. I'll comment on the FIP. Obviously an HTTP adapter won't support streaming responses.
Ok, I think we should port all of our adapters to use JSON RPC, I'm just not sure how it should work for our streaming responses. I'll have to look at the JSON RPC 2.0 spec. I'll comment on the FIP. Obviously an HTTP adapter won't support streaming responses.
I recommend steaming to use the websocket, which is no problem in my PR.
It should be better if it can support JSON RPC 2.0, many other famous chains are using it.
I'm gonna close this PR, but I'm gonna finish and port the HTTP portion here. When we finish it we'll give you some PR credit since my work is based off of yours. https://github.com/iron-fish/ironfish/pull/2423