Ankr Json-RPC Endpoint

How to obtain the JSON-RPC Endpoint URL from your Ankr Node

Get the Endpoint URL

After successfully deploying a node on Ankr you can get the endpoint from the Application details section as seen below:

The RPC Endpoint has the following format:

http://<your_app_id>.ankr.com

Example (as shown in the image above):

http://app-c3409762-9ee5-4566-be67-315cb9f9a717.cls-dec3c32b-4f06-462f-b827-dee931d39a72.ankr.com

JSON-RPC request example

//Request
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_nodeRoles"}' app-c36a470b-c59f-4364-8256-7691c78cac24.cls-593f3f46-316e-4f00-8ebd-9a45cfde390d.ankr.com
//Response
{
"jsonrpc": "2.0",
"result": {
"block": {
"extrinsics": [
"0x280402000b505b4cc56e01",
"0x1c0409003a0d0300",
"0x1004140000"
],
"header": {
"digest": {
"logs": [
"0x064241424534024b000000331da60f00000000",
"0x054241424501014e97b8eb9d05e229be40b1f1e9900468de28081f0d6c71d7b25e99866664d11f097a7fb9ff93fe48b38a60dfad8cbd64887a19576ae39e1589fb4f835f752088"
]
},
"extrinsicsRoot": "0x8bd4055ccf3d29fb81c20f1be6d0a26c41cf2cffdb6ef9b7e697472336756566",
"number": "0xc350",
"parentHash": "0xadd46abd2d58793c95f1a59ef4a06c725bae9586620d43f6021b5d7647d12f42",
"stateRoot": "0x808d486319f8b72b04e2e3aa03f66c144c359323882d458a731b9b78dbea7356"
}
},
"justification": null
},
"id": 1
}

In the next section, you will find a detailed description of the provided Near API endpoints which can also be consulted in the Polkadot official documentation