Skip to content

dbkeys/multiseeder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiseed : generic-seeder multi-chain

v0.1.1.0.multi

This is a multi-blockchain version of Team-Exor's generic-seeder. It can simultaneously track and serve IP's for up to 10 blockchain networks.

It relies on the ncurses library to present a consistent, organized display.

The multi-seeder is a multiple blockchain network crawler that maintains a list of IP addresses of the most reliable nodes on the networks and shares those node IPs via DNS request to anyone requiring an entry point into the decentralized networks. Choose between two main usage modes which consist of locally running a lightweight DNS server or feeding the data into a Cloudflare account in order to respond to DNS seed requests. If you just want to crawl a network to get a list of the connectable nodes, without worrying about the DNS setup, you can do that too. The seeder app is compatible with almost any bitcoin-based blockchain network and can be configured in a short amount of time by filling out a small handful of parameters in the configuration file with the data from your coin's network. Tested to work with Ubuntu 18.04+ and Debian 8.x+ but it should work fine on any Linux installation, although package names and install steps may differ.

This version seeks settings.conf files for up to 10 different blockchains in /usr/local/sDNS./settings.conf

Table of Contents

Features

  • Regularly revisits known nodes to check their availability
  • Cloudflare DNS integration
  • Block explorer integration (including support for a 2nd failover explorer)
  • Keep a running list of all nodes in the network or only show nodes that are above a certain version
  • Bans/Unlists nodes after enough failures, or bad behaviour
  • Keeps statistics over (exponential) windows of 2 hours, 8 hours, 1 day and 1 week, to base decisions on
  • Very low memory (a few tens of megabytes) and cpu requirements
  • Run multiple crawlers at the same time (96 threads simultaneously by default)
  • Force connections to IPv4 or IPv6 only if desired
  • Customizable options via configuration file

Full Setup Instructions

Detailed set up instructions can be found in the DNS Seeder Setup Guide

Quick Setup

Step 1 - Install Prerequisites - Libraries / Packages

sudo apt-get install git build-essential libboost-all-dev libssl-dev libcurl4-openssl-dev libconfig++-dev
sudo apt-get install ncurses-dev libncurses-dev libncurses5-dev libncursesw5-dev ncurses-doc

Step 2 - Download Source Code

git clone https://github.com/team-exor/generic-seeder.git

Step 3 - Navigate to Source Directory

cd generic-seeder

Step 4 - Configure Seeder Settings

cp ./settings.conf.template ./settings.conf

Make required changes in settings.conf

Step 5 - Build from Source

make

This will produce the multiseed binary

Usage

Local DNS Server Mode

The seeder app comes with a built-in DNS server which listens for DNS requests and serves results based on the IP addresses that have been crawled on your blockchain network. If, for example, you want to run a DNS seed on dnsseed.example.com, you will need an authorative NS record in example.com's domain record that points back to your server. It is required to create both an NS and an "A" record to tie everything together.

Example:

Record Type Name/Host Value/Nameserver
A vps 123.231.123.231
NS dnsseed vps.example.com

You can now run the seeder app on the vps.example.com system using the following terminal cmd (must be run with root permissions or the DNS server will not be able to listen for and respond to requests properly):

sudo ./multiseed -h dnsseed.example.com -n vps.myseeder.net

If you want the DNS server to report SOA records, you must provide an email address using the -m argument:

./multiseed -h dnsseed.example.com -n vps.myseeder.net -m admin@myseeder.net

Non-Root Workarounds

Because non-root users cannot access ports below 1024, an extra step is required to allow you to run the DNS server (which must always use port 53) without root privileges. There are two known options for running the seeder app using a non-root user account:

  1. The first non-root method is to use the setcap command to change the capabilities of the multiseed binary file to specifically allow the app to bind to a port less than 1024 (this one-time cmd requires root privileges):
sudo setcap 'cap_net_bind_service=+ep' /path/to/multiseed

Once the setcap command is complete, you can start the seeder app as per normal, without the need for sudo:

./multiseed -h dnsseed.example.com -n vps.example.com -m email@example.com
  1. The second non-root method is to add a redirect entry for port 53 in the iptables firewall system before running the seeder app as a non-root user (this one-time cmd requires root privileges):
sudo iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-port 5353

After adding the new iptables rule, the seeder app can be called without sudo, but you must always specify the redirected port using the -p argument:

./multiseed -h dnsseed.example.com -n vps.example.com -m email@example.com -p 5353

Cloudflare API Mode

Instead of using the DNS seeder app to run your own DNS server, you can alternatively utilize a free Cloudflare account to host the list of good nodes from your blockchain network. Extra setup is required before Cloudflare mode will work properly. Python 3+ and the Cloudflare Python API must be installed. Run the following cmds in the terminal, one line at a time:

sudo apt-get install python3 python3-pip
sudo pip3 install cloudflare

You must also fill in the Cloudflare API config section at the bottom of the settings.conf file.

Example:

cf_domain="example.com"
cf_domain_prefix="dnsseed"
cf_username="your_cloudflare_username"
cf_api_key="your_cloudflare_api_key"
cf_seed_dump="dnsseed.dump"

Run the seeder without the need to specify any additional options:

./multiseed

Let the seeder app run for a few minutes until a dnsseed.dump file is generated, and then you can test Cloudflare mode:

cd /path/to/seeder/cf-uploader && python3 seeder.py

Assuming no errors were reported, you can check that your seeder domain is working properly by running the following cmd in the format nslookup {cf_domain_prefix}.{cf_domain}:

nslookup dnsseed.example.com

If everything is working correctly, you will see a number of "Name:" and "Address:" lines near the end of the output:

Example:

Server:         2001:19f1:300:1702::3
Address:        2001:19f1:300:1702::3#53

Non-authoritative answer:
Name:   dnsseed.example.com
Address: 158.203.13.138
Name:   dnsseed.example.com
Address: 44.76.38.113
Name:   dnsseed.example.com
Address: 46.76.253.117
Name:   dnsseed.example.com
Address: 145.248.52.149
Name:   dnsseed.example.com
Address: 82.240.23.104
Name:   dnsseed.example.com
Address: 103.207.140.36
Name:   dnsseed.example.com
Address: 204.222.30.68

Once configured correctly, it is recommended to set up a cron job that will automatically update the seeds list every 30 minutes or so:

*/30 * * * * cd /path/to/seeder/cf-uploader && python3 seeder.py

Command-Line Options

  • -h or --host

    Hostname of the DNS seed

    Usage Example: ./multiseed -h dnsseed.example.com

  • -n or --ns

    Hostname of the nameserver

    Usage Example: ./multiseed -n vps.example.com

  • -m or --mbox

    E-Mail address reported in SOA records

    Usage Example: ./multiseed -m email@example.com

  • -t or --threads

    Number of crawlers to run in parallel (default 96)

    Usage Example: ./multiseed -t 150

  • -d or --dnsthreads

    Number of DNS server threads (default 4)

    Usage Example: ./multiseed -d 10

  • -a or --address

    Address to listen on (default ::)

    Usage Example: ./multiseed -a 24.45.22.148

  • -p or --port

    UDP port to listen on (default 53)

    Usage Example: ./multiseed -p 5353

  • -o or --onion

    Tor proxy IP/Port

    Usage Example: ./multiseed -o 127.0.0.1:9150

  • -i or --proxyipv4

    IPV4 SOCKS5 proxy IP/Port

    Usage Example: ./multiseed -i 46.5.252.55:1080

  • -k or --proxyipv6

    IPV6 SOCKS5 proxy IP/Port

    Usage Example: ./multiseed -k [2620:0:6b0:a:250:56ff:fe99:78f7]:1234

  • -w or --filter

    Allow these flag combinations as filters

    Usage Example: ./multiseed -w 0x1,0x5,0x9,0xd,0x49,0x400

  • -f or --forceip

    Force connections to nodes of a specific IP type
    valid options: a = all, 4 = IPv4, 6 = IPv6 (default a)

    Usage Example: ./multiseed -f 4

  • --wipeban

    Wipe list of banned nodes

    Usage Example: ./multiseed --wipeban

  • --wipeignore

    Wipe list of ignored nodes

    Usage Example: ./multiseed --wipeignore

  • --dumpall

    Dump all unique nodes

    Usage Example: ./multiseed --dumpall

  • -? or --help

    Show the help text

    Usage Example: ./multiseed -?


Need more help? Read the DNS Seeder Setup Guide


Compilation / Installation Notes

If you get this error: main.cpp:21:10: fatal error: filesystem: No such file or directory #include

It seems you have to include like this: #include <experimental/filesystem>.

#https://unix.stackexchange.com/questions/87458/make-fatal-error-openssl-sha-h-no-such-file-or-directory

About

Multiple BlockChain Node Tracker / DNS Seeder - based on Team-Exor's generic-seeder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published