How To Access Karura via Substrate RPC API

Learn how to access Karura via Substrate RPC API.

Step 1: To access Karura via the available Substrate RPC methods, use the native access endpoint with /para-http-rpc at the end:

  • Network: Karura Mainnet
  • Request Type: POST
https://svc.blockdaemon.com/karura/mainnet/native/para-http-rpc

Step 2: You should authorize your request. Learn more: Authentication Guide

Step 3: Specify a Substrate RPC method in the request body:

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "YOUR_METHOD",
    "params": []
}

Example Request for Substrate RPC API

Here is a cURL example for using system_syncState to get the chainspec running the node, with a sync state, in Karura Mainnet:

curl -X POST \
https://svc.blockdaemon.com/karura/mainnet/native/para-http-rpc \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "system_syncState", "params": []}'

The following is a typical response you will get:

{
    "jsonrpc": "2.0",
    "result": {
        "startingBlock": 2414982,
        "currentBlock": 2461542,
        "highestBlock": 2461542
    },
    "id": 1
}