Skip to content

Nitron/go-cgminer-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CGMiner API for Go

Installation

# install the library:
go get github.com/Nitron/go-cgminer-api

// Use in your .go code:
import (
    "github.com/Nitron/go-cgminer-api"
)

API Documentation

Full godoc output from the latest code in master is available here:

http://godoc.org/github.com/Nitron/go-cgminer-api

Quickstart

package main

import (
    "github.com/Nitron/go-cgminer-api"
    "log"
)

func main() {
    miner := cgminer.New("localhost", 4028)
    summary, err := miner.Summary()
    if err != nil {
        log.Fatalln("Unable to connect to CGMiner: ", err)
    }

    // Convert hashrate into KH/s
    hashrate := summary.MHSav * 1000.0

    log.Printf("Average Hashrate: %f KH/s\n", hashrate)
}

About

Library for accessing the CGMiner API from Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages