Metadata-Version: 2.1
Name: golem-vm-discovery
Version: 0.1.2
Summary: VM on Golem Discovery Service - Central hub for provider discovery and resource matching
Home-page: https://github.com/cryptobench/vm-on-golem
Keywords: golem,discovery,resource-matching,marketplace,decentralized
Author: Phillip Jensen
Author-email: phillip+vm-on-golem@golemgrid.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: System :: Distributed Computing
Requires-Dist: aiosqlite (>=0.17.0,<0.18.0)
Requires-Dist: alembic (>=1.7.1,<2.0.0)
Requires-Dist: cryptography (>=3.4.7,<4.0.0)
Requires-Dist: fastapi (>=0.68.0,<0.69.0)
Requires-Dist: prometheus-client (>=0.11.0,<0.12.0)
Requires-Dist: pydantic (>=1.8.2,<2.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: python-jose[cryptography] (>=3.3.0,<4.0.0)
Requires-Dist: python-multipart (>=0.0.5,<0.0.6)
Requires-Dist: sqlalchemy[asyncio] (>=1.4.23,<2.0.0)
Requires-Dist: uvicorn (>=0.15.0,<0.16.0)
Project-URL: Repository, https://github.com/cryptobench/vm-on-golem
Description-Content-Type: text/markdown

# Golem VM Discovery Server

The Discovery Server acts as the central hub for the Golem Network, enabling requestors to find providers with matching resources.

## Installation

```bash
pip install golem-vm-discovery
```

## Running the Server

1. Create a configuration file `.env`:

```bash
# Server Settings
GOLEM_DISCOVERY_HOST="0.0.0.0"
GOLEM_DISCOVERY_PORT=7465
GOLEM_DISCOVERY_DEBUG=false

# Database Settings (optional)
GOLEM_DISCOVERY_DATABASE_DIR="/path/to/database/dir"  # Default: ~/.golem/discovery
GOLEM_DISCOVERY_DATABASE_NAME="discovery.db"          # Default: discovery.db

# Rate Limiting (optional)
GOLEM_DISCOVERY_RATE_LIMIT_PER_MINUTE=100

# Advertisement Settings (optional)
GOLEM_DISCOVERY_ADVERTISEMENT_EXPIRY_MINUTES=5
GOLEM_DISCOVERY_CLEANUP_INTERVAL_SECONDS=60
```

2. Run the server:

```bash
golem-discovery
```

The server will:
- Create a SQLite database in `~/.golem/discovery` by default
- Listen on port 7465 by default
- Accept provider advertisements
- Clean up expired advertisements automatically

## API Endpoints

- `GET /health` - Health check endpoint
- `GET /api/v1/advertisements` - List available providers
- `POST /api/v1/advertisements` - Register a provider

## Environment Variables

All settings can be configured through environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| GOLEM_DISCOVERY_HOST | Server host | 0.0.0.0 |
| GOLEM_DISCOVERY_PORT | Server port | 7465 |
| GOLEM_DISCOVERY_DEBUG | Enable debug mode | false |
| GOLEM_DISCOVERY_DATABASE_DIR | Database directory | ~/.golem/discovery |
| GOLEM_DISCOVERY_DATABASE_NAME | Database filename | discovery.db |
| GOLEM_DISCOVERY_RATE_LIMIT_PER_MINUTE | Rate limit per IP | 100 |
| GOLEM_DISCOVERY_ADVERTISEMENT_EXPIRY_MINUTES | Advertisement TTL | 5 |
| GOLEM_DISCOVERY_CLEANUP_INTERVAL_SECONDS | Cleanup interval | 60 |

## Development

To run the server in development mode:

```bash
GOLEM_DISCOVERY_DEBUG=true golem-discovery
```

This will enable auto-reload on code changes and more detailed logging.

