2025-10-03 14:45:52 -04:00
|
|
|
---
|
|
|
|
|
title: Query Encryption Status
|
|
|
|
|
description: Monitor the health and state of the consensus encryption system
|
2026-09-02 16:53:38 -04:00
|
|
|
seo:
|
|
|
|
|
title: "DWN Encryption System Status"
|
2025-10-03 14:45:52 -04:00
|
|
|
---
|
|
|
|
|
|
2026-09-02 16:53:38 -04:00
|
|
|
:::info
|
|
|
|
|
The encryption system uses validator consensus to generate keys that no single party controls.
|
|
|
|
|
:::
|
2025-10-03 14:45:52 -04:00
|
|
|
|
|
|
|
|
## System Components
|
|
|
|
|
|
|
|
|
|
### Key Management
|
|
|
|
|
- **currentKeyVersion**: Active encryption key version
|
|
|
|
|
- **lastRotation**: Timestamp of last rotation
|
|
|
|
|
- **nextRotation**: Scheduled rotation time
|
|
|
|
|
|
|
|
|
|
### Validator Participation
|
|
|
|
|
- **validatorSet**: Active validator addresses
|
|
|
|
|
- **singleNodeMode**: Development mode flag
|
|
|
|
|
- **minValidatorsForKeyGen**: Required threshold
|
|
|
|
|
|
|
|
|
|
### System Metrics
|
|
|
|
|
- **totalEncryptedRecords**: Global encrypted record count
|
|
|
|
|
|
|
|
|
|
## Health Monitoring
|
|
|
|
|
|
2026-09-02 16:53:38 -04:00
|
|
|
:::tip
|
|
|
|
|
Set up alerts for upcoming key rotations to ensure smooth operations.
|
|
|
|
|
:::
|
2025-10-03 14:45:52 -04:00
|
|
|
|
|
|
|
|
### Health Checks
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
// Check rotation schedule
|
|
|
|
|
const rotationDue = nextRotation < Date.now();
|
|
|
|
|
|
|
|
|
|
// Verify validator participation
|
|
|
|
|
const hasQuorum = validatorSet.length >= minValidatorsForKeyGen;
|
|
|
|
|
|
|
|
|
|
// Monitor growth
|
|
|
|
|
const recordGrowthRate = totalEncryptedRecords / daysSinceLaunch;
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Key Rotation Schedule
|
|
|
|
|
|
|
|
|
|
### Automatic Rotation
|
|
|
|
|
- Triggered by `keyRotationDays` parameter
|
|
|
|
|
- Requires validator consensus
|
|
|
|
|
- Zero-downtime process
|
|
|
|
|
|
|
|
|
|
### Manual Rotation
|
|
|
|
|
- Governance proposals
|
|
|
|
|
- Security incidents
|
|
|
|
|
- Validator changes
|
|
|
|
|
|
2026-09-02 16:53:38 -04:00
|
|
|
:::warning
|
|
|
|
|
Key rotation requires sufficient validator participation. Monitor validator set health.
|
|
|
|
|
:::
|
2025-10-03 14:45:52 -04:00
|
|
|
|
|
|
|
|
## Development vs Production
|
|
|
|
|
|
|
|
|
|
### Production Mode
|
|
|
|
|
- Full validator consensus
|
|
|
|
|
- Distributed key generation
|
|
|
|
|
- No single point of failure
|
|
|
|
|
|
|
|
|
|
### Single-Node Mode
|
|
|
|
|
- Local key generation
|
|
|
|
|
- Simplified consensus
|
|
|
|
|
- For development only
|
|
|
|
|
|
|
|
|
|
## Monitoring Dashboard
|
|
|
|
|
|
2026-09-02 16:53:38 -04:00
|
|
|
:::note
|
|
|
|
|
Create monitoring dashboards using these metrics for operational visibility.
|
|
|
|
|
:::
|
2025-10-03 14:45:52 -04:00
|
|
|
|
|
|
|
|
### Key Metrics
|
|
|
|
|
```bash
|
|
|
|
|
# Query status
|
|
|
|
|
STATUS=$(snrd query dwn encryption-status -o json)
|
|
|
|
|
|
|
|
|
|
# Extract metrics
|
|
|
|
|
echo "Key Version: $(echo $STATUS | jq .currentKeyVersion)"
|
|
|
|
|
echo "Validators: $(echo $STATUS | jq '.validatorSet | length')"
|
|
|
|
|
echo "Records: $(echo $STATUS | jq .totalEncryptedRecords)"
|
|
|
|
|
echo "Next Rotation: $(echo $STATUS | jq .nextRotation)"
|
|
|
|
|
```
|