# sixgpt/miner architecture

> Architecture diagram of the GitHub repository sixgpt/miner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sixgpt/miner
- Repository: https://github.com/sixgpt/miner

## Overview

##### Main Components
- Miner Application Container: Represent the primary container running the miner. This is orchestrated by Docker Compose (using docker-compose.yml) and is responsible for processing the task of mining synthetic data.
- External Services:
- Vana Network & Wallet: The miner requires a wallet (configured via an .env file) and connects to the Vana network. This integration is external and handles the reward and data ownership mechanism.
- sixgpt.xyz: Users must log in here with their wallet before running the miner. This site plays a role in authentication and likely task assignment.
- Ollama Service: The README mentions an “OLLAMA_API_URL” (e.g. http://ollama:11434/api) which suggests the miner interacts with an Ollama service container, possibly for GPU detection or other performance enhancements. Additionally, if GPU support is enabled, note that NVIDIA or AMD runtime support is needed.

##### Out Relationships and Interactions
- The Vana blockchain – on the network’s mainnet – for wallet interactions and reward transactions.
- The sixgpt.xyz site for user login or external configuration, which indicates authentication and initial task management.
- The Ollama service container for GPU detection or intensive compute tasks.

##### Elements
- Clear labels for each component:
- “Miner Container” for the docker-managed miner service.
- “Ollama Service (GPU Detection & Compute)” if used.
- “Vana Network / Blockchain” representing wallet-based interactions.
- “sixgpt.xyz Authentication Portal” for user login requirements.
- “Host Machine (CPU/GPU)” representing local hardware and any dependency on external GPUs or drivers.
- From the miner container to the Vana network (to show transactions and wallet operations).
- Between the miner container and the Ollama service (to demonstrate the use of compute resources, including GPU detection).
- From the user (or configuration environment) to the miner container (indicating configuration input via .env and startup commands).

##### High-Level Workflow
- Between the miner and the external Vana network (for transactions and rewards).
- Between the miner and the sixgpt.xyz portal (for prior authentication and task instructions).
- Between the miner and the Ollama service container (for advanced computation or GPU support).
- Bidirectional nature of communications where appropriate (for example, between the miner and external services).

- The miner container launched via Docker Compose.
- Its dependency on external services (Vana network, sixgpt.xyz, and Ollama).
- The configuration flow (from .env and user setups) into the miner.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Configuration Layer
    subgraph "Configuration Layer"
        ENV["Environment & Config (.env/README)"]:::config
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        SCRIPT["Startup Script (run_sixgpt.sh)"]:::script
        DC["Docker Compose (docker-compose.yml)"]:::compose
    end

    %% Containerized Services
    subgraph "Containerized Services"
        MINER["Miner Container"]:::container
        OLLAMA["Ollama Service (GPU Detection & Compute)"]:::container
    end

    %% External Services
    subgraph "External Services"
        VANA["Vana Network / Blockchain"]:::external
        SXT["sixgpt.xyz Authentication Portal"]:::external
    end

    %% Host Machine
    subgraph "Host"
        HOST["Host Machine (CPU/GPU)"]:::host
    end

    %% Connections for Configuration and Startup
    ENV -->|"feeds"| SCRIPT
    SCRIPT -->|"invokes"| DC

    %% Docker Compose Deployment
    DC -->|"launches"| MINER
    DC -->|"launches"| OLLAMA

    %% Host execution context
    HOST -->|"runs"| MINER
    HOST -->|"runs"| OLLAMA

    %% Miner External Communications
    MINER -->|"processes"| VANA
    MINER -->|"authenticates"| SXT
    MINER -->|"offloads compute"| OLLAMA

    %% Click Events
    click DC "https://github.com/sixgpt/miner/blob/main/docker-compose.yml"
    click SCRIPT "https://github.com/sixgpt/miner/blob/main/run_sixgpt.sh"
    click ENV "https://github.com/sixgpt/miner/blob/main/README.md"

    %% Styles
    classDef config fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
    classDef compose fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
    classDef script fill:#a9dfbf,stroke:#196f3d,stroke-width:2px;
    classDef container fill:#d2b4de,stroke:#6c3483,stroke-width:2px;
    classDef external fill:#fad7a0,stroke:#b9770e,stroke-width:2px;
    classDef host fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
```
