After discussion with the developer building the TypeScript version of XRouter, we have agreed on a standard schema for 'mostCommonReply`:
mostCommonReply is renamed to the consensus object.
- Go-XRouter output shall be in JSON as per the following example:
{
"consensus":{
"majorityStrength": "57%",
"mostCommonReplyCount": 4,
"mostCommonReply": ["reply"],
"divergentReplyCount": 3,
"divergentReplies": [
{"count": 2, "reply": ["reply"]},
{"count": 1, "reply": ["reply"]}
]
},
"queryCount":"Failed to find enough peers supporting xrGetBlockCount for xr::BLOCK whose fees fall within the limits set in your config file. You requested responses from 12 nodes, but only got 7. Please try to connect to more peers before retrying the request."
}
Parameters
| Parameter |
Type |
Description |
| consensus |
object |
XRouter's "consensus" response |
| majorityStrength |
string |
The proportion, as a percentage, of mostCommonReplyCount relative to the sum of mostCommonReplyCount and divergentReplyCount |
| mostCommonReply |
array |
The reply object in snodeReply most commonly returned by service nodes |
| divergentReplyCount |
int |
The number of replies nonidentical with mostCommonReply |
| divergentReplies |
array |
An arrayed list of replies that diverge from mostCommonReply |
| count |
int |
the number of service nodes that responded with the divergentReply in question |
| reply |
array |
the reply object in snodeReply returned by the service node(s) in question |
| queryCount |
string |
Message used to flag when the number of service nodes that XRouter could find to response to a query is low than the number specified in queryCount |
Flow diagram (draft)

After discussion with the developer building the TypeScript version of XRouter, we have agreed on a standard schema for 'mostCommonReply`:
mostCommonReplyis renamed to theconsensusobject.{ "consensus":{ "majorityStrength": "57%", "mostCommonReplyCount": 4, "mostCommonReply": ["reply"], "divergentReplyCount": 3, "divergentReplies": [ {"count": 2, "reply": ["reply"]}, {"count": 1, "reply": ["reply"]} ] }, "queryCount":"Failed to find enough peers supporting xrGetBlockCount for xr::BLOCK whose fees fall within the limits set in your config file. You requested responses from 12 nodes, but only got 7. Please try to connect to more peers before retrying the request." }Parameters
mostCommonReplyCountrelative to the sum ofmostCommonReplyCountanddivergentReplyCountreplyobject insnodeReplymost commonly returned by service nodesmostCommonReplymostCommonReplyreplyobject insnodeReplyreturned by the service node(s) in questionqueryCountFlow diagram (draft)