Thanks to visit codestin.com
Credit goes to github.com

Skip to content

andriansandi/CCMiner-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee

Hashrate Server for ccminer

A lightweight web server built with Golang to expose ccminer hashrate data via a JSON API.

Features

  • Reads hashrate from /tmp/ccminer.log
  • Serves hashrate data in JSON format via HTTP
  • Lightweight and efficient

Installation

1. Clone this repository

git clone https://github.com/yourusername/hashrate_server.git
cd hashrate_server

2. Build the Project

go build -o hashrate_server

3. Run the Server

./hashrate_server

4. Check the API

curl http://127.0.0.1:5000/hashrate

Running as a Service (Systemd)

1. Clone this repository

sudo vim /etc/systemd/system/hashrate_server.service

2. Add the following content

[Unit]
Description=Hashrate Server for ccminer
After=network.target

[Service]
ExecStart=/usr/local/bin/hashrate_server
Restart=always
User=root
WorkingDirectory=/usr/local/bin

[Install]
WantedBy=multi-user.target

3. Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable hashrate_server
sudo systemctl start hashrate_server

4. Check the status

sudo systemctl status hashrate_server

API Response Example

{
  "hashrate": 2.5,
  "unit": "MH/s"
}

Maintainer

Sandi Andrian [email protected]

About

A lightweight web server built with Golang to expose ccminer hashrate data via a JSON API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages