rpc

package
v0.0.0-...-aa050c9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBlockReply

type GetBlockReply struct {
	Number     string `json:"number"`
	Difficulty string `json:"difficulty"`
}

type JSONRpcResp

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

type RPCClient

type RPCClient struct {
	sync.RWMutex
	Url  *url.URL
	Name string
	Pool bool

	Accepts          uint64
	Rejects          uint64
	LastSubmissionAt int64

	FailsCount uint64
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(name, rawUrl, timeout string, pool bool) (*RPCClient, error)

func (*RPCClient) Check

func (r *RPCClient) Check() (bool, error)

func (*RPCClient) GetPendingBlock

func (r *RPCClient) GetPendingBlock() (GetBlockReply, error)

func (*RPCClient) GetWork

func (r *RPCClient) GetWork() ([]string, error)

func (*RPCClient) Sick

func (r *RPCClient) Sick() bool

func (*RPCClient) SubmitBlock

func (r *RPCClient) SubmitBlock(params []string) (bool, error)

func (*RPCClient) SubmitHashrate

func (r *RPCClient) SubmitHashrate(params interface{}) (bool, error)

Jump to

Keyboard shortcuts

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