nectarengine.nodeslist module

Utilities for working with the Hive Engine node benchmark metadata.

class nectarengine.nodeslist.Node(rank: float, url: str, data: Dict[str, ~typing.Any]=<factory>, failing_cause: str | None = None)

Bases: object

Represents a Hive Engine node sourced from FlowerEngine metadata.

as_url() str

Return the node endpoint as a normalized URL.

data: Dict[str, Any]
failing_cause: str | None = None
rank: float
url: str
class nectarengine.nodeslist.Nodes(auto_refresh: bool = True)

Bases: Sequence[Node]

Convenience accessor for FlowerEngine node benchmarks.

as_urls(limit: int | None = None) List[str]

Provide the node URLs, optionally truncated to limit entries.

beacon(limit: int | None = None, url: str = 'https://beacon.peakd.com/api/he/nodes', timeout: int = 15) List[Node]

Fetch Hive Engine nodes from the PeakD Beacon API.

beacon_history(limit: int | None = None, url: str = 'https://beacon.peakd.com/api/heh/nodes', timeout: int = 15) List[Node]

Fetch Hive Engine history nodes from the PeakD Beacon API.

fastest(limit: int = 1) List[Node]

Return the fastest nodes according to the benchmark ranking.

node_list() List[Node]

Return the currently cached node list, refreshing if empty.

primary_url() str | None

Return the highest-ranked node URL or None if unavailable.

refresh() List[Node]

Reload the node list from the PeakD Beacon API.