AI Listener Service Setup
The Glitch Gremlin AI listener service processes chaos test requests from CLI clients and coordinates with the AI engine. This guide explains how to deploy and configure the service.
Prerequisites
Node.js 16+
Redis 6+
Access to a Solana RPC node
SSL certificate (recommended for production)
Installation
Configuration
Create a .env
file in the worker directory:
Running the Service
Development
Production
We recommend using PM2 or similar process manager:
Health Checks
The service exposes these endpoints:
GET /health
- Basic health checkGET /metrics
- Prometheus metricsGET /status
- Detailed service status
Security Considerations
Rate Limiting
Requests are limited to 3 per minute per IP
Maximum 10 concurrent tests
2 second cooldown between requests
Authentication
All requests must be signed with a valid Solana keypair
Token balance checks prevent spam
Network Security
Use SSL/TLS in production
Configure firewall rules
Restrict Redis access
Monitoring
The service exports Prometheus metrics:
Key metrics:
glitch_requests_total
- Total chaos requestsglitch_active_tests
- Currently running testsglitch_queue_depth
- Request queue lengthglitch_errors_total
- Error count by type
Troubleshooting
Common issues and solutions:
Redis Connection Errors
Check Redis is running
Verify REDIS_URL in .env
Check network connectivity
RPC Node Issues
Verify RPC endpoint is accessible
Check rate limits
Consider using a dedicated RPC node
High Memory Usage
Reduce MAX_CONCURRENT_TESTS
Monitor Redis memory usage
Check for memory leaks
Next Steps
Set up monitoring
Configure automated backups
Review security best practices
Last updated