Small collection of commands to filter public Yggdrasil peers

mk16.de

In the Yggdrasil Public Peers Repository you will find a public list of Yggdrasil peers sorted by region.

Some of these peers are specified using a domain name. However, it is possible that these domain names are incorrectly listed on DNS blocklists, which are intended to keep out advertising and trackers. This has happened in the past with the aaoth.xyz peer, for example. To check something like this, you need a command that extracts the domain names from the public peers repository. Since I recently dealt with this topic again, I thought I would publish the commands:

grep --recursive --extended-regexp "  \* \`(tcp|tls|quic)://[a-z][a-z0-9\.]*:[0-9]{1,5}\`" public-peers/ | sed --regexp-extended 's/.*:\/\/([^:]+).*/\1/' | sort | uniq

However, you can also modify these commands slightly to extract other peers. For example, the following command extracts all peers (DNS, IPv4, IPv6):

grep --recursive --extended-regexp "  \* \`(tcp|tls|quic)://.+:[0-9]{1,5}\`" public-peers/ | sed --regexp-extended 's/.*`(.*)`.*/\1/' | sort

However, you can also restrict the search to a folder or a file. To extract all peers from Germany, for example, the following command can be used:

grep --recursive --extended-regexp "  \* \`(tcp|tls|quic)://.+:[0-9]{1,5}\`" public-peers/europe/germany.md | sed --regexp-extended 's/.*`(.*)`.*/\1/' | sort

This command counts all QUIC peers:

grep --recursive --extended-regexp "  \* \`(quic)://.+:[0-9]{1,5}\`" public-peers/ | sed --regexp-extended 's/.*`(.*)`.*/\1/' | wc -l

At the time of writing this blog entry, for example, there are 36.