1,807 Lines
- Python 95.1%
- Markdown 2.9%
- JSON 1.2%
- HTML 0.9%
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
| Key | Default | Meaning |
|---|---|---|
peers_url | https://publicpeers.neilalexander.dev/ | peer list page |
top_n | 3 | peers to keep |
config_path | "" | config to edit; empty = platform default |
reload | true | restart yggdrasil after writing |
reload_command | [] | custom restart command (list) |
probe_timeout_ms | 1500 | per-peer TCP timeout, 100..60000 |
parallel | 64 | concurrent probes, 1..512 |
schemes | ["tcp","tls","ws","wss"] | schemes to probe; quic is UDP and never probed |
online_only | false | probe only peers the site lists as online |
stale_db | "stale.json" | stale-host list next to the settings; "" disables |
stale_ttl_days | 7 | days a stale host is skipped |
peer_state | true | read peer states from yggdrasilctl -json getpeers |
state_command | [] | override that command (list) |
global_peers | [] | peers always written first, e.g. a private node |