node

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: ISC Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	Start uint64 `json:"Start,string"`
	Count int    `json:"count"`
}

Arguments - arguments for RPC

type BlockInfo

type BlockInfo struct {
	Height uint64 `json:"height"`
	Hash   string `json:"hash"`
}

BlockInfo - the highest block held by the node

type Counters

type Counters struct {
	Pending  int `json:"pending"`
	Verified int `json:"verified"`
}

Counters - transaction counters

type InfoArguments

type InfoArguments struct{}

InfoArguments - empty arguments for info request

type InfoReply

type InfoReply struct {
	Chain               string    `json:"chain"`
	Mode                string    `json:"mode"`
	Block               BlockInfo `json:"block"`
	Miner               MinerInfo `json:"miner"`
	RPCs                uint64    `json:"rpcs"`
	Peers               uint64    `json:"peers"`
	TransactionCounters Counters  `json:"transactionCounters"`
	Difficulty          float64   `json:"difficulty"`
	Hashrate            float64   `json:"hashrate"`
	Version             string    `json:"version"`
	Uptime              string    `json:"uptime"`
	PublicKey           string    `json:"publicKey"`
}

InfoReply - results from info request

type MinerInfo

type MinerInfo struct {
	Success uint64 `json:"success"`
	Failed  uint64 `json:"failed"`
}

MinerInfo - miner info, include success / failed mined block count

type Node

type Node struct {
	Log      *logger.L
	Limiter  *rate.Limiter
	Start    time.Time
	Version  string
	Announce announce.Announce
	Pool     storage.Handle
	// contains filtered or unexported fields
}

Node - type for RPC calls

func New

func New(log *logger.L, pools reservoir.Handles, start time.Time, version string, counter *counter.Counter, ann announce.Announce) *Node

func (*Node) Info

func (node *Node) Info(_ *InfoArguments, reply *InfoReply) error

Info - return some information about this node only enough for clients to determine node state for more detail information use HTTP GET requests

func (*Node) List

func (node *Node) List(arguments *Arguments, reply *Reply) error

List - list all node offering RPC functionality

type Reply

type Reply struct {
	Nodes     []rpc.Entry `json:"nodes"`
	NextStart uint64      `json:"nextStart,string"`
}

Reply - result from RPC

Jump to

Keyboard shortcuts

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