Skip to content

GridlessCompute/Jua-Kali-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jua Kali Miner Code

Architecture

The system is composed of several components working together:

  • arduino: A C++ sketch running on an Arduino Nano. It is responsible for reading analog sensor data (voltage and current) and communicating with control boards via I2C.
  • serial: A Go service that runs on a Raspberry Pi. It reads the data from the Arduino over a USB serial connection.
  • core: The central Go service. It processes the data from the serial service, manages miner pool information (poolinfo.json), and exposes data to the webGUI.
  • webGUI: A Go web server that serves a modern React-based frontend, providing the user with a dashboard to monitor and control the hardware.

Components

This project is organized into submodules, each with its own detailed README.md file.

Getting Started

Prerequisites

Installation and Usage

  1. Clone the repository with its submodules:

    git clone --recurse-submodules https://github.com/your-username/bluecollar.git
    cd bluecollar
  2. Build and configure each service: Detailed instructions for building, configuring, and running each component can be found in its respective README.md file in the Components section.

    In general, the Go services can be built using go build within their respective directories. The frontend for the webGUI requires npm install and npm run build.

  3. Run the services: The submodule README.md files provide instructions for running each service, including how to set them up as systemd services for automatic startup.

License

This project is distributed under the GNU General Public License v3.0. See LICENSE for more information.

Nano Specific Instructions

Hardware Assembly

Jua Kali Wiring Guide

Connect wires to pins A0, A1, A2, A3 for the current and voltage readings as well as a wire to 5V and ground for each Connect wires to pins A4 and A5 as well as a wire for ground for i2c communication to the control board

Software / Firmware

Read Setup Arduino IDE for help configuring and getting the know the Arduino IDE Clone or copy the code in the arduino repo Flash the sketch to the arduino nano

Raspberry Pi

Hardware

Jua Kali Wiring Guide

Follow the getting started with Raspberry Pi to flash the OS Connect outside network to the ethernet port built into the Pi connect the USB-to-Ethernet adapter to one of the ports on the Pi Connect Ethernet cable between the USB-to-Ethernet adapter and the control board Connect the Arduino to the Pi with a USB cable Connect 5V to pin 2 or 4 and ground to pin 6 If using a BMS with UART pin 8 is TX and pin 10 in RX, connect the BMS TX to Pi RX and BMS RX to Pi TX (NOTE ABOUT VOLTAGE FUNNIES RELATED TO BMS)

Software / Firmware

Add user to dialout

sudo usermod -a -G dialout $USER
sudo reboot

Enable UART

sudo raspi-config

select: interface options -> serial port When asked if login shell over serial select NO When asked if enable serial select YES When asked if reboot select YES

Configure No passwd sudo systemctl

NetworkManager

Create new network on the eth1 interface

sudo nmcli connection add \
type ethernet \
con-name "minernet" \
ifname eth1 \
ipv4.method shared \
ipv4.addresses 192.168.10.100/24 \
ipv6.method ignore

Make ipv4.shared-dhcp-range 1 IP

sudo nmcli connection mod minernet \
ipv4.shared-dhcp-range=192.168.10.101,192.168.10.101,12h

Bring up connection

sudo nmcli connection up minernet

Apache2

Install

sudo apt install apache2

Add reverse proxy config

sudo [ nano | vim ] /etc/apache2/sites-enabled/000-default.config

paste the following

<VirtualHost *:81>
        ServerName your_server_ip_or_domain:81

        ProxyPass / http://192.168.10.101:80/
        ProxyPassReverse / http://192.168.10.101:80/

        RequestHeader set X-Forward-Proto "http"
        RequestHeader set X-Real-IP "%{REMOTE_ADDR}e"
</VirtualHost>
<VirtualHost *:4028>
        ServerName your_server_ip_or_domain:4028

        ProxyPreserveHost off
        RequestHeader set Host "192.168.10.101"

        ProxyPass / http://196.168.10.101:4028/
        ProxyPassReverse / http://196.168.10.101:4028/
</VirtualHost>
sudo systemctl resart apache2

Prometheus

Raspberry Pi specific install guide

add prometheus config and rules

OTHER

About

Code repo for Jua Kali Miner

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors