rpc

package
v0.0.0-...-98dca7c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: GPL-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBlockTemplateReply

type GetBlockTemplateReply struct {
	Difficulty     int64  `json:"difficulty"`
	Height         int64  `json:"height"`
	Blob           string `json:"blocktemplate_blob"`
	ReservedOffset int    `json:"reserved_offset"`
	PrevHash       string `json:"prev_hash"`
}

type GetInfoReply

type GetInfoReply struct {
	IncomingConnections int64  `json:"incoming_connections_count"`
	OutgoingConnections int64  `json:"outgoing_connections_count"`
	Height              int64  `json:"height"`
	TxPoolSize          int64  `json:"tx_pool_size"`
	Status              string `json:"status"`
}

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

	Accepts          int64
	Rejects          int64
	LastSubmissionAt int64
	FailsCount       int64
	Url              *url.URL

	Name string
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(cfg *pool.Upstream) (*RPCClient, error)

func (*RPCClient) Check

func (r *RPCClient) Check(reserveSize int, address string) (bool, error)

func (*RPCClient) GetBlockTemplate

func (r *RPCClient) GetBlockTemplate(reserveSize int, address string) (*GetBlockTemplateReply, error)

func (*RPCClient) GetInfo

func (r *RPCClient) GetInfo() (*GetInfoReply, error)

func (*RPCClient) Info

func (r *RPCClient) Info() *GetInfoReply

func (*RPCClient) Sick

func (r *RPCClient) Sick() bool

func (*RPCClient) SubmitBlock

func (r *RPCClient) SubmitBlock(hash string) (*JSONRpcResp, error)

func (*RPCClient) UpdateInfo

func (r *RPCClient) UpdateInfo() (*GetInfoReply, error)

Jump to

Keyboard shortcuts

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