Skip to content

Commit d5f5176

Browse files
committed
Screaming into the void
0 parents  commit d5f5176

7 files changed

Lines changed: 1797 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build-and-push-image:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata (tags, labels) for Docker
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
tags: |
38+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
39+
type=semver,pattern={{version}}
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v5
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
data
3+
.DS_Store
4+
.env

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
RUN apk add --no-cache python3 make g++
6+
7+
COPY package*.json ./
8+
RUN npm install --production
9+
10+
COPY server.js ./
11+
12+
ENV PORT=3000
13+
ENV NODE_ENV=production
14+
15+
EXPOSE 3000
16+
17+
CMD ["node", "server.js"]

README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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

Comments
 (0)