Start Version Stat Collection#
start_version_stat_collectionAPI-v2start_version_stat_collection#
The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method.
Request Parameters#
| Parameter | Type | Required | Description |
| interval | integer |
✓
| polling rate (in seconds) to check node versions |
Response Parameters#
| Parameter | Type | Required | Description |
| result | string |
✓
| The outcome of the request. |
📌 Examples#
Command#
{
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
}
curl --url "http://127.0.0.1:7783" --data '{
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
}'
import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2))
const payload = {
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json());
<?php
$payload = <<<'JSON'
{
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"mmrpc":"2.0","method":"start_version_stat_collection","userpass":"RPC_UserP@SSW0RD","params":{"interval":600}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"mmrpc": "2.0",
"method": "start_version_stat_collection",
"userpass": "RPC_UserP@SSW0RD",
"params": {
"interval": 600
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body))
Show Start Version Stat Collection Response
Response (success)#
{
"mmrpc": "2.0",
"result": "success",
"id": null
}
Error Types#
| Parameter | Type | Required | Description |
| DatabaseError | string |
–
| Database constraint error occurred. |
Show Error Responses
⚠️ Error Responses#
DatabaseError#
{
"mmrpc": "2.0",
"error": "Database error: UNIQUE constraint failed: nodes.peer_id",
"error_path": "lp_stats",
"error_trace": "lp_stats:124]",
"error_type": "DatabaseError",
"error_data": "UNIQUE constraint failed: nodes.peer_id",
"id": null
}