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
- thedoc
node you wish the existingdoc
nodes to be attached to- End point
url
- the url to which to execute the JSON RPC callHTTP method
- the http method for the call
- JSON-RPC Request Object - allows setting multiple
JSON-RPC Method Name
- method name for the callJSON-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 cacheCache Key
- if specified, will be used as key to store the cached responseCache clean-up condition
- If condition is true, then step cache is cleared, 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
tags:
- general
steps:
- stepType: jsonrpc
config:
endpoint:
url: " https://api.devnet.solana.com"
httpMethod: POST
jsonRpc:
- params: []
id: "1"
method: getBlockHeight
targetPath: result
headers:
Content-Type: application/json
queryParams: {}
name: JSON-RPC2.0
description: ""
condition: ""
sampleData: {}
Flow Result
{
"doc": {
"result": {
"jsonrpc": "2.0",
"result": 170132414,
"id": "1"
}
},
"errors": [],
"performance": {
"steps": [
{
"step": "jsonrpc",
"executionTime": 508
}
],
"executionTimeOfFlow": 508,
"timeMetric": "ms"
}
}