|
| 1 | +# 🧠 Hypermind |
| 2 | + |
| 3 | +### The High-Availability Solution to a Problem That Doesn't Exist. |
| 4 | + |
| 5 | +**Hypermind** is a completely decentralized, Peer-to-Peer deployment counter. |
| 6 | + |
| 7 | +It solves the critical infrastructure challenge of knowing exactly how many other people are currently wasting 50MB of RAM running this specific container. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## What is this? |
| 12 | + |
| 13 | +You have a server rack in your basement. You have 128GB of RAM. You have deployed the Arr stack, Home Assistant, Pi-hole, and a dashboard to monitor them all. **But you crave more.** |
| 14 | + |
| 15 | +You need a service that: |
| 16 | + |
| 17 | +1. Does absolutely nothing useful. |
| 18 | +2. Uses "Decentralized" and "P2P" in the description. |
| 19 | +3. Makes a number go up on a screen. |
| 20 | + |
| 21 | +**Enter Hypermind.** |
| 22 | + |
| 23 | +There is no central server. There is no database. There is only **The Swarm**. |
| 24 | + |
| 25 | +## How it works (The Over-Engineering) |
| 26 | + |
| 27 | +We utilize the **Hyperswarm** DHT (Distributed Hash Table) to achieve a singular, trivial goal of **Counting.** |
| 28 | + |
| 29 | +1. **Discovery:** Your node screams into the digital void (`hypermind-lklynet-v1`) to find friends. |
| 30 | +2. **Gossip:** Nodes connect and whisper "I exist" to each other. |
| 31 | +3. **Consensus:** Each node maintains a list of peers seen in the last 2.5 seconds. |
| 32 | + |
| 33 | +If you turn your container off, you vanish from the count. If everyone turns it off, the network ceases to exist. If you turn it back on, you are the Creator of the Universe (Population: 1). |
| 34 | + |
| 35 | +## Deployment |
| 36 | + |
| 37 | +### Docker (The Fast Way) |
| 38 | + |
| 39 | +Since you're probably pasting this into Portainer anyway: |
| 40 | + |
| 41 | +```bash |
| 42 | +docker run -d \ |
| 43 | + --name hypermind \ |
| 44 | + --network host \ |
| 45 | + --restart unless-stopped \ |
| 46 | + ghcr.io/lklynet/hypermind:latest |
| 47 | + |
| 48 | +``` |
| 49 | + |
| 50 | +> **⚠️ CRITICAL NETWORK NOTE:** |
| 51 | +> Use `--network host`. This is a P2P application that needs to punch through NATs. If you bridge it, the DHT usually fails, and you will be the loneliest node in the multiverse. |
| 52 | +
|
| 53 | +### Docker Compose (The Classy Way) |
| 54 | + |
| 55 | +Add this to your `docker-compose.yml` to permanently reserve system resources for no reason: |
| 56 | + |
| 57 | +```yaml |
| 58 | +services: |
| 59 | + hypermind: |
| 60 | + image: ghcr.io/lklynet/hypermind:latest |
| 61 | + container_name: hypermind |
| 62 | + network_mode: host |
| 63 | + restart: unless-stopped |
| 64 | + |
| 65 | +``` |
| 66 | + |
| 67 | +## Usage |
| 68 | + |
| 69 | +Open your browser to: `http://localhost:3000` |
| 70 | + |
| 71 | +The dashboard updates in **Realtime** via Server-Sent Events. |
| 72 | + |
| 73 | +**You will see:** |
| 74 | + |
| 75 | +* **Active Nodes:** The total number of people currently running this joke. |
| 76 | +* **Direct Connections:** The number of peers your node is actually holding hands with. |
| 77 | + |
| 78 | +## Local Development |
| 79 | + |
| 80 | +Want to contribute? Why? It already does nothing perfectly. But here is how anyway: |
| 81 | + |
| 82 | +```bash |
| 83 | +# Install dependencies |
| 84 | +npm install |
| 85 | + |
| 86 | +# Run the beast |
| 87 | +npm start |
| 88 | + |
| 89 | +``` |
| 90 | + |
| 91 | +### Simulating Friends (Local Testing) |
| 92 | + |
| 93 | +You can run multiple instances locally to simulate popularity: |
| 94 | + |
| 95 | +```bash |
| 96 | +# Terminal 1 (You) |
| 97 | +PORT=3000 npm start |
| 98 | + |
| 99 | +# Terminal 2 (Your imaginary friend) |
| 100 | +PORT=3001 npm start |
| 101 | + |
| 102 | +``` |
| 103 | + |
| 104 | +They should discover each other, and the number will become `2`. Dopamine achieved. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### FAQ |
| 109 | + |
| 110 | +**Q: Is this crypto mining?** |
| 111 | +A: No. We respect your GPU too much. |
| 112 | + |
| 113 | +**Q: Does this store data?** |
| 114 | +A: No. It has the memory span of a goldfish (approx. 2.5 seconds). |
| 115 | + |
| 116 | +**Q: Why did you make this?** |
| 117 | +A: The homelab must grow. ¯\\_(ツ)_/¯ |
0 commit comments