Documentation ¶
Index ¶
Constants ¶
const DefaultChiaExecutableSuffix = "chia-blockchain/venv/bin/chia"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chia ¶
type Chia interface { // ListNodes will list all connected FullNodes ListNodes() (nodes []FullNode, err error) // RemoveNode will remove a connected Full Node by it's nodeId RemoveNode(nodeId string) error }
Chia interface to provide basic actions for Chia
type ChiaCli ¶
type ChiaCli struct { // ChiaExecutable represents the chia executable e.g. /home/steffen/chia-blockchain/venv/bin/chia ChiaExecutable string }
ChiaCli represents the chia command line interface
func (ChiaCli) ListNodes ¶
ListNodes will list all connected FullNodes. It basically acts as wrapper around "chia show -c"
func (ChiaCli) RemoveNode ¶
RemoveNode will remove the connected full node via "chia show -r nodeId"
type Context ¶
type Context struct { // ChiaExecutable the chia executable e.g. /home/steffen/chia-blockchain/venv/bin/chia ChiaExecutable string // Location is the location to filter for Location string // IsDownThreshold is true in case it was set by the user IsDownThreshold bool // DownThreshold is the down speed threshold to filter for DownThreshold float64 // Done indicates that we are done (--help, --version...) Done bool }
Context describes the environment of the tool execution
type FilterByDown ¶ added in v0.2.0
type FilterByDown struct { Nodes []FullNode // threshold the minimum (inclusive down speed) Threshold float64 }
FilterByDown can filter FullNodes by it's down speed. All Nodes which have a lower or equal down speed than specified by threshold will be present
func (FilterByDown) Filter ¶ added in v0.2.0
func (f FilterByDown) Filter() ([]FullNode, error)
Filter performs filtering of FullNodes by down threshold. All Nodes which have a lower or equal down speed than specified by threshold will be present
type FilterByLocation ¶
FilterByLocation can filter FullNodes by it's location
func (FilterByLocation) Filter ¶
func (f FilterByLocation) Filter() ([]FullNode, error)
Filter performs filtering of FullNodes by LocationToFilter. The Filtering is be performed in a case insensitive manner.
type FullNode ¶
type FullNode struct { // Ip V4 e.g. 127.0.0.1, 123.11.12.13 Ip string // Ports in format 61075/8444 Ports string // NodeId represents the node id (e.g. aaaabbcc) NodeId string // LastConnect in format May 14 11:15:20 LastConnect string // Up represents the uplink in MiB Up float64 // Down represents the downlink in MiB Down float64 }
FullNode represents a connected full node
func (FullNode) IpLocation ¶
IpLocation to get the corresponding location of the ipV4 of the FullNode
type GetLocation ¶
GetLocation to get the Geo Ip Location for a ipV4 Address