Implement JSON-RPC server
A JSON-RPC server is required for communicating with Raylz. By the end of this guide, you'll be able to configure a server solution for your financial institution.
Raylz supports all standard JSON-RPC API endpoints through three transport protocols: HTTP, WebSocket, and IPC sockets. Users can enable protocols through command-line flags provided at startup.
Ethereum JSON-RPC APIs adhere to a namespace system, with RPC methods categorized by function. RPC methods can be enabled on a per-namespace basis. Method names follow the format [namespace]_[method name]
, as shown by the eth
namespace and the eth_call
method.
HTTP
HTTP is a unidirectional transport protocol that connects clients and servers. Requests are initiated by the client, and the server returns a response. The HTTP connection closes after this interaction.
To launch an HTTP server in Raylz, use the --http
flag on the command line.
You can specify an address and port to listen to with --http.addr
and --http.port
.
HTTP access to JSON-RPC method namespaces isn't automatic. Whitelist the APIs with the --http.api
flag .
[code here]
CORS support can be configured with --http.corsdomain
to protect against web page misuse.
[code here]
WebSocket
WebSocket is a bidirectional transport protocol that allows continuous connections between clients and servers.
Configure WebSocket access with --ws
. Provide a port to listen on with --ws.port
, and enable APIs with --ws.api
.
Cross-origin protect can be enabled with --ws.origins
.
[code here]
IPC
IPC connects the node and console on the same machine. UNIX machines use UNIX domain sockets, while named pipes are utilized on Windows.
By default, IPC is enabled and allows access to all JSON-RPC namespaces.
Use --ipcpath
to customize the IPC path.
[code here]
Disable IPC with --ipcdisable
.
[code here]
IPC does not support remote connections.
Refer to this page to configure event notifications for your server.
Last updated