A registry service for managing and allocating NANDA agents. This service handles agent registration, allocation, and client-agent mapping.
- Agent registration and management
- Client-agent allocation
- SSL certificate management
- MongoDB integration for persistence
- Automatic certificate renewal
- Python 3.6+
- MongoDB
- Root/sudo access (for SSL certificate management)
- Port 80 available (for Let's Encrypt certificate challenge)
Preparing apt install python3.10-venv
- SSH into the server:
ssh root@your-server-ip- Clone the repository to /opt:
git clone https://github.com/aidecentralized/nanda-index.git /opt/nanda-index
cd /opt/nanda-index- Create and activate a virtual environment:
python3 -m venv venv && source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Set up MongoDB:
- Install MongoDB if not already installed
- Create a database for the registry
- Set the MongoDB URI in environment variables:
export MONGODB_URI="<provide your URI>"
- Basic start with automatic SSL certificate:
python3 run_registry.py --public-url <https://your-domain.com>- Start with specific port:
python3 run_registry.py --public-url https://your-domain.com --port 6900- Port 80: Required temporarily for Let's Encrypt certificate challenge
- Port 6900: Default port for the registry service
- MongoDB port: Default 27017
The service automatically:
- Obtains SSL certificates from Let's Encrypt
- Stores certificates in
/root/certificates/ - Handles certificate renewal
If port 80 is in use, the service will attempt to:
- Identify the process using port 80
- Stop common web servers (nginx, apache2)
- Wait for the port to be released
/register- Register a new agent/lookup/<id>- Lookup agent by ID/api/allocate- Allocate an agent to a client/list- List all registered agents/status/<agent_id>- Get agent status/clients- List all clients
MONGODB_URI: MongoDB connection string
Optional
PORT: Registry service port (default: 6900)CERT_DIR: Directory for SSL certificates (default: /root/certificates)
If you see port 80 is in use:
- Check what's using port 80:
sudo lsof -i :80- Stop the service:
sudo systemctl stop nginx # if nginx is running
sudo systemctl stop apache2 # if apache is running- Verify port is free:
sudo netstat -tulpn | grep :80If SSL certificate setup fails:
- Check if the domain is publicly accessible
- Ensure port 80 is available
- Verify DNS is properly configured
- Check certificate directory permissions
- The service requires root access for SSL certificate management
- Certificates are stored with appropriate permissions (600 for private key)
- MongoDB should be properly secured
- Use HTTPS for all communications
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
[Add your license information here]