Skip to content

GridlessCompute/Jua-Kali-Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bluecollarCore

Description

This acts as a central API to receive data from the serial receiver and send data to the webGUI, it also exposes data as Prometheus metrics. It also includes a control loop to manage the miner's operation based on battery voltage, providing autonomous operation to prevent battery depletion.

Core functionalities:

  • Monitoring miner statistics (hashrate, temperature, etc.).
  • Monitoring BMS data (voltage, current, etc.).
  • Exposing all metrics via a /metrics endpoint for Prometheus.
  • Simple voltage-based control for the miner.
  • A socket server for additional communication and control.

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/bluecollarCore.git
    cd bluecollarCore
  2. Install dependencies:

    go mod tidy
  3. Compile:

    go build -o ~/juakaliCore

Systemd Serivce

  1. Create and edit service file:

    sudo nano /etc/systemd/system/juakaliCore.service
  2. Add the following to the file:

    [Unit]
    Description=Jua kali core service
    After=network.target
    
    [Service]
    ExecStart=/home/{USER_NAME}/juakaliCore
    Type=simple
    Restart=on-failure
    RestartSec=5s
    
    [Install]
    WantedBy=multi-user.target
  3. Enable and start the service:

    sudo systemctl daemon-reload
    sudo systemctl enable juakaliCore
    sudo systemctl start juakaliCore
  4. Check if the service is running:

    sudo systemctl status juakaliCore

Operation

The application will start the following services:

  • A Prometheus metrics server on port 2112.
  • A control loop for the miner.
  • A socket server for communication.

You can access the metrics at http://localhost:2112/metrics.

Configuration

The bluecollarCore application uses a config.json file for its main configuration. This file is located in your user's configuration directory, specifically at ~/.config/juakaliCore/config.json (on Linux systems). If the file does not exist, a default one will be created.

Here's an example of the default config.json structure and its fields:

{
  "minerip": "192.168.10.101",
  "socket": {
    "socketfile": "/tmp/bluecollar.sock"
  },
  "control": {
    "clockjump": 40,
    "minclock": 275,
    "maxclock": 700,
    "minvoltage": 11.5,
    "maxvoltage": 15
  }
}
  • minerip: The IP address of the miner to connect to.
  • socket.socketfile: The path to the Unix domain socket file used for inter-process communication.
  • control.clockjump: Defines how much the clock speed can jump at a time.
  • control.minclock: The minimum clock speed for the miner.
  • control.maxclock: The maximum clock speed for the miner.
  • control.minvoltage: The minimum battery voltage threshold for miner operation.
  • control.maxvoltage: The maximum battery voltage threshold for miner operation.

About

Core for Bluecollar Miner Operation

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages