ygg-peers-prober
0 forks
id: 18
1,807 Lines
  • Python 95.1%
  • Markdown 2.9%
  • JSON 1.2%
  • HTML 0.9%
README.md

ygg-peers-prober

Fetches https://publicpeers.neilalexander.dev/, gets fastest by ping peers, rewrites the Peers array of yggdrasil.conf and restarts yggdrasil.

Requirements

Python 3

Usage

python3 prober.py --config path_to_yggdrasil.conf

CLI

prober.py --help
usage: ygg-peers-prober [-h] [-s PATH] [--config PATH] [-n N] [--timeout-ms N] [--dry-run] [--no-reload] [-v] [--version]

Rewrite the yggdrasil Peers array with the lowest-latency public peers.

options:
  -h, --help           show this help message and exit
  -s, --settings PATH  settings file (default: settings.json next to the script)
  --config PATH        yggdrasil.conf to rewrite (overrides config_path)
  -n, --top N          number of peers to keep (overrides top_n)
  --timeout-ms N       per-peer TCP connect timeout in ms
  --dry-run            report the selection without touching any file
  --no-reload          write the config but do not restart yggdrasil
  -v, --verbose        print one line per failed probe
  --version            show program's version number and exit

Settings

KeyDefaultMeaning
peers_urlhttps://publicpeers.neilalexander.dev/peer list page
top_n3peers to keep
config_path""config to edit; empty = platform default
reloadtruerestart yggdrasil after writing
reload_command[]custom restart command (list)
probe_timeout_ms1500per-peer TCP timeout, 100..60000
parallel64concurrent probes, 1..512
schemes["tcp","tls","ws","wss"]schemes to probe; quic is UDP and never probed
online_onlyfalseprobe only peers the site lists as online
stale_db"stale.json"stale-host list next to the settings; "" disables
stale_ttl_days7days a stale host is skipped
peer_statetrueread peer states from yggdrasilctl -json getpeers
state_command[]override that command (list)
global_peers[]peers always written first, e.g. a private node
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover