-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
area/apiAPI endpointsAPI endpointsphase/1-testnetPhase 1: TestnetPhase 1: Testnetpriority/highHigh priorityHigh prioritytype/featureFeatureFeature
Description
Context
After lib-network DHT storage is implemented, integrate it into zhtp identity API endpoints for distributed storage. This fulfills the Phase 1 deliverable: "Integrate DHT file storage layer".
Scope
- Update
POST /api/v1/identity/createto store in DHT - Update
GET /api/v1/identity/{did}to retrieve from DHT - Add DHT health check endpoint
- Implement fallback to local storage if DHT unavailable
- Async replication (don't block API responses)
- Add storage location to API responses ("dht" or "local")
Dependencies
- lib-network Issue DHT Integration: Wire DHT storage to identity API #2: DHT storage API must be complete
Acceptance Criteria
- Identity creation stores in DHT asynchronously
- Identity retrieval checks DHT first, falls back to local
- Health check endpoint:
GET /api/v1/system/dht/health - API response includes
storage_locationfield - Timeout handling (3s max for DHT operations)
- Graceful degradation if DHT down
- Integration tests with local DHT cluster
- API documentation updated
- Monitoring logs for DHT success/failure rates
Technical Notes
- Use async/await for non-blocking DHT operations
- Cache identity locally after DHT retrieval
- Consider eventual consistency (DHT write may take time to replicate)
- Core SID requirement: "Storage: Encrypted and distributed across a DHT"
- Existing identity API: zhtp/zhtp/src/api/handlers/identity/mod.rs
Metadata
Metadata
Assignees
Labels
area/apiAPI endpointsAPI endpointsphase/1-testnetPhase 1: TestnetPhase 1: Testnetpriority/highHigh priorityHigh prioritytype/featureFeatureFeature