An agnostic network crawler exposing comprehensive peer information and network topology information.
An agnostic network crawler exposing comprehensive peer information and network topology information.
Nebula is an agnostic network crawler. It starts with a set of bootstrap peers, asks them for other peers in the network and recursively repeats the process until all peers in the network have been contacted.
Currently, Nebula supports the following networks:
You can run
nebula networksto get a list of all supported networks.
Nebula supports the JSON, Postgres and ClickHouse storage backends. It powers many graphs on probelab.io for most of the supported networks above. Check out the "Topology" sections for any of the networks to get an idea. Gnosis uses Nebula to source its Network metrics here.
In addition to the open-source version, ProbeLab maintains a commercial offering of Nebula which includes:
Going forward, new feature development will continue exclusively as part of the commercial offering. The open-source version will remain available and maintained for existing functionality, but all new capabilities will be part of the commercial offering.
For pricing and access, please reach out to [email protected].
The crawler was:
You can find a demo on YouTube: Nebula: A Network Agnostic DHT Crawler
Grafana Dashboard is not part of this repository
The crawler is powering critical IPFS Amino DHT KPIs, used for Weekly IPFS Reports as well as for many metrics on probelab.io.
The main branch will contain the latest changes and should not be considered stable. The latest stable release that is production ready is version 2.4.0.
Head over to the release section and download binaries from the latest stable release.
git clone https://github.com/dennis-tra/nebula
cd nebula
just buildNow you should find the nebula executable in the dist subfolder.
Nebula is a command line tool and provides the crawl sub-command.
To simply crawl the IPFS Amino DHT network run:
nebula --dry-run crawl[!NOTE] For backwards compatibility reasons IPFS is the default if no network is specified
The crawler can store its results as JSON documents, in a Postgres, or in a Clickhouse database -
the --dry-run flag prevents it from doing any of it. Nebula will just print a
summary of the crawl at the end instead. For the IPFS network, a crawl takes ~5-10 min depending on
your internet connection. You can also specify the network you want to crawl by
appending, e.g., --network FILECOIN and limit the number of peers to crawl by
providing the --limit flag with the value of, e.g., 1000. Example:
nebula --dry-run crawl --network FILECOIN --limit 1000To find out which other network values are supported, you can run:
nebula networksTo store crawl results as JSON files provide the --json-out command line flag like so:
nebula --json-out ./results/ crawlAfter the crawl has finished, you will find the JSON files in the ./results/ subdirectory.
When providing only the --json-out command line flag you will see that the
*_neighbors.json document is empty. This document would contain the full
routing table information of each peer in the network which is quite a bit of
data (~250MB for the Amino DHT as of April '23) and is therefore disabled by
default
To populate the document, you'll need to pass the --neighbors flag to
the crawl subcommand.
nebula --json-out ./results/ crawl --neighborsThe routing table information forms a graph and graph visualization tools often
operate with adjacency lists. To convert the *_neighbors.json document
to an adjacency list, you can use jq and the following command:
jq -r '.NeighborIDs[] as $neighbor | [.PeerID, $neighbor] | @csv' ./results/2025-02-16T14:32_neighbors.json > ./results/2025-02-16T14:32_neighbors.csvIf you want to store the information in a proper database, you could run just start-postgres to start a local postgres instance via docker in the background and run Nebula like:
nebula --db-user nebula_local --db-name nebula_local crawl --neighborsAt this point, you can also start Nebula's monitoring process, which would periodically probe the discovered peers to track their uptime. Run in another terminal:
nebula --db-user nebula_local --db-name nebula_local monitorWhen Nebula is configured to store its results in a postgres database, then it also tracks session information of remote peers. A session is one continuous streak of uptime (see below).
However, this is not implemented for all supported networks. The ProbeLab team is using the monitoring feature for the IPFS, Celestia, Filecoin, and Avail networks. Most notably, the Ethereum discv4/discv5 and Bitcoin monitoring implementations still need work.
There are a few more command line flags that are documented when you runnebula --help and nebula crawl --help:
crawlThe crawl sub-command starts by connecting to a set of bootstrap nodes and then
requesting the information of other peers in the network using the network-native
discovery protocol. For most supported networks these are several Kademlia
FIND_NODE RPCs. For Bitcoin-related networks it's a getaddr RPC.
For Kademlia-based networks Nebula constructs the routing tables (kademlia k-buckets)
of the remote peer based on its PeerID. Then nebula builds
random PeerIDs with common prefix lengths (CPL) that fall in each of the peers' buckets, and asks if it knows any peers that are
closer (XOR distance) to the ones nebula just generated. This will effectively yield a list of all PeerIDs that a peer has
in its routing table. The process repeats for all found peers until nebula does not find any new PeerIDs.
[!TIP] You can use the
crawlsub-command with the global--dry-runoption that skips any database operations.
Command line help page:
…monitorThe monitor sub-command is only implemented for libp2p based networks and with the postgres database backend.
It polls every 10 seconds all sessions from the database (see above) that are due to be dialed
in the next 10 seconds (based on the next_visit_due_at timestamp). It attempts to dial all peers using previously
saved multi-addresses and updates their session instances accordingly if they're dialable or not.
The next_visit_due_at timestamp is calculated based on the uptime that nebula has observed for that given peer.
If the peer is up for a long time nebula assumes that it stays up and thus decreases the dial frequency aka. sets
the next_visit_due_at timestamp to a time further in the future.
Command line help page:
NAME:
nebula monitor - Monitors the network by periodically dialing previously crawled peers.
USAGE:
nebula monitor [command options]
OPTIONS:
--workers value How many concurrent workers should dial peers. (default: 1000) [$NEBULA_MONITOR_WORKER_COUNT]
--network value Which network belong the database sessions to. Relevant for parsing peer IDs and muti addresses. (default: "IPFS") [$NEBULA_MONITOR_NETWORK]
--help, -h show help
resolveThe resolve sub-command is only available when using the postgres datbaase backend. It goes through all multi addresses that are present in the database and resolves them to their respective IP-addresses. Behind one multi address can be multiple IP addresses due to, e.g., the dnsaddr protocol.
Further, it queries the GeoLite2 database from Maxmind to extract country information about the IP addresses and UdgerDB to detect datacenters. The command saves all information alongside the resolved addresses.
Command line help page:
NAME:
nebula resolve - Resolves all multi addresses to their IPNo open issues yet, or sync has not completed.