Skip to main content

Farcaster network mapping

Project description

fc-nmap

THis software is still in alpha and under heavy development. Things will change and break.

PyPI - Version PyPI - Python Version


Quickstart

pip install fc-nmap

fc-nmap --help

Usage: fc-nmap [OPTIONS] COMMAND [ARGS]...

  Farcaster Network Mapper

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  exportdb  Create a tab separated dump of the database
  initdb    Initialize the database
  scan      Scan will scan the network
  updatedb  Collect addtional information about each hub

scan will start from one hub, get its contact list and ask other hubs for their lists. Based on my tests so far, hops > 10 will make litte difference. Data collected is stored in a local sqlite3 db.

updatedb will collect additiona info.

dumpdb generates a text export.

Behind the scenes

fc-nmap initdb creates a local sqlite database where data is stored.

fc-nmap scan will start by asking a hub to provide its contact list (gRPC call GetCurrentPeers). Using this list, it will pick --hops hubs at random, and request their contact list too. The lists are combined and stored in the database.

fc-nmap updatedb --hub-info looks into the database and picks hubs that were recently active. (Recency is defined by comparing ContactInfoContentBody.timestamp collected when requesting the contacts lists and the current timestamp.) The command will try to connect to each one of the hubs, and collect additional info using GetInfo, and store the results in the local database.

fc-nmap updatedb --hub-location works similar to --hub-info, but uses ip2location.io to get location information about each hub IP. Again, information collected is stored in the local database. The script will not query ip2location for IPs that were looked up in the last 100 days. This helps staying within ip2location free plan limits.

fc-nmap export --report=all will export all "active" hubs. Use fc-nmap export --help` to get all the available exports/reports. Or connect directly to the local database (currently named hubs.db and stored in the directory where you called the previous commands) and run your own queries.

License

fc-nmap is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fc_nmap-0.0.8.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

fc_nmap-0.0.8-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file fc_nmap-0.0.8.tar.gz.

File metadata

  • Download URL: fc_nmap-0.0.8.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for fc_nmap-0.0.8.tar.gz
Algorithm Hash digest
SHA256 393daa405abd81dff68bb8c13d784e7e17f08ffdf03c6efce15a89bbc7de3303
MD5 37338b4bfb4876293793e5f2a6d8645f
BLAKE2b-256 ef57aa83343e3a33d5b04363d365d43d8ec855fd5047729d23c2fd056a87d471

See more details on using hashes here.

File details

Details for the file fc_nmap-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: fc_nmap-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for fc_nmap-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 db45ea659f5d5ccabc12ea3dc889baba83dafa20e96540fda8c63c1ba2344ec9
MD5 0d5f78e3e29d1fb3a4bd4b796d15b9a4
BLAKE2b-256 0ffb579dc7daa7b16c379bc1345e1fa5f57b5b30a028b5599fbc89c5a6b3ccef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page