Ankr JSON-RPC Endpoint

Obtaining the Ankr endpoint for Near and making a simple request

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 Endpoint URL will have the following format:

http://<your_app_id>.ankr.com

Example (as shown in the image above):

http://app-adba3ff3-03b8-40e7-aafb-a4510ae5597a.cls-dec3c32b-4f06-462f-b827-dee931d39a72.ankr.com

JSON-RPC request example

//request
curl --location --request POST 'app-adba3ff3-03b8-40e7-aafb-a4510ae5597a.cls-dec3c32b-4f06-462f-b827-dee931d39a72.ankr.com' --header 'Content-Type: application/json' --data-raw '{ "jsonrpc": "2.0", "id": 1, "method": "hmyv2_getBlockByNumber", "params": [ 1, { "fullTx": true, "inclTx": true, "InclStaking": true } ] }'
//response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": 0,
"epoch": 0,
"extraData": "0x",
"gasLimit": 4716988,
"gasUsed": 0,
"hash": "0xb7d7359c895324437af941838bdd44dbc03eb1a5ead433866bb117ea5a27318a",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "one1xdnm2fj6hyk7e49af2h9dmudkdlta9q354094e",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": 0,
"number": 1,
"parentHash": "0xdfeff1fba1aeed89fb75ef4ee9bf9e0fca1ff9b26d78d471565bf151f965274b",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"size": 601,
"stakingTransactions": [],
"stateRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"timestamp": 1561736307,
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": [],
"viewID": 0
}
}

In the next section, you will find a detailed description of the provided Harmony APIs which can also be consulted in the Harmony Official Documentation