Skip to main content
Version: ACE 4

JSON RPC

Overview

JSON RPC allows making remote procedure protocol network requests encoded in JSON. It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered asynchronously.

More details in JSON RPC Wikipedia and JSON RPC Specification

Configuration

  • Target path - the doc node you wish the existing doc nodes to be attached to
  • End point
    • url - the url to which to execute the JSON RPC call
    • HTTP method - the http method for the call
  • JSON-RPC Request Object - allows setting multiple
    • JSON-RPC Method Name - method name for the call
    • JSON-RPC ID
    • JSON-RPC Params
  • the query params to send in the rest request
  • The HTTP headers to send in the rest request
  • Store target path results in cache - if checked will store the response in ACE cache
  • Cache Key - if specified, will be used as key to store the cached response
  • Cache clean-up condition - If condition is true, then step cache is cleared and data is not cached, else if condition is false or not defined, then step behaves as usually.
  • TTL cache (minutes) - time for how long in minutes to hold the results in cache

Examples

Example flow
{
"flow": {
"name": "jsonRpcExample",
"description": "",
"steps": [
{
"stepType": "jsonrpc",
"color": "rgb(247,225,211)",
"displayName": "JSON-RPC2.0",
"isSelected": true,
"config": {
"endpoint": {
"url": " https://api.devnet.solana.com",
"httpMethod": "POST"
},
"jsonRpc": [
{
"params": [],
"id": "1",
"method": "getBlockHeight"
}
],
"targetPath": "result",
"headers": {
"Content-Type": "application/json"
},
"queryParams": {}
},
"textColor": "black"
}
]
},
"tags": [
"general"
],
"inputSchema": {},
"inputSchemaLabel": "",
"version": 1,
"id": "7a099af3-5459-4901-b0cb-da7d0f1f0eb4"
}
Flow Result
{
"doc": {
"result": {
"jsonrpc": "2.0",
"result": 170132414,
"id": "1"
}
},
"errors": [],
"performance": {
"steps": [
{
"step": "jsonrpc",
"executionTime": 508
}
],
"executionTimeOfFlow": 508,
"timeMetric": "ms"
}
}