stratum

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Close() error
	Jobs() chan Job
	SubmitShare(*Share)
}

func NewClient

func NewClient(protocol Protocol, pool Pool) (Client, error)

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type Job

type Job struct {
	JobId  string
	Blob   string
	Target string
}

type Message

type Message struct {
	Id      int         `json:"id,omitempty"`
	Method  string      `json:"method,omitempty"`
	Params  interface{} `json:"params,omitempty"`
	Result  interface{} `json:"result,omitempty"`
	Error   *Error      `json:"error,omitempty"`
	Jsonrpc string      `json:"jsonrpc,omitempty"`
}

type Pool

type Pool struct {
	URL      string   `yaml:"url" json:"url"`
	User     string   `yaml:"user" json:"user"`
	Pass     string   `yaml:"pass" json:"pass"`
	Email    string   `yaml:"email,omitempty" json:"email"`
	Protocol Protocol `yaml:"protocol,omitempty" json:"protocol"`
}

type Protocol

type Protocol string
var (
	ProtocolJsonrpc Protocol = "jsonrpc"
	// Implements the NiceHash stratum protocol
	// https://github.com/nicehash/Specifications/blob/master/EthereumStratum_NiceHash_v1.0.0.txt
	ProtocolNicehash Protocol = "nicehash"
)

type Share

type Share struct {
	MinerId string `json:"id"`
	JobId   string `json:"job_id"`
	Nonce   string `json:"nonce"`
	Result  string `json:"result"`
}

Jump to

Keyboard shortcuts

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