Update Relay Node Map

How to produce an up-to-date map of the current distribution of relay nodes

Step 1: Retrieve Unique Targets

From a Linux or a Linux-compatible box, use the dig command to query the algobootstrap service on mainnet.algorand.network for its records.

To do this run the following command:

dig _algobootstrap._tcp.mainnet.algorand.network SRV +short

This produces a list of uniquely named targets of the form r-xx.algorand-mainnet.network, where xx is a pair of alphanumeric characters.

Step 2: Resolve Target Network Addresses

These names can be resolved to standard DNS names and IP addresses using dig again. For example, the target r-y1.algorand-mainnet.network can be resolved as follows:

dig r-y1.algorand-mainnet.network +short

Note: Not all targets have proper DNS names, and a target may resolve to multiple IP addresses. For example, the above command produced the output:


Which seems to be a relay node run by AlgoNode and reachable through two different IP addresses.

Repeat this step for each of the named targets to resolve the entire list of targets and collect the resulting list of IP addresses in a file, say relay_nodes_ips.

Step 3: Generate Location Metadata

Use ipinfo.io (or a similar service) to generate the corresponding location metadata. For instance, using ipinfo.io, the following command (where <TOKEN> is a secret you obtain by registering for free at ipinfo.io) saves location metadata for each IP in the list relay_nodes_ips in JSON format in a file called locations.json:

cat relay_nodes_ips | curl -XPOST --data-binary @- "ipinfo.io/batch?token=<TOKEN>ā€œ > locations.json

Step 4: Extract Location Information

Extract from the retrieved JSON a list of latitude/longitude location information (using the handy jq command for processing JSON):

jq -r '.[] | .loc | select( . != null )' locations.json

Step 5: Map Relay Node Locations

Import the resulting list at some mapping service, such as mapcustomizer.com or mymaps.google.com, to generate a map of relay node locations.

Last updated