Docs update concerning consensus
This commit is contained in:
+53
-2
@@ -1332,8 +1332,44 @@ The P2NS (Peer-to-Peer Name System) admin backend API, hosted at `https://p2ns.a
|
||||
}
|
||||
```
|
||||
|
||||
### GET /api/consensus/status
|
||||
- **Description**: Returns health and progress of the consensus Autobase sidecar (the sole read path for `getConsensusState`).
|
||||
- **Response**: JSON object with:
|
||||
- `open` (boolean): Whether the sidecar Autobase instance is open.
|
||||
- `ready` (boolean): Whether the sidecar has completed opening.
|
||||
- `writable` (boolean): Whether this node can append sidecar events.
|
||||
- `bootstrapComplete` (boolean): Whether bootstrap or hydration from dnsPass has finished.
|
||||
- `eventCount` (number): Total events applied to the in-memory view.
|
||||
- `domainCount` (number): Domains present in the apply view.
|
||||
- `lastApplyAt` (number|null): Timestamp of the last applied event.
|
||||
- `indexedLength` (number): Autobase indexed length.
|
||||
- `length` (number): Autobase length.
|
||||
- `key` (string|null): Sidecar public key (hex).
|
||||
- **Status Codes**:
|
||||
- `200`: Success.
|
||||
- `500`: Failed to get consensus status.
|
||||
- **Example**:
|
||||
```bash
|
||||
curl -X GET \
|
||||
https://p2ns.admin/api/consensus/status
|
||||
```
|
||||
```json
|
||||
{
|
||||
"open": true,
|
||||
"ready": true,
|
||||
"writable": true,
|
||||
"bootstrapComplete": true,
|
||||
"eventCount": 142,
|
||||
"domainCount": 12,
|
||||
"lastApplyAt": 1704067200000,
|
||||
"indexedLength": 142,
|
||||
"length": 142,
|
||||
"key": "a1b2c3..."
|
||||
}
|
||||
```
|
||||
|
||||
### 61. GET /api/consensus/metrics
|
||||
- **Description**: Retrieves overall consensus metrics including resolution statistics, quorum failures, ties, and validation failures.
|
||||
- **Description**: Retrieves overall consensus metrics including resolution statistics, quorum failures, ties, validation failures, and sidecar health.
|
||||
- **Response**: JSON object with:
|
||||
- `resolutions` (number): Total number of successful domain resolutions.
|
||||
- `quorumFailures` (number): Number of times quorum was not met.
|
||||
@@ -1342,6 +1378,8 @@ The P2NS (Peer-to-Peer Name System) admin backend API, hosted at `https://p2ns.a
|
||||
- `totalVotes` (number): Total number of votes cast across all domains.
|
||||
- `avgVotesPerDomain` (number): Average number of votes per domain.
|
||||
- `domainResolutions` (array): Per-domain resolution statistics with `domain`, `resolved` count, and `failed` count.
|
||||
- `sidecar` (object): Same fields as `GET /api/consensus/status`.
|
||||
- `bootstrapComplete` (boolean): Whether sidecar bootstrap/hydration is complete.
|
||||
- **Status Codes**:
|
||||
- `200`: Success.
|
||||
- `500`: Failed to get consensus metrics.
|
||||
@@ -1369,7 +1407,20 @@ The P2NS (Peer-to-Peer Name System) admin backend API, hosted at `https://p2ns.a
|
||||
"resolved": 3,
|
||||
"failed": 1
|
||||
}
|
||||
]
|
||||
],
|
||||
"sidecar": {
|
||||
"open": true,
|
||||
"ready": true,
|
||||
"writable": true,
|
||||
"bootstrapComplete": true,
|
||||
"eventCount": 142,
|
||||
"domainCount": 12,
|
||||
"lastApplyAt": 1704067200000,
|
||||
"indexedLength": 142,
|
||||
"length": 142,
|
||||
"key": "a1b2c3..."
|
||||
},
|
||||
"bootstrapComplete": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user