1

Is there a way to check if my neighbors are synced?

I had a synced node (using the DB and 2 swarmnodes) and then added some neighbors (7). Since then, it seems that my node stopped being synced and does barely make any progress. Can it be that the nodes I am connected to aren't in sync? And if so, how can I spot those?

1

Using the IRI API, you can use getNeighbors to get the addresses and then getNodeInfo to obtain the latestSolidSubtangleMilestoneIndex and latestMilestoneIndex.

Only works if the neighbors have open APIs.

cURL examples, courtesy of https://iota.readme.io:

curl http://localhost:14265 \
  -X POST \
  -H 'Content-Type: application/json' \
  -H 'X-IOTA-API-Version: 1' \
  -d '{"command": "getNeighbors"}'

returns

{
    "duration": 37,
    "neighbors": [
        {
            "address": "/8.8.8.8:14265",
            "numberOfAllTransactions": 922,
            "numberOfInvalidTransactions": 0,
            "numberOfNewTransactions": 92
        },
        {
            "address": "/8.8.8.8:5000",
            "numberOfAllTransactions": 925,
            "numberOfInvalidTransactions": 0,
            "numberOfNewTransactions": 20
        }
    ]
}

Which you can use with

curl [neighbor] \
  -X POST \
  -H 'Content-Type: application/json' \
  -H 'X-IOTA-API-Version: 1' \
  -d '{"command": "getNodeInfo"}'

to get

{
    "appName": "IRI",
    "appVersion": "1.0.8.nu",
    "duration": 1,
    "jreAvailableProcessors": 4,
    "jreFreeMemory": 91707424,
    "jreMaxMemory": 1908932608,
    "jreTotalMemory": 122683392,
    "latestMilestone": "VBVEUQYE99LFWHDZRFKTGFHYGDFEAMAEBGUBTTJRFKHCFBRTXFAJQ9XIUEZQCJOQTZNOOHKUQIKOY9999",
    "latestMilestoneIndex": 107,
    "latestSolidSubtangleMilestone": "VBVEUQYE99LFWHDZRFKTGFHYGDFEAMAEBGUBTTJRFKHCFBRTXFAJQ9XIUEZQCJOQTZNOOHKUQIKOY9999",
    "latestSolidSubtangleMilestoneIndex": 107,
    "neighbors": 2,
    "packetsQueueSize": 0,
    "time": 1477037811737,
    "tips": 3,
    "transactionsToRequest": 0
}
  • Thanks you! Is the "InvalidTransactions" and indicator, that a neighbors' node is not in sync? – codepleb Apr 24 '18 at 14:24
  • The numberOfInvalidTransactions simply counts how many of the transactions recieved from that neighbor are invalid. It doesn't necessarily mean that the neighbor node is currently out of sync (as the invalid tx could have been transmited some time ago), but if that value is increasing I think it could definitely count as an indicator. Also keep in mind, that invalid in this case could mean "malformed", not strictly a tx that is invalid tangle-consistency-wise. – Xilis Apr 24 '18 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.