Docs update concerning consensus
This commit is contained in:
@@ -549,6 +549,12 @@ ws.onmessage = (ev) => {
|
||||
|
||||
## Consensus Examples
|
||||
|
||||
### Get Sidecar Status
|
||||
|
||||
```bash
|
||||
curl -k https://p2ns.admin/api/consensus/status
|
||||
```
|
||||
|
||||
### Get Consensus State for a Domain
|
||||
|
||||
```bash
|
||||
@@ -673,6 +679,11 @@ def get_consensus_state(domain):
|
||||
response = requests.get(url, verify=False)
|
||||
return response.json()
|
||||
|
||||
def get_consensus_status():
|
||||
url = "https://p2ns.admin/api/consensus/status"
|
||||
response = requests.get(url, verify=False)
|
||||
return response.json()
|
||||
|
||||
def get_consensus_metrics():
|
||||
url = "https://p2ns.admin/api/consensus/metrics"
|
||||
response = requests.get(url, verify=False)
|
||||
@@ -684,10 +695,16 @@ print(f"Status: {state['status']}")
|
||||
print(f"Quorum Met: {state['quorumMet']}")
|
||||
print(f"Vote Counts: {state['voteCounts']}")
|
||||
|
||||
# Check sidecar health
|
||||
status = get_consensus_status()
|
||||
print(f"Sidecar ready: {status['ready']}, bootstrap: {status['bootstrapComplete']}")
|
||||
|
||||
# Get metrics
|
||||
metrics = get_consensus_metrics()
|
||||
print(f"Total Resolutions: {metrics['resolutions']}")
|
||||
print(f"Quorum Failures: {metrics['quorumFailures']}")
|
||||
if metrics.get('sidecar'):
|
||||
print(f"Sidecar domains: {metrics['sidecar']['domainCount']}")
|
||||
```
|
||||
|
||||
### Force Recalculation After Network Changes
|
||||
|
||||
Reference in New Issue
Block a user