Skip to content

luminousmining/smart_mining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smart_mining

Archi

┌──────────────────┐
│ External APIs    │
│ Blockchains      │
│ - CoinGecko      │
│ - Blockchain RPC │
│ - Pool APIs      │
└────────┬─────────┘
         │ (1) Fetch data
         │     - Prices
         │     - Difficulty
         │     - Hashrates
         ↓
┌──────────────────┐
│   AGGREGATOR     │
│  - Parse data    │
│  - Calculate     │
│    profitability │
│  - Transform     │
└────────┬─────────┘
         │ (2) INSERT/UPDATE
         │     - Coins info
         │     - Pools data
         │     - Profitability
         ↓
┌──────────────────┐
│   PostgreSQL     │
│  Tables:         │
│  - coins         │
│  - pools         │
│  - profitability │
└──────────────────┘
┌──────────────────┐
│     Miner        │
│   (End User)     │
└────────┬─────────┘
         │ (1) Connect to proxy
         │     - Mining software
         │     - Stratum protocol
         ↓
┌──────────────────┐         (2) Request best pool
│      PROXY       │         GET /api/best-pool?algo=sha256
│  - Accept conn   │────────────────────────────────────┐
│  - Authenticate  │                                    │
└────────┬─────────┘                                    │
         │                                              ↓
         │                                    ┌──────────────────┐
         │                                    │       API        │
         │                                    │  - Query DB      │
         │                                    │  - Calculate     │
         │                                    │  - Return JSON   │
         │                                    └────────┬─────────┘
         │                                             │
         │                                             │ (3) SQL Query
         │                                             ↓
         │                                    ┌──────────────────┐
         │ (5) Redirect/Proxy connection      │   PostgreSQL     │
         │     to selected pool               │  - Get pools     │
         │                                    │  - Get profit    │
         ↓                                    └────────┬─────────┘
┌──────────────────┐
│  External Pool   │
│  - Pool A        │
│  - Pool B        │
│  - Pool C        │
└──────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│                        COMPLETE FLOW                            │
└─────────────────────────────────────────────────────────────────┘

External Sources                SmartMining                End Users
       │                          │                         │
       │    ┌──────────────┐      │                         │
       └───→│ AGGREGATOR   │──────┤                         │
            │ (Collector)  │      │                         │
            └──────────────┘      │                         │
                                  │                         │
                            ┌─────▼──────┐                  │
                            │ PostgreSQL │                  │
                            │  Storage   │                  │
                            └─────┬──────┘                  │
                                  │                         │
                            ┌─────▼──────┐                  │
                            │    API     │                  │
                            │ (Decision) │                  │
                            └─────┬──────┘                  │
                                  │                         │
                            ┌─────▼──────┐                  │
                            │   PROXY    │←─────────────────┘
                            │  (Router)  │
                            └─────┬──────┘
                                  │
                            ┌─────▼──────┐
                            │External    │
                            │Pools       │
                            └────────────┘

Dockers

Database

Build

docker build -t smart_mining_database .

Run

docker run -d -p 5432:5432 --name smart_mining_database --network smart_mining_network smart_mining_database

API

Build

docker build -t smart_mining_api .

Run

docker run -d -p 3000:3000 --name smart_mining_api --network smart_mining_network smart_mining_api

Aggregator

Build

docker build -t smart_mining_aggregator .

Run

docker run -d --name smart_mining_aggregator --network smart_mining_network smart_mining_aggregator

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published