JSON RPC API

JSON RPC API

JavaScript API:

To talk to an KardiaChain node from inside a JavaScript application use the Kardia Javascript SDK library, which gives a convenient interface for the RPC methods.

JSON-RPC Endpoint:

Client
URL

Ratelimit:

JSON-RPC rate limits after exceeding duration request limit. These rate limits are in place to ensure the reliability.
If you are rate limited, your JSONRPC responses will have HTTP Status code 429
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"error": {
5
"code": -32005,
6
"message": "request rate exceeded limit",
7
"data": {
8
"view_more": "https://docs.kardiachain.io/docs/for-developers/rpc/json-rpc-api#ratelimit",
9
"allowed_limit": "15000 requests per 10 minutes",
10
"block_time": "60 minutes"
11
}
12
}
13
}
Copied!

Go:

Start KardiaChain network [README]. Change the default port (8545) and listing address (0.0.0.0) with:

JSON-RPC Support:

Currently, the Go client of Kardia node supports JSON-RPC 2.0 via HTTP.
Additional protocols such as IPC will be supported in the future.

Curl Examples Explain:

The curl options below might return a response where the node complains about the content type. This is because the --data option sets the content type to application/x-www-form-urlencoded . If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the call.
The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. 0.0.0.0:8545

JSON-RPC Methods and Reference:

Click on each method below. It will redirect to a github link which will provide the reference code.
kai_getLogs
Last modified 3mo ago