Ankr Json-RPC End-Point

How to obtain the Ankr End-Point and execute a simple request.

Obtain Ankr End-point

After successfully deploying an Ankr Full node, the End-point can be found on the application details, on the left side of the screen:

The RPC endpoint will have the following format:

http://<your-app-id>.ankr.com

Example (as shown in the image above):

app-36563e5b-a1f5-4e44-8b47-796734c5bf04.cls-a91a7dbc-1a23-42f6-a66f-876094349f03.ankr.com

Simple JSON-RPC Request

Zcash RPC API requires basic authentication. Secure the RPC API by specifying the username and password.

// Request
curl --user user:password --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://<your-app-id>.ankr.com
// Result
{
"result": {
"chain": "main",
"blocks": 40352,
"headers": 63110,
"bestblockhash": "000000000e34b65a4bac36b65d9bab8b2b78e8f53f246ae9ffed24ff208f4572",
"difficulty": 1046848.846261654,
"verificationprogress": 0.01205049770700389,
"chainwork": "0000000000000000000000000000000000000000000000000000c3a6dbb93b5b",
"pruned": false,
"size_on_disk": 900180554,
"estimatedheight": 1011470,
"commitments": 130574,
"valuePools": [
{
"id": "sprout",
"monitored": true,
"chainValue": 4479.26073988,
"chainValueZat": 447926073988
},
{
"id": "sapling",
"monitored": true,
"chainValue": 0,
"chainValueZat": 0
}
],
"softforks": [
{
"id": "bip34",
"version": 2,
"enforce": {
"status": true,
"found": 4000,
"required": 750,
"window": 4000
},
"reject": {
"status": true,
"found": 4000,
"required": 950,
"window": 4000
}
},
{
"id": "bip66",
"version": 3,
"enforce": {
"status": true,
"found": 4000,
"required": 750,
"window": 4000
},
"reject": {
"status": true,
"found": 4000,
"required": 950,
"window": 4000
}
},
{
"id": "bip65",
"version": 4,
"enforce": {
"status": true,
"found": 4000,
"required": 750,
"window": 4000
},
"reject": {
"status": true,
"found": 4000,
"required": 950,
"window": 4000
}
}
],
"upgrades": {
"5ba81b19": {
"name": "Overwinter",
"activationheight": 347500,
"status": "pending",
"info": "See https://z.cash/upgrade/overwinter/ for details."
},
"76b809bb": {
"name": "Sapling",
"activationheight": 419200,
"status": "pending",
"info": "See https://z.cash/upgrade/sapling/ for details."
},
"2bb40e60": {
"name": "Blossom",
"activationheight": 653600,
"status": "pending",
"info": "See https://z.cash/upgrade/blossom/ for details."
},
"f5b9230b": {
"name": "Heartwood",
"activationheight": 903000,
"status": "pending",
"info": "See https://z.cash/upgrade/heartwood/ for details."
},
"e9ff75a6": {
"name": "Canopy",
"activationheight": 1046400,
"status": "pending",
"info": "See https://z.cash/upgrade/canopy/ for details."
}
},
"consensus": {
"chaintip": "00000000",
"nextblock": "00000000"
}
},
"error": null,
"id": "curltest"
}

In the next sections, we will describe some of the RPC requests, most of them can be found in the Official Documentation.