You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# New user gets 1 hour (3600s) automatically
curl http://localhost:8000/users/alice_public_key/balance
# Response: {"public_key": "alice_public_key", "balance_seconds": 3600, "balance_hours": 1.0}
Test Authorization with Balance Check
# Register a fake worker with multi-engine support
redis-cli SET "node:test_worker"'{"node_id":"test_worker","tailscale_ip":"100.64.0.1","status":"IDLE","models":["llama2:7b"],"hardware":{"gpu":"Test","vram_free":8192},"engines":[{"type":"ollama","version":"0.1","port":11434}]}' EX 60
# Request authorization (reserves 300s)
curl -X POST http://localhost:8000/authorize \
-H "Content-Type: application/json" \
-d '{"model": "llama2:7b", "requester": "alice_public_key"}'# Check balance again (should be 3300s)
curl http://localhost:8000/users/alice_public_key/balance
Test Insufficient Credits
# Create user with low balance (need to manually set in DB or deplete)
curl -X POST http://localhost:8000/authorize \
-H "Content-Type: application/json" \
-d '{"model": "llama2:7b", "requester": "poor_user"}'# After depleting, should get 402 Payment Required
# Check Redis is running
redis-cli ping
# Should return: PONG
RSA Key Not Found
# Check keys directory exists
ls -la coordinator/keys/
# Should see: troop_private_key.pem, troop_public_key.pem# Regenerate if missingcd coordinator
python3 -c "from crypto import ensure_keys_exist; ensure_keys_exist()"
Worker Can't Verify JWT
# Check coordinator is accessible
curl http://coordinator_url:8000/public-key
# Check worker logs for public key fetch errors# If coordinator URL wrong, update COORDINATOR_URL env var
redis-cli KEYS "*"
redis-cli GET "node:test_worker"
redis-cli GET "ratelimit:discovery:127.0.0.1"
Check Database State
psql $DATABASE_URL<< 'EOF'SELECT public_key, balance_seconds, created_at FROM users LIMIT 5;SELECT * FROM transactions ORDER BY timestamp DESC LIMIT 10;SELECT node_id, multiplier, total_jobs_completed FROM nodes;EOF