An open API service indexing awesome lists of open source software.

https://github.com/brndnmtthws/cgminer-rest

RESTful HTTP API wrapper for cgminer
https://github.com/brndnmtthws/cgminer-rest

bitcoin-mining cgminer cgminer-api

Last synced: 10 months ago
JSON representation

RESTful HTTP API wrapper for cgminer

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/brndnmtthws/cgminer-rest.svg?branch=master)](https://travis-ci.org/brndnmtthws/cgminer-rest) [![Current Crates.io Version](https://img.shields.io/crates/v/cgminer-rest.svg)](https://crates.io/crates/cgminer-rest) [![Coverage Status](https://coveralls.io/repos/github/brndnmtthws/cgminer-rest/badge.svg?branch=master)](https://coveralls.io/github/brndnmtthws/cgminer-rest?branch=master) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=brndnmtthws/cgminer-rest)](https://dependabot.com)

# cgminer-rest: a RESTful HTTP wrapper for the cgminer API

![Demo](/demo.gif?raw=true)

This package provides a RESTful HTTP wrapper around the
[cgminer](https://github.com/ckolivas/cgminer) API. Cgminer has a somewhat
esoteric API, which isn't easy to use with standard HTTP-based tooling. Using
this tool, it's easy to interact with cgminer programmatically or using a UI,
such as through a web browser.

## Installing

The package can be installed from [crates.io](https://crates.io/) using the `cargo` tool:

```ShellSession
$ cargo install cgminer-rest
...
$ cgminer-rest
```

See [`Rocket.toml`](Rocket.toml) for configuration details. Instructions on using `Rocket.toml` [can be found here](https://rocket.rs/v0.4/guide/configuration/#rockettoml).

*Note: currently you must be running nightly rust. It is recommended that you use [rustup](https://github.com/rust-lang/rustup.rs) to manage your rust installation.*

## Example

## API

### Endpoints

🛰 Mounting /:
=> GET /version (version)
=> GET /config (config)
=> GET /summary (summary)
=> GET /devs (devs)
=> GET /devdetails (devdetails)
=> GET /stats (stats)
=> GET /coin (coin)
=> GET /usbstats (usbstats)
=> GET /lcd (lcd)
=> GET /notify (notify)
=> GET /privileged (privileged)
=> PUT /restart (restart)
=> PUT /check/ (check)
=> PUT /debug (debug)
=> PUT /hotplug (hotplug)
=> GET /lockstats (lockstats)
=> PUT /zero (zero)
🛰 Mounting /pools:
=> GET /pools (pools)
=> PUT /pools//switchto (switchpool)
=> PUT /pools//enable (enablepool)
=> PUT /pools//disable (disablepool)
=> POST /pools (addpool)
=> DELETE /pools/ (removepool)
=> PUT /pools//quota (poolquota)
🛰 Mounting /pga:
=> GET /pga/ (pga)
=> GET /pga/count (pgacount)
=> PUT /pga//enable (pgaenable)
=> PUT /pga//disable (pgadisable)
=> GET /pga//identify (pgaidentify)
=> PUT /pga/ (pgaset)
🛰 Mounting /asc:
=> GET /asc/ (asc)
=> GET /asc/count (asccount)
=> PUT /asc//enable (ascenable)
=> PUT /asc//disable (ascdisable)
=> GET /asc//identify (ascidentify)
=> PUT /asc/ (ascset)

## Project Goals

The goal of this project is to create a high quality API for working with
cgminer-based ASICs, in order to enable development of better tooling for
Bitcoin mining (such as [dragon-rest](https://github.com/brndnmtthws/dragon-rest) and [mother-of-dragons](https://github.com/brndnmtthws/mother-of-dragons)).

If ASIC vendors adopt one canonical API for mining hardware, it will become
much easier to build tooling that works well with many different types of
mining hardware. Nearly all ASIC vendors already use cgminer underneath,
however the cgminer API is esoteric and somewhat difficult to work with
compared to HTTP.