Skip to main content

Watchdog API

Watchdog is a monitoring service and reward distribution bot.

1. Base Url

https://voyage-rpc.moi.technology/babylon/v2/watchdog/YOUR_API_KEY

Note: Replace YOUR_API_KEY with your unique API key.

2. Authentication

In order to utilize our API key, it is required that you pass the API KEY in the URL.

If you not have API key, we kindly direct you to our Getting Started guide. Here, you will find comprehensive instructions on how to generate a new API key, enabling you to utilize the Watchdog endpoint effectively.

3. Endpoints

Use HTTPS to call a JSON-RPC method. In this example we use curl to make the HTTPS request.

3.1. GET /uptime/:krama_id

Description

This endpoint provides a response containing mention krama_id along with a uptime attribute, presented as a boolean array. The array represents the status of a node, with each record indicating the node's status over a 30-minute time interval.

Parameters

  • unix_from (optional): Unix epoch time in seconds indicating the starting point from which the uptime information will be provided. If not provided, the endpoint will return the uptime status for the last 30 days.

  • unix_to (optional): Unix epoch time in seconds, specifying the endpoint up to which the uptime information will be provided. If not provided, the endpoint will return the uptime status till the current time.

Example

curl 'https://voyage-rpc.moi.technology/babylon/v2/watchdog/YOUR_API_KEY/uptime/3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS'
{
"success": true,
"message": "Successfully retrieved uptime",
"data": {
"krama_id": "3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS",
"uptime": [true, true, true, true, false, true, ...]
}
}

3.2 GET /info/:krama_id

This endpoint returns a response containing the registration timestamp, the timestamp of the last distributed reward, and the total accumulated tokens.

Response

  • krama_id: Represents the unique identifier (Krama ID) associated with the node.
  • registered_timestamp: Epoch Unix timestamp in seconds representing the registration time of the node.
  • timestamp: Epoch Unix timestamp in seconds representing the last time the node received a reward.
  • cumulative_tokens: Represents the total accumulated amount of tokens rewarded to the node.

Example

curl 'https://voyage-rpc.moi.technology/babylon/v2/watchdog/YOUR_API_KEY/info/3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS'
{
"success": true,
"message": "Successfully retrieved info",
"data": {
"krama_id": "3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS",
"timestamp": 1706712289,
"registered_timestamp": 1699982275,
"cumulative_tokens": 36800
}
}

3.3 GET /reward/:krama_id

This endpoint retrieves the total reward tokens distributed to a specific node.

Response

  • krama_id: The unique identifier (Krama ID) associated with the node.
  • tokens: The total reward tokens distributed to the node.

Parameters

  • unix_from (optional): The Unix epoch time in seconds specifying the start point for calculating the rewards. If not provided, the endpoint returns the total rewards since the genesis block.
  • unix_to (optional): The Unix epoch time in seconds specifying the end point for calculating the rewards. If not provided, the endpoint returns the total rewards up to the current time.

Example

curl 'https://voyage-rpc.moi.technology/babylon/v2/watchdog/YOUR_API_KEY/reward/3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS'
{
"success": true,
"message": "Successfully retrieved reward",
"data": {
"krama_id": "3WyjAUkfoVwb3CVRqy4g4jHPYfMtSvQAgJadkRJCYuxnsMKUm58B.16Uiu2HAmKRJM1u3b6DDbmTyoNsCYSYRmmS5dNbkn3w5Vr4jscFwS",
"tokens": 38350
}
}