ping

package
v0.0.0-...-27d2469 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Set = Conditions{
	MaxFee:      2,
	MaxMiners:   35,
	MaxNextPing: 25 * time.Millisecond,
	PingPackets: 2,
	PingTimeout: 2000000000,
}

Functions

func CheckCurrentMiners

func CheckCurrentMiners(jsonPayload map[string]interface{}) bool

To ensure efficiency of the selected p2pool node a limit of miners has been put in place, returns true if the number is equal to Maxminers or below

func CheckFee

func CheckFee(jsonPayload map[string]interface{}) bool

func GetNodeInformation

func GetNodeInformation(NodeURL string) (jsonPayload map[string]interface{}, err error)

Instead of making a http request to the node each time we need to get information, we do it once and then reuse the collected data.

func GetSelectedNode

func GetSelectedNode(testnet bool)

func PingNodes

func PingNodes(NodeList []Nodes) error

Types

type Conditions

type Conditions struct {
	MaxFee      float64
	MaxMiners   int
	MaxNextPing time.Duration
	PingPackets int
	PingTimeout time.Duration
}

type Nodes

type Nodes struct {
	Hostname string `json:"Hostname"`
	Stratum  string `json:"Stratum"`
	URL      string `json:"URL"`
	PingTime time.Duration
}

type SelectedNode

type SelectedNode struct {
	P2PoolStratum string
	P2PoolURL     string
}
var Selected SelectedNode

Jump to

Keyboard shortcuts

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