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
/metricsendpoint for Prometheus. - Simple voltage-based control for the miner.
- A socket server for additional communication and control.
-
Clone the repository:
git clone https://github.com/your-username/bluecollarCore.git cd bluecollarCore -
Install dependencies:
go mod tidy
-
Compile:
go build -o ~/juakaliCore
-
Create and edit service file:
sudo nano /etc/systemd/system/juakaliCore.service
-
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 -
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable juakaliCore sudo systemctl start juakaliCore -
Check if the service is running:
sudo systemctl status juakaliCore
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.
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.