Skip to content
shermand100 edited this page Jan 23, 2024 · 2 revisions

IP2GEO Tools

This tool is just a bit of fun to see what can be done with the information available to a Monero Node.

Recommended hardware for this tool Raspberry Pi 4 or equivalent/higher

So for a while now you've had a few text format status boxes that show recently seen peers on the "connection status" page. These nodes, "white" as they're referred to have their info shared across the network to help keep everyone connected. The current display is a little dull and not easy to look at as a list of IPs and node ID's.

So I've had a play with how to locally produce a low-spec version of monerohash.com/nodes-distribution.html.

The Monerod command --print-pl (bottom table of "connection status" tab), outputs up to 1000 Nodes in a format like this:


white 0000000036fb6b51 116.203.42.1:18080 18089 - 181 d0.h10.m13.s22


white 00000000a3172789 24.15.134.1:18080 - - 0 d0.h7.m43.s54


white 00000000c6ea5a0b 192.99.232.2:18080 - - 0 d0.h13.m39.s36


From this we can extract the IP, and run it through a database to extract info of what is likely* to be a nodes Country, Region, City, ISP, Lat&Long. Via a free database (such as what MaxMind.com offer) it's reported that it gives accurate results to a country level at 90% or more for developed countries, with city level accuracy at 75%. I2P, tor, or nodes run on a virtual service (rented data centre) would not disclose the location of their true owner.

These data centres can be seen as red clusters on the maps that are produced.

A sample of the results:

IP2Geo Sample

As you can see the quality reduces as the map is brought in tighter on a location, and resolution cannot be increased any higher on a Raspi3 due to RAM limits.

At the bottom of the page is the result of another script that produces the data that was used for the map into a CSV database with TAB separated values. This is a format that is very well suited for importing into spreadsheets where you can manipulate as you wish, (Pie charts of country distribution for example).


How to use this page:

1. IP location database (updated weekly - free with signup) https://www.maxmind.com/en/geolite2/signup

Download the "GeoLite2-City.mmdb" file from the link above and use the upload function on the PiNode-XMR interface to add it to your device. This is required to convert IP addresses to locations. Unfortunately for licencing reasons I cannot provide this database with PiNode-XMR.

2. The next thing to do is to have a node running on PiNode-XMR for more than 20 minutes. It doesn't matter which mode you use and any will refresh your white/grey peer list.

3. Then click "Pull White Node List" with the node still running. This will produce a list of up to 1000 recently available Monero nodes in a format that the database can understand. This happens in the background so you won't see the list, but the browser notification will show the process has finished and should only take a couple of seconds.

4. Choose a map to create. Once created they will remain visible with their creation date until overwritten. Click "Create New ### Map", then wait for the web notification to show the process has completed. This is important to wait and dependent on hardware can take up several minutes. Please understand that your device isn't just placing dots on a pre-computed map. It renders the entire image from scratch, placing country and state borders, coastlines etc and is very CPU and RAM intensive. If you attempt to generate more than one map at once your device will almost certainly run out of RAM and crash.

Raspberry Pi 3b+ users can use this feature with some extra steps. (1) After selecting "Pull White Node List", stop your running node. (2) Enable the 2GB swap file. (4) Generate your maps one at a time. This will take significantly longer, ~6-7 Minutes.


Lastly there is the option to generate a CSV list of connected node data. This pulls the white list and attaches Node locations in written format which can be easily imported into spreadsheets etc for creating graphs, charts or other manipulation/trending.

If anyone has experience of a better method to achieve something like this please let me know.

Clone this wiki locally