Ankr Json-RPC End-Point

This is a guide on how to obtain the Nuls 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):

https://app.ankr.com/apps/details/app-17f65f75-b04e-4eb7-b133-703394258d86

Simple Json-RPC Request

// Request:
curl -s -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getInfo","params":[1], "id":1234}' http://<your-app-id>.ankr.com
// Result:
{
"jsonrpc": "2.0",
"id": "1234",
"result": {
"networkHeight": 41493,
"isRunSmartContract": true,
"chainId": 1,
"agentAsset": {
"symbol": "NULS",
"chainId": 1,
"assetId": 1,
"decimals": 8
},
"localHeight": 41493,
"magicNumber": 20191222,
"defaultAsset": {
"symbol": "NULS",
"chainId": 1,
"assetId": 1,
"decimals": 8
},
"isRunCrossChain": true
}
}

In the next sections, we will describe some of the RPC requests. Most of them can be found in the official documentation for NULS API Service or Public service API, both of which we currently support.