A lightweight web server built with Golang to expose ccminer hashrate data via a JSON API.
- Reads hashrate from
/tmp/ccminer.log - Serves hashrate data in JSON format via HTTP
- Lightweight and efficient
git clone https://github.com/yourusername/hashrate_server.git
cd hashrate_servergo build -o hashrate_server./hashrate_servercurl http://127.0.0.1:5000/hashratesudo vim /etc/systemd/system/hashrate_server.service[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.targetsudo systemctl daemon-reload
sudo systemctl enable hashrate_server
sudo systemctl start hashrate_serversudo systemctl status hashrate_server{
"hashrate": 2.5,
"unit": "MH/s"
}Sandi Andrian [email protected]