node

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: ISC Imports: 18 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 BlockDecodeArguments added in v0.15.0

type BlockDecodeArguments struct {
	Packed []byte `json:"packed"`
}

BlockDecodeArguments - the block to be decodeed

type BlockDecodeReply added in v0.15.0

type BlockDecodeReply struct {
	Block interface{} `json:"block"`
}

BlockDecodeReply - BlockDecode header and transactions

type BlockDumpArguments added in v0.15.0

type BlockDumpArguments struct {
	Height uint64 `json:"height,string"`
	Binary bool   `json:"binary"`
}

BlockDumpArguments - the block to be dumped

type BlockDumpRangeArguments added in v0.15.0

type BlockDumpRangeArguments struct {
	Height uint64 `json:"height,string"`
	Count  int    `json:"count"`
	Txs    bool   `json:"txs"`
}

BlockDumpRangeArguments - the block to be dumped

type BlockDumpRangeReply added in v0.15.0

type BlockDumpRangeReply struct {
	Blocks []interface{} `json:"blocks"`
}

BlockDumpRangeReply - BlockDumpRange header and transactions

type BlockDumpReply added in v0.15.0

type BlockDumpReply struct {
	Block interface{} `json:"block"`
}

BlockDumpReply - BlockDump header and transactions

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, ctr *counter.Counter, ann announce.Announce) *Node

func (*Node) BlockDecode added in v0.15.0

func (node *Node) BlockDecode(arguments *BlockDecodeArguments, reply *BlockDecodeReply) error

BlockDecode - return a decoded version of the block

func (*Node) BlockDump added in v0.15.0

func (node *Node) BlockDump(arguments *BlockDumpArguments, reply *BlockDumpReply) error

BlockDump - return a dump of the block

func (*Node) BlockDumpRange added in v0.15.0

func (node *Node) BlockDumpRange(arguments *BlockDumpRangeArguments, reply *BlockDumpRangeReply) error

BlockDumpRange - return a dump of the block

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