Fetch live peers for Cosmos SDK chains from the Polkachu API.
A Go rewrite of py_peerscout (now archived). The original was a Python script for retrieving and filtering peers from Polkachu's live peer list. This version is a proper CLI with parallel fetching, deduplication, multiple output formats and configuration management.
brew install matcra587/tap/peerscoutAlso available via go install and pre-built binaries. All installs
support peerscout update for self-updating.
See docs/installation.md for details.
peerscout find cosmos # Fetch 5 peers with geolocation
peerscout find cosmos -n 15 # Fetch 15 peers
peerscout find cosmos -c GB,US # Only peers in GB or US
peerscout find cosmos -f csv # Comma-separated for config files
peerscout find cosmos -f json # JSON with country codes
peerscout find cosmos --seed-node # Polkachu seed node
peerscout find cosmos --state-sync # State-sync RPC endpoint
peerscout find cosmos --addrbook # Addrbook download URL
peerscout list # Show all supported networksSettings are loaded in precedence order:
- Compiled defaults
- TOML config file (
~/.config/peerscout/config.toml) - Environment variables (
PEERSCOUT_*) - CLI flags
Manage settings directly:
peerscout config set count 10 # Set default peer count
peerscout config list # Show current settings
peerscout config get count # Show a single setting
peerscout config unset count # Clear a setting
peerscout config path # Show config file pathPeer IPs are enriched with country data via country.is (default) or ipinfo.io. Country codes appear in plain output and full country names in JSON.
peerscout config set geo_provider ipinfo # Switch provider
peerscout config set geo_token <token> # Set ipinfo token
peerscout config set geo_provider none # Disable enrichmentFilter peers by country using ISO 3166-1 alpha-2 codes. Codes are case-insensitive and can be comma-separated or repeated.
peerscout find cosmos -c GB # Only UK peers
peerscout find cosmos -c GB,US # UK or US peers
peerscout find cosmos -c GB -c US # Same, using repeated flags
peerscout config set country GB,US # Persist filter in configWhen no peers match the country filter, peerscout retries up to
--max-retries rounds (default 5) before exiting.
peerscout find cosmos -c DE --max-retries 10Also configurable via env vars: PEERSCOUT_COUNTRY=GB,US and
PEERSCOUT_MAX_RETRIES=5.
| Format | Description |
|---|---|
plain (default) |
One peer per line |
json |
Indented JSON |
csv |
Comma-separated single line |
Use --agent for AI agent consumption (forces JSON, quiet mode).
Use -q/--quiet to suppress all non-data output.
peerscout --install-completion # Install for your current shellTab-completing peerscout find <tab> fetches the network list
from the API.
| Endpoint | Description |
|---|---|
GET /api/v2/chains |
List all supported networks |
GET /api/v2/chains/{network}/live_peers |
Fetch live peers |
GET /api/v2/chains/{network} |
Seed node, state-sync endpoint, addrbook URL |
Data sourced from the Polkachu API v2.
Feature parity with py_peerscout, rebuilt incrementally:
- Geolocation enrichment - country codes via country.is/ipinfo
- Geolocation filtering - filter peers by country/region
- Latency probing - ICMP with TCP fallback
- Peer validation - verify peers are reachable
- Daemon mode - systemd service with configurable interval
- Metrics - emit alerts when peers become unviable
mise install # Install Go and project tools
mise run build # Build to ./dist/
mise run test # Run tests
mise run lint # Run golangci-lint
mise run fmt # Format with gofumptSee docs/installation.md for install details and docs/releasing.md for the release flow.