proto

package
v0.0.0-...-e66b27f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgFullNameJsonRpcREQ                               = "proto.JSONRpcREQ"
	MsgFullNameJsonRpcResp                              = "proto.JSONRpcRESP"
	MsgFullNameJSONRpcSetDifficultyRESP                 = "proto.JSONRpcSetDifficultyRESP"
	MsgFullNameJSONRpcNotifyRESP                        = "proto.JSONRpcNotifyRESP"
	MsgFullNameJobNotify                                = "proto.jobNotify"
	MsgFullNameJobDifficultyCheck                       = "proto.jobDifficultyCheck"
	MsgFullNameJobHashCheck                             = "proto.jobHashCheck"
	MiningRecvMethodSubscribe                           = "mining.subscribe"
	MiningRecvMethodExtranonceSubscribe                 = "mining.extranonce.subscribe"
	MiningRecvMethodAuthorize                           = "mining.authorize"
	MiningRecvMethodSubmit                              = "mining.submit"
	MiningRespMethodSetDifficulty                       = "mining.set_difficulty"
	MiningRespMethodNotify                              = "mining.notify"
	ConnAcceptd                                         = "conn.accepted"
	ConnClosed                                          = "conn.closed"
	ConnUnknown                                         = "conn.unknown"
	JobMethodNotify                                     = "job.notify"
	JobMethodDifficultyCheck                            = "job.difficulty.check"
	JobMethodHeightCheck                                = "job.height.check"
	AuthorizePass                       AuthorizeResult = true
	AuthorizeRefuse                     AuthorizeResult = false
	SubmitPass                          SubmitResult    = true
	SubmitRefuse                        SubmitResult    = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeREQ

type AuthorizeREQ struct {
	Id         *json.RawMessage
	WorkerName string
	Password   string
}

func NewAuthorizeREQ

func NewAuthorizeREQ() *AuthorizeREQ

func (*AuthorizeREQ) Load

func (o *AuthorizeREQ) Load(j *JSONRpcREQ)

func (*AuthorizeREQ) String

func (o *AuthorizeREQ) String() string

type AuthorizeResult

type AuthorizeResult bool

type ErrType

type ErrType int32
const (
	ErrOtherUnknown       ErrType = 20
	ErrJobNotFound        ErrType = 21
	ErrDuplicateShare     ErrType = 22
	ErrLowDifficultyShare ErrType = 23
	ErrUnauthorizedWorker ErrType = 24
	ErrNotSubscribed      ErrType = 25
)

func (ErrType) ErrMsg

func (p ErrType) ErrMsg() string

type JSONRpcNotifyRESP

type JSONRpcNotifyRESP struct {
	Id     interface{}   `json:"id"`
	Method string        `json:"method"`
	Params []interface{} `json:"params"`
}

func NewJSONRpcNotifyRESP

func NewJSONRpcNotifyRESP(params []interface{}) *JSONRpcNotifyRESP

func (*JSONRpcNotifyRESP) String

func (o *JSONRpcNotifyRESP) String() string

type JSONRpcREQ

type JSONRpcREQ struct {
	Id     *json.RawMessage `json:"id"`
	Method string           `json:"method"`
	Params []interface{}    `json:"params"`
}

func (*JSONRpcREQ) String

func (o *JSONRpcREQ) String() string

type JSONRpcRESP

type JSONRpcRESP struct {
	Id     *json.RawMessage `json:"id"`
	Result interface{}      `json:"result"`
	Error  []interface{}    `json:"error"`
}

func NewAuthorizeRESP

func NewAuthorizeRESP(id *json.RawMessage, result AuthorizeResult) *JSONRpcRESP

func NewErrJobNotFoundRESP

func NewErrJobNotFoundRESP(id *json.RawMessage) *JSONRpcRESP

func NewErrNotSubscribedRESP

func NewErrNotSubscribedRESP(id *json.RawMessage) *JSONRpcRESP

func NewErrOtherUnknownRESP

func NewErrOtherUnknownRESP(id *json.RawMessage) *JSONRpcRESP

func NewErrResp

func NewErrResp(id *json.RawMessage, errType ErrType) *JSONRpcRESP

func NewErrUnauthorizedWorkerRESP

func NewErrUnauthorizedWorkerRESP(id *json.RawMessage) *JSONRpcRESP

func NewSubmitRESP

func NewSubmitRESP(id *json.RawMessage, result SubmitResult) *JSONRpcRESP

func NewSubscribeRESP

func NewSubscribeRESP(id *json.RawMessage, notify interface{}, difficulty interface{}, extraNonce1 string, extraNonce2Length int) *JSONRpcRESP

func (*JSONRpcRESP) String

func (o *JSONRpcRESP) String() string

type JSONRpcSetDifficultyRESP

type JSONRpcSetDifficultyRESP struct {
	Method string   `json:"method"`
	Params []uint64 `json:"params"`
}

func NewJSONRpcSetDifficultyRESP

func NewJSONRpcSetDifficultyRESP(difficulty uint64) *JSONRpcSetDifficultyRESP

func (*JSONRpcSetDifficultyRESP) String

func (o *JSONRpcSetDifficultyRESP) String() string

type JobDifficultyCheck

type JobDifficultyCheck struct {
}

func (*JobDifficultyCheck) String

func (o *JobDifficultyCheck) String() string

type JobHeightCheck

type JobHeightCheck struct {
}

func (*JobHeightCheck) String

func (o *JobHeightCheck) String() string

type JobNotify

type JobNotify struct {
}

func (*JobNotify) String

func (o *JobNotify) String() string

type Loader

type Loader interface {
	Load(j *JSONRpcREQ)
}

type SubmitREQ

type SubmitREQ struct {
	Id          *json.RawMessage
	WorkerName  string
	JobId       string
	ExtraNonce2 string
	NTime       string
	Nonce       string
}

func NewSubmitREQ

func NewSubmitREQ() *SubmitREQ

func (*SubmitREQ) Load

func (o *SubmitREQ) Load(j *JSONRpcREQ)

type SubmitResult

type SubmitResult bool

type SubscribeREQ

type SubscribeREQ struct {
	Id        *json.RawMessage
	UserAgent string
	Session   string
}

func NewSubscribeREQ

func NewSubscribeREQ() *SubscribeREQ

func (*SubscribeREQ) Load

func (o *SubscribeREQ) Load(j *JSONRpcREQ)

func (*SubscribeREQ) String

func (o *SubscribeREQ) String() string

Jump to

Keyboard shortcuts

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