rpcclaymore

package module
v0.0.0-...-fa996b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 4 Imported by: 0

README

RPC Claymore

Package to take information about claymore status

Version License FOSSA Status

Installation

go get github.com/ivandelabeldad/rpc-claymore

Usage

miner := claymore.Miner{Address: "localhost:3333"}
info, err := miner.GetInfo()
if err != nil {
  log.Fatal(err)
}
fmt.Printf("%v", info)
Output:
Version:   11.8
Up Time:     23 min

Main Crypto
HashRate:           119162 Mh/s
Shares:                 16
Rejected Shares:         0
Invalid Shares:          0

Alt Crypto
Disabled

Main Pool
Address:   eth-eu1.nanopool.org:9999
Switches:                          0

Alt Pool
Disabled

GPU 0
Hash Rate:        29779 Mh/s
Alt Hash Rate:        0 Mh/s
Temperature:         47 º
Fan Speed:           60 %

GPU 1
Hash Rate:        29798 Mh/s
Alt Hash Rate:        0 Mh/s
Temperature:         49 º
Fan Speed:           60 %

You can access either each field on its own:

info.MainCrypto.HashRate // int 119313

Warning

Because of claymore bad implementation of the json rpc protocol there is no way to keep it working with a password. So this option is useless until claymore received an update to support it (May be never).

License

RPC Claymore is open-sourced software licensed under the MIT license.

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypto

type Crypto struct {
	HashRate       int
	Shares         int
	RejectedShares int
	InvalidShares  int
}

Crypto Information about this concrete crypto-currency

func (Crypto) String

func (c Crypto) String() (s string)

type GPU

type GPU struct {
	HashRate    int
	AltHashRate int
	Temperature int
	FanSpeed    int
}

GPU Information about each concrete GPU

func (GPU) IsStuck

func (gpu GPU) IsStuck() bool

IsStuck Return true if the GPU is not mining

func (GPU) String

func (gpu GPU) String() (s string)

type Miner

type Miner struct {
	Address  string
	Password string
}

Miner creates an instance to get info of a miner

func (Miner) GetInfo

func (m Miner) GetInfo() (MinerInfo, error)

GetInfo return the status of the miner or throw and error if it is not reachable

func (Miner) Reboot

func (m Miner) Reboot() error

Reboot Turn off and on again the computer

func (Miner) Restart

func (m Miner) Restart() error

Restart Stop and start the miner

func (Miner) String

func (m Miner) String() (s string)

type MinerInfo

type MinerInfo struct {
	Version    string
	UpTime     int
	MainCrypto Crypto
	AltCrypto  Crypto
	MainPool   PoolInfo
	AltPool    PoolInfo
	GPUS       []GPU
}

MinerInfo Information about the miner

func (MinerInfo) String

func (m MinerInfo) String() string

func (MinerInfo) StuckGPUs

func (m MinerInfo) StuckGPUs() int

StuckGPUs Return the number of GPUs that are not mining

type PoolInfo

type PoolInfo struct {
	Address  string
	Switches int
}

PoolInfo Information about the miner's connected pool

func (PoolInfo) String

func (p PoolInfo) String() (s string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL