Documentation ¶
Index ¶
- func GenKernelSource() string
- func GetOpenCLGPUs() ([]*cl.Device, error)
- type Backend
- type CpuMiner
- type GpuMiner
- type HashSettings
- type Hasher
- type MiningChallenge
- type MiningGroup
- type MiningNotify
- type MiningSetDifficulty
- type MiningTasker
- type Result
- type SolutionHandler
- type StratumClient
- type StratumPool
- type StratumRequest
- type StratumResponse
- type Work
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenKernelSource ¶
func GenKernelSource() string
burn a #define into the top of the kernel if you pass this in a as kernel parameter, the compiler can't unroll loops as effectively
func GetOpenCLGPUs ¶
Types ¶
type HashSettings ¶
type HashSettings struct {
// contains filtered or unexported fields
}
func NewHashSettings ¶
func NewHashSettings(challenge *MiningChallenge, publicAddr string) *HashSettings
type Hasher ¶
type Hasher interface { //base is a 52 byte slice containing the challenge and public address // the guessed nonce is appended to this slice and used as input to the first hash fn // returns a valid nonce, or empty string if none was found CheckRange(hash *HashSettings, start uint64, n uint64) (string, uint64, error) //number of hashes this backend checks at a time StepSize() uint64 Name() string }
interface for all mining implementations
type MiningChallenge ¶
type MiningChallenge struct { Challenge []byte Difficulty *big.Int RequestID *big.Int RequestIDs [5]*big.Int }
MiningChallenge holds information about a PoW challenge
type MiningGroup ¶
func NewMiningGroup ¶
func NewMiningGroup(hashers []Hasher) *MiningGroup
func SetupMiningGroup ¶
func SetupMiningGroup(cfg *config.Config) (*MiningGroup, error)
func (*MiningGroup) HashRateEstimate ¶
func (g *MiningGroup) HashRateEstimate() float64
func (*MiningGroup) Mine ¶
func (g *MiningGroup) Mine(input chan *Work, output chan *Result)
func (*MiningGroup) PreferredWorkMultiple ¶
func (g *MiningGroup) PreferredWorkMultiple() uint64
func (*MiningGroup) PrintHashRateSummary ¶
func (g *MiningGroup) PrintHashRateSummary()
type MiningNotify ¶
type MiningNotify struct { JobID string Challenge string PoolAddress string LowDifficulty *big.Int MedianDifficulty *big.Int NetworkDifficulty *big.Int CleanJob bool }
func (*MiningNotify) UnmarshalJSON ¶
func (n *MiningNotify) UnmarshalJSON(buf []byte) error
MiningNotify method that takes a slice of bytes and converts it into JSON-encoded data
type MiningSetDifficulty ¶
func (*MiningSetDifficulty) UnmarshalJSON ¶
func (n *MiningSetDifficulty) UnmarshalJSON(buf []byte) error
MiningSetDifficulty method that takes a slice of bytes and converts it into JSON-encoded data
type MiningTasker ¶
type MiningTasker struct {
// contains filtered or unexported fields
}
func CreateTasker ¶
func CreateTasker(cfg *config.Config, proxy db.DataServerProxy) *MiningTasker
type SolutionHandler ¶
type SolutionHandler struct {
// contains filtered or unexported fields
}
func CreateSolutionHandler ¶
func CreateSolutionHandler( cfg *config.Config, submitter zapCommon.TransactionSubmitter, proxy db.DataServerProxy) *SolutionHandler
type StratumClient ¶
type StratumClient struct {
// contains filtered or unexported fields
}
func StratumConnect ¶
func StratumConnect(host string, msgChan chan *StratumResponse) (*StratumClient, error)
func (*StratumClient) Listen ¶
func (c *StratumClient) Listen()
func (*StratumClient) Request ¶
func (c *StratumClient) Request(method string, params ...string) *StratumResponse
func (*StratumClient) Send ¶
func (c *StratumClient) Send(request *StratumRequest) *StratumResponse
func (*StratumClient) SetTimeout ¶
func (c *StratumClient) SetTimeout(timeout int64)
type StratumPool ¶
type StratumPool struct {
// contains filtered or unexported fields
}
func CreatePool ¶
func CreatePool(cfg *config.Config, group *MiningGroup) *StratumPool
function that takes the pointer to a config.Config and a MiningGroup and returns a pointer to a StratumPool struct containing a url, minerAddress, minerPassword, log and group
type StratumRequest ¶
type StratumResponse ¶
type StratumResponse struct { ID uint64 `json:"id"` Result *json.RawMessage `json:"result"` Error error `json:"error,string"` Method string `json:"method"` Params *json.RawMessage `json:"params"` }
Click to show internal directories.
Click to hide internal directories.