sync_info - Monero

Example code for the sync_info JSON-RPC method. Complete guide on how to use sync_info JSON-RPC in GetBlock Web3 documentation.

This method returns synchronization status for the node, including peers it is syncing from and per-peer progress. Useful for diagnosing sync stalls.

Parameters

  • None

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "sync_info",
    "params": {},
    "id": "getblock.io"
}'

Response Example

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "credits": 0,
        "height": 3194582,
        "next_needed_pruning_seed": 0,
        "overview": "[]",
        "peers": [
            {
                "info": {
                    "address": "192.0.2.1:18080",
                    "current_download": 0,
                    "current_upload": 0,
                    "height": 3194582,
                    "incoming": false,
                    "ip": 16777343,
                    "live_time": 12345,
                    "peer_id": "abcdef0123456789",
                    "port": "18080",
                    "pruning_seed": 0,
                    "recv_count": 1000,
                    "recv_idle_time": 0,
                    "send_count": 1000,
                    "send_idle_time": 0,
                    "state": "normal",
                    "support_flags": 1
                }
            }
        ],
        "status": "OK",
        "target_height": 0,
        "top_hash": "",
        "untrusted": false
    }
}

Response Parameters

Field
Type
Description

result.height

unsigned int

Current node height

result.target_height

unsigned int

Target sync height (0 when fully synced)

result.peers

array

List of peers and their connection state

result.peers[].info.address

string

Peer address

result.peers[].info.height

unsigned int

Peer's reported height

result.peers[].info.state

string

Connection state with this peer

Use Cases

  • Diagnosing sync issues

  • Per-peer download/upload monitoring

  • Detecting eclipse-attack scenarios in self-hosted setups

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?