Documentation
¶
Overview ¶
* Qitmeer james
Copyright (c) 2019 The qitmeer developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Copyright (c) 2019 The qitmeer developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func GetPowType(powName string) pow.PowType
- type BaseDevice
- type BaseWork
- type Device
- func (this *Device) GetAverageHashRate() float64
- func (this *Device) GetIntensity() int
- func (this *Device) GetIsRunning() bool
- func (this *Device) GetIsValid() bool
- func (this *Device) GetMinerId() int
- func (this *Device) GetMinerType() string
- func (this *Device) GetName() string
- func (this *Device) GetStart() uint64
- func (this *Device) GetWorkSize() int
- func (this *Device) Init(i int, pool bool, ctx context.Context, cfg *common.GlobalConfig, ...)
- func (this *Device) InitDevice()
- func (d *Device) Release()
- func (this *Device) SetForceUpdate(force bool)
- func (this *Device) SetIsValid(valid bool)
- func (this *Device) SetNewWork(work BaseWork)
- func (this *Device) SetPool(b bool)
- func (this *Device) SetWorkSize(size int)
- func (this *Device) Status(wg *sync.WaitGroup)
- func (this *Device) StopTask()
- func (this *Device) SubmitShare(substr chan string)
- func (this *Device) Update()
- type MinerRobot
- type Robot
- type Stratum
- type StratumMsg
- type Work
Constants ¶
View Source
const SYMBOL_PMEER = "MEER"
Variables ¶
View Source
var ErrJsonType = errors.New("Unexpected type in json.")
ErrJsonType is an error for json that we do not expect.
Functions ¶
func GetPowType ¶
Types ¶
type BaseDevice ¶
type BaseDevice interface {
Mine(wg *sync.WaitGroup)
Update()
InitDevice()
Status(wg *sync.WaitGroup)
GetIsValid() bool
SetIsValid(valid bool)
GetMinerId() int
GetAverageHashRate() float64
GetName() string
GetStart() uint64
SetPool(pool bool)
SetNewWork(w BaseWork)
SetForceUpdate(force bool)
Release()
GetMinerType() string
StopTask()
GetIsRunning() bool
}
type Device ¶
type Device struct {
Cfg *common.GlobalConfig //must init
DeviceName string
HasNewWork bool
ForceStop bool
AverageHashRate float64
MinerId uint32
NonceStep uint64
NonceStart uint64
LocalItemSize int
NonceOut []byte
Started int64
GlobalItemSize int
CurrentWorkID uint64
Quit context.Context //must init
sync.Mutex
Wg sync.WaitGroup
Pool bool //must init
IsValid bool //is valid
SubmitData chan string //must
NewWork chan BaseWork
Err error
MiningType string
UartPath string
StopTaskChan chan bool
IsRunning bool
}
func (*Device) GetAverageHashRate ¶
func (*Device) GetIntensity ¶
func (*Device) GetIsRunning ¶
func (*Device) GetIsValid ¶
func (*Device) GetMinerId ¶
func (*Device) GetMinerType ¶
func (*Device) GetWorkSize ¶
func (*Device) InitDevice ¶
func (this *Device) InitDevice()
func (*Device) SetForceUpdate ¶
func (*Device) SetIsValid ¶
func (*Device) SetNewWork ¶
func (*Device) SetWorkSize ¶
func (*Device) SubmitShare ¶
type MinerRobot ¶
type Stratum ¶
type Stratum struct {
sync.Mutex
Cfg *common.GlobalConfig
Conn net.Conn
Reader *bufio.Reader
ID uint64
Started uint32
Timeout uint32
SubmitIDs []uint64
SubID uint64
AuthID uint64
PowType pow.PowType
Quit context.Context
}
func (*Stratum) ConnectRetry ¶
func (this *Stratum) ConnectRetry()
func (*Stratum) Reconnect ¶
Reconnect reconnects to a stratum server if the connection has been lost.
func (*Stratum) StratumConn ¶
StratumConn starts the initial connection to a stratum pool and sets defaults in the pool object.
type StratumMsg ¶
Click to show internal directories.
Click to hide internal directories.