Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Support external RPC servers via IPC #1434
This adds support for external RPC servers that communicate with the node via IPC (currently domain sockets and tcp).
Using external web servers can benefit service scalability and security. IPC connections are persistent, which should reduce time_wait (file descriptor exhaustion) issues on busy servers.
The internal RPC server can thus be disabled in the config, yet have the functionality exposed via IPC. The JSON format is exactly the same as the internal server - clients only need to change URL.
A proof-of-concept REST server in Go is available at https://github.com/nanocurrency/rpc-go.
The IPC gateway allows for other message payloads like protobuf (there's a PR for protobuf which would need some work to work with this PR)
Technically, the IPC gateway defines a simple framing format with an encoding flag. In this case, the encoding is 1 (json rpc) which expects a payload of 32-bit big-endian size + json, which is also the case for the response. The json payload is forwarded to the node's existing RPC action handler. More info will be added to the wiki.
To test the rpc-go server, enable either tcp or local ipc in the node config. Do the corresponding change in rpc-go's config.json (which uses domain sockets by default)
The rpc_enable flag can still be active, to access the current RPC server.
Dec 8, 2018
2 times, most recently
Dec 9, 2018
FYI if anyone else runs into this issue... after updating to the latest commit on this PR, the node could no longer deserialize the config. It was missing the
I am getting an exception that's crashing the node when attempting to call
The call I'm making is:
And the crash message is:
I'm running this node on macOS 10.14.2.