baikal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelGP   machine.Model = "Baikal Gaiant+"
	ModelGX10 machine.Model = "Baikal GX10" // a.k.a. BK-X
	ModelG28  machine.Model = "Baikal BK-G28"
	ModelGB   machine.Model = "Baikal Gaiant-B" // a.k.a. BK-B
	ModelN    machine.Model = "Baikal N"        // a.k.a. BK-N+
)

List of supported MinerType

Variables

This section is empty.

Functions

func Algos

func Algos(m machine.Model) []string

Algos returns list of supported algo

func NewSSHClient

func NewSSHClient(host string) (*ssh.Client, error)

NewSSHClient returns *ssh.Client with default setting

func NewSSHClientTimeout

func NewSSHClientTimeout(host string, timeout time.Duration) (*ssh.Client, error)

NewSSHClientTimeout returns *ssh.Client with default setting with connection timeout

Types

type Client

type Client struct {
	base.Client
	// contains filtered or unexported fields
}

func (*Client) GetStats

func (c *Client) GetStats() (stat MinerStats, err error)

func (*Client) GetStatsContext

func (c *Client) GetStatsContext(ctx context.Context) (stat MinerStats, err error)

func (*Client) GetSystemInfo

func (c *Client) GetSystemInfo() (info SystemInfo, err error)

func (*Client) GetSystemInfoContext

func (c *Client) GetSystemInfoContext(ctx context.Context) (info SystemInfo, err error)

func (*Client) MineStart

func (c *Client) MineStart(ctx context.Context) error

func (*Client) MineStop

func (c *Client) MineStop(ctx context.Context) error

func (*Client) MinerSetting

func (c *Client) MinerSetting(ctx context.Context) (machine.MinerSetting, error)

func (*Client) Reboot

func (c *Client) Reboot(ctx context.Context) error

func (*Client) Restart

func (c *Client) Restart(ctx context.Context) error

func (*Client) RigInfo

func (c *Client) RigInfo(ctx context.Context) (machine.RigInfo, error)

func (*Client) RigStat

func (c *Client) RigStat(ctx context.Context) (machine.RigStat, error)

func (*Client) SSHConfig

func (c *Client) SSHConfig(host string) (string, *ssh.ClientConfig)

func (*Client) SetMinerSetting

func (c *Client) SetMinerSetting(ctx context.Context, setting machine.MinerSetting) error

type MinerOptions

type MinerOptions []MinerOptionsEntry

MinerOptions : /opt/scripta/etc/miner.options.json

type MinerOptionsEntry

type MinerOptionsEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MinerSetting

type MinerSetting map[string]string

MinerSetting : parsed /opt/scripta/etc/miner.options.json

func (MinerSetting) MarshalJSON

func (m MinerSetting) MarshalJSON() ([]byte, error)

func (*MinerSetting) UnmarshalJSON

func (m *MinerSetting) UnmarshalJSON(in []byte) error

type MinerStats

type MinerStats struct {
	Devs    []SGDev
	Pools   []SGPool
	Stats   []SGStat
	Summary SGSummary
	System  MinerStatsSystem
}

type MinerStatsSystem

type MinerStatsSystem struct {
	TempCPU string
}

type PoolSetting

type PoolSetting struct {
	URL        string `json:"url"`
	Pass       string `json:"pass"`
	Priority   string `json:"priority"`
	Algo       string `json:"algo"`
	Extranonce string `json:"extranonce"`
	User       string `json:"user"`
}

type SGDev

type SGDev struct {
	ASC                 int     `json:"ASC"`
	Name                string  `json:"Name"`
	ID                  int     `json:"ID"`
	Enabled             string  `json:"Enabled"`
	Status              string  `json:"Status"`
	Temperature         float64 `json:"Temperature"`
	MHSAv               float64 `json:"MHS av"`
	MHS5S               float64 `json:"MHS 5s"`
	Accepted            int     `json:"Accepted"`
	Rejected            int     `json:"Rejected"`
	HardwareErrors      int     `json:"Hardware Errors"`
	Utility             float64 `json:"Utility"`
	LastSharePool       int     `json:"Last Share Pool"`
	LastShareTime       int     `json:"Last Share Time"`
	TotalMH             float64 `json:"Total MH"`
	Diff1Work           float64 `json:"Diff1 Work"`
	DifficultyAccepted  float64 `json:"Difficulty Accepted"`
	DifficultyRejected  float64 `json:"Difficulty Rejected"`
	LastShareDifficulty float64 `json:"Last Share Difficulty"`
	NoDevice            bool    `json:"No Device"`
	LastValidWork       int     `json:"Last Valid Work"`
	DeviceHardware      float64 `json:"Device Hardware%"`
	DeviceRejected      float64 `json:"Device Rejected%"`
	DeviceElapsed       int     `json:"Device Elapsed"`
}

type SGDevsResponse

type SGDevsResponse struct {
	minerapi.ResponseCommon
	Devs []SGDev `json:"DEVS"`
}

type SGPool

type SGPool struct {
	POOL                int     `json:"POOL"`
	Name                string  `json:"Name"`
	URL                 string  `json:"URL"`
	Profile             string  `json:"Profile"`
	Algorithm           string  `json:"Algorithm"`
	AlgorithmType       string  `json:"Algorithm Type"`
	Description         string  `json:"Description"`
	Status              string  `json:"Status"`
	Priority            int     `json:"Priority"`
	Quota               int     `json:"Quota"`
	LongPoll            string  `json:"Long Poll"`
	Getworks            int     `json:"Getworks"`
	Accepted            int     `json:"Accepted"`
	Rejected            int     `json:"Rejected"`
	Works               int     `json:"Works"`
	Discarded           int     `json:"Discarded"`
	Stale               int     `json:"Stale"`
	GetFailures         int     `json:"Get Failures"`
	RemoteFailures      int     `json:"Remote Failures"`
	User                string  `json:"User"`
	LastShareTime       int     `json:"Last Share Time"`
	Diff1Shares         float64 `json:"Diff1 Shares"`
	ProxyType           string  `json:"Proxy Type"`
	Proxy               string  `json:"Proxy"`
	DifficultyAccepted  float64 `json:"Difficulty Accepted"`
	DifficultyRejected  float64 `json:"Difficulty Rejected"`
	DifficultyStale     float64 `json:"Difficulty Stale"`
	LastShareDifficulty float64 `json:"Last Share Difficulty"`
	HasStratum          bool    `json:"Has Stratum"`
	StratumActive       bool    `json:"Stratum Active"`
	StratumURL          string  `json:"Stratum URL"`
	HasGBT              bool    `json:"Has GBT"`
	BestShare           float64 `json:"Best Share"`
	PoolRejected        float64 `json:"Pool Rejected%"`
	PoolStale           float64 `json:"Pool Stale%"`
}

type SGPoolsResponse

type SGPoolsResponse struct {
	minerapi.ResponseCommon
	Pools []SGPool `json:"POOLS"`
}

type SGStat

type SGStat struct {
	STATS     int         `json:"STATS"`
	ID        string      `json:"ID"`
	Elapsed   int         `json:"Elapsed"`
	Calls     int         `json:"Calls"`
	Wait      float64     `json:"Wait"`
	Max       float64     `json:"Max"`
	Min       float64     `json:"Min"`
	ChipCount int         `json:"Chip Count"`
	Clock     int         `json:"Clock"`
	HWV       json.Number `json:"HWV"`
	FWV       json.Number `json:"FWV"`
	Algo      string      `json:"Algo"`
	USBPipe   string      `json:"USB Pipe"`
	USBDelay  string      `json:"USB Delay"`
	USBTmo    string      `json:"USB tmo"`
}

type SGStatsResponse

type SGStatsResponse struct {
	minerapi.ResponseCommon
	Stats []SGStat `json:"STATS"`
}

type SGSummary

type SGSummary struct {
	Elapsed            int     `json:"Elapsed"`
	MHSAv              float64 `json:"MHS av"`
	MHS5S              float64 `json:"MHS 5s"`
	KHSAv              float64 `json:"KHS av"`
	KHS5S              float64 `json:"KHS 5s"`
	FoundBlocks        int     `json:"Found Blocks"`
	Getworks           int     `json:"Getworks"`
	Accepted           int     `json:"Accepted"`
	Rejected           int     `json:"Rejected"`
	HardwareErrors     int     `json:"Hardware Errors"`
	Utility            float64 `json:"Utility"`
	Discarded          int     `json:"Discarded"`
	Stale              int     `json:"Stale"`
	GetFailures        int     `json:"Get Failures"`
	LocalWork          int     `json:"Local Work"`
	RemoteFailures     int     `json:"Remote Failures"`
	NetworkBlocks      int     `json:"Network Blocks"`
	TotalMH            float64 `json:"Total MH"`
	WorkUtility        float64 `json:"Work Utility"`
	DifficultyAccepted float64 `json:"Difficulty Accepted"`
	DifficultyRejected float64 `json:"Difficulty Rejected"`
	DifficultyStale    float64 `json:"Difficulty Stale"`
	BestShare          float64 `json:"Best Share"`
	DeviceHardware     float64 `json:"Device Hardware%"`
	DeviceRejected     float64 `json:"Device Rejected%"`
	PoolRejected       float64 `json:"Pool Rejected%"`
	PoolStale          float64 `json:"Pool Stale%"`
	LastGetwork        int     `json:"Last getwork"`
}

type SGSummaryResponse

type SGSummaryResponse struct {
	minerapi.ResponseCommon
	Summary []SGSummary `json:"SUMMARY"`
}

type SGVersion

type SGVersion struct {
	Miner   string `json:"Miner"`
	SGMiner string `json:"SGMiner"`
	API     string `json:"API"`
}

type SGVersionResponse

type SGVersionResponse struct {
	minerapi.ResponseCommon
	Version []SGVersion `json:"VERSION"`
}

type SystemInfo

type SystemInfo struct {
	IPAddr            string
	MACAddr           string
	Hostname          string
	KernelVersion     string
	FileSystemVersion string

	UptimeSeconds string

	ProductType      machine.Model
	ProductVersion   string
	MinerDescription string
	MinerVersion     string
	APIVersion       string
}

SystemInfo : Generic system info

Jump to

Keyboard shortcuts

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