77 lines
1.5 KiB
Markdown
77 lines
1.5 KiB
Markdown
# License Verification ZKP System - Test Environment
|
|
|
|
## Quick Start
|
|
|
|
1. **Start the system:**
|
|
```bash
|
|
make up
|
|
```
|
|
|
|
2. **Initialize test data:**
|
|
```bash
|
|
make db-init
|
|
```
|
|
|
|
3. **Run benchmarks:**
|
|
```bash
|
|
make benchmark
|
|
```
|
|
|
|
## Architecture
|
|
|
|
- **PostgreSQL**: Stores licenses and Merkle tree structure
|
|
- **ZKP Engine**: Handles proof generation and verification
|
|
- **Redis**: Caches Merkle proofs for performance
|
|
- **Merkle Service**: Manages Merkle tree updates
|
|
|
|
## Performance Expectations
|
|
|
|
Based on your simple age circuit benchmarks:
|
|
- **Proof Generation**: 3,500-4,500ms (browser)
|
|
- **Proof Verification**: 25-40ms (server)
|
|
- **Memory Usage**: 150-250MB peak during generation
|
|
|
|
## Monitoring
|
|
|
|
View real-time metrics:
|
|
```bash
|
|
curl http://localhost:8081/metrics
|
|
```
|
|
|
|
View benchmark results:
|
|
```bash
|
|
curl http://localhost:8080/api/benchmark
|
|
```
|
|
|
|
## Database Access
|
|
|
|
```bash
|
|
docker compose exec postgres psql -U license_admin -d license_verification
|
|
```
|
|
|
|
Useful queries:
|
|
```sql
|
|
-- View benchmark results
|
|
SELECT * FROM benchmark_results ORDER BY created_at DESC LIMIT 10;
|
|
|
|
-- Check Merkle tree status
|
|
SELECT * FROM merkle_tree_stats;
|
|
|
|
-- View recent verifications
|
|
SELECT * FROM verification_audit ORDER BY created_at DESC LIMIT 10;
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
If proof generation is too slow:
|
|
1. Check memory allocation: `docker stats`
|
|
2. Reduce tree depth in `.env` (affects max licenses)
|
|
3. Consider server-side proof generation
|
|
|
|
## Clean Up
|
|
|
|
```bash
|
|
make down # Stop services
|
|
make clean # Remove all data
|
|
make reset # Full system reset
|
|
```
|