# fakerpk/newgrassbot architecture

> Architecture diagram of the GitHub repository fakerpk/newgrassbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fakerpk/newgrassbot
- Repository: https://github.com/fakerpk/newgrassbot

## Overview

This repository presents a Python bot for running Grass Node WebSocket connections through SOCKS proxies, including multiple accounts and proxy-failure handling. The documented workflow is to start the script, provide account and proxy-count inputs, load proxy addresses, and connect to Grass through proxies; dead proxies may be removed from the proxy file. The source excerpts are heavily obfuscated and incomplete, so the graph relies on README-described behavior and does not infer internal module calls. The README mentions config.json for multiple user IDs, but that file is absent from the supplied tree.

Main entry points: [`main.py`](https://github.com/fakerpk/newgrassbot/blob/main/main.py) (Bot runner), [`winmain.py`](https://github.com/fakerpk/newgrassbot/blob/main/winmain.py) (Windows runner), [`proxy.txt`](https://github.com/fakerpk/newgrassbot/blob/main/proxy.txt) (Proxy list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operation["Bot operation"]
  node_main["Bot runner<br/>[main.py]"]
  node_windows["Windows runner<br/>[winmain.py]"]
  node_proxyfile["Proxy list<br/>[proxy.txt]"]
end

subgraph group_connections["Grass connections"]
  node_grass["Grass service"]
  node_socks["SOCKS proxies"]
end

subgraph group_resilience["Proxy resilience"]
  node_proxycleanup["Dead proxy removal<br/>[main.py]"]
end

node_user(("Operator"))

node_user -->|"starts and configures"| node_main
node_user -->|"starts and configures"| node_windows
node_main -->|"reads proxies"| node_proxyfile
node_windows -->|"reads proxies"| node_proxyfile
node_main -->|"connects through"| node_socks
node_windows -->|"connects through"| node_socks
node_main -->|"opens WebSockets"| node_grass
node_windows -->|"opens WebSockets"| node_grass
node_main -->|"handles dead proxies"| node_proxycleanup
node_proxycleanup -->|"removes proxies"| node_proxyfile

click node_main "https://github.com/fakerpk/newgrassbot/blob/main/main.py"
click node_windows "https://github.com/fakerpk/newgrassbot/blob/main/winmain.py"
click node_proxyfile "https://github.com/fakerpk/newgrassbot/blob/main/proxy.txt"
click node_proxycleanup "https://github.com/fakerpk/newgrassbot/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_windows,node_proxyfile toneBlue
class node_grass,node_socks toneAmber
class node_proxycleanup toneMint
class node_user toneIndigo
```

## Components

### Bot operation

- [Bot runner](https://github.com/fakerpk/newgrassbot/blob/main/main.py): `main.py`
- [Windows runner](https://github.com/fakerpk/newgrassbot/blob/main/winmain.py): `winmain.py`
- [Proxy list](https://github.com/fakerpk/newgrassbot/blob/main/proxy.txt): `proxy.txt`

### Grass connections

- **Grass service**
- **SOCKS proxies**

### Proxy resilience

- [Dead proxy removal](https://github.com/fakerpk/newgrassbot/blob/main/main.py): `main.py`

### Other components

- **Operator**

## Connections

- Operator → Bot runner: starts and configures
- Operator → Windows runner: starts and configures
- Bot runner → Proxy list: reads proxies
- Windows runner → Proxy list: reads proxies
- Bot runner → SOCKS proxies: connects through
- Windows runner → SOCKS proxies: connects through
- Bot runner → Grass service: opens WebSockets
- Windows runner → Grass service: opens WebSockets
- Bot runner → Dead proxy removal: handles dead proxies
- Dead proxy removal → Proxy list: removes proxies
