Pages:
Author

Topic: A Basic Guide/Tutorial for Creating DNS Seeders - page 2. (Read 7116 times)

sr. member
Activity: 465
Merit: 254
Awesome stuff, thanks for posting this. How can one check to see if it works? Are there any stats that can be read either from the directory or by sending commands to the process?
newbie
Activity: 34
Merit: 0
Hey PereguineBerty

Thanks for the guide, it was helpful.

But I still have a question.  What does this do?

static inline int GetRequireHeight(const bool testnet = fTestNet)
  {
     return testnet ? 0 : 470000;
  }

Return 0 when on testnet and return 470000 when on mainnet, I guess, but what does in control exactly? Trying to adapt this for another coin and I don't quite understand this part.

Thanks
newbie
Activity: 34
Merit: 0
Yes, it is possible.  They use different ports.
newbie
Activity: 1
Merit: 0
is that possible to run yourcoind and software seeder software together on one server?
hero member
Activity: 525
Merit: 531
Just a note.
You sould create a NS domain record not an A record. Becase this seeder act as a dns server, and answer for the request with 3-4 valid ips.

Elbandi
legendary
Activity: 996
Merit: 1013
Great guide!
member
Activity: 109
Merit: 35
These can be a serious pain in the ass to get working and let’s face it – the information available on them is rather fragmented and vague at best, even if you are already accustomed to the workings of currencies.

This guide is divided into three parts:
1)   Adapting the seeder software
2)   The web stuff
3)   Running the seeder

Before doing anything else, it would be best to have a web address in mind for your seeder. Most of them use subdomains i.e. dnsseed.yourcoin.org rather than regular page links such as yourcoin.org/dnsseed (this is for DNS record reasons). You don’t have to call yours dnsseed; in fact you can call it what the hell you like.

Adapting the Software
1.1)  In your currency’s net.cpp enter the address that will be used for your seeder i.e.

Code:
static const char *strMainNetDNSSeed[][2] = {
{"yourcoin.org", " dnsseed.yourcoin.org "},
        {NULL, NULL}
}

You will need to recompile all your wallets before release for these changes to take effect, so make sure you settle for something that won’t need to be changed later.

1.2)  Download or make a fork of the Litecoin Seeder https://github.com/pooler/litecoin-seeder which is based on sipa’s Bitcoin Seeder https://github.com/sipa/bitcoin-seeder). You can use either version and it doesn’t matter whether your coin is SHA-256, Scrypt, X-11 etc. The LTC version is used here for demonstration purposes because it has already been customized and the most relevant/important stuff has already been changed. This means there’s commit history and it’s much easier to show changes using GitHub as it has color coded syntax highlighting - which isn’t possible on this forum. Whichever version you use, read the README to familiarize yourself with the process.

1.3)  Using this Litecoin Seeder historical commit as a reference: https://github.com/pooler/litecoin-seeder/commit/3c64ed5ab35f597480712818a27d442100332719#diff-4ed1bfdfd26731997cfdb6c1085c6692, you need to alter your own seeder code with  your coin’s ports, magic bytes (pchMessageStart stuff), protocol version, seeder name and the web address of your of your DNS seed.

Note:  When adding your domain name in the seeder’s main.cpp, if you only have one site to enter, use the following syntax in full:

Code:
static const string mainnet_seeds[] = {"dnsseed.yourcoin.org", ""};

Otherwise you will get segmentation faults when compiling later.

1.4)  Upload your repo to GitHub.


The Web Stuff
The main point of this stage is to (very loosely put it) redirect traffic from your website by creating a DNS 'NS Record' and an 'A record' to instruct where the resources can be found. This will enable your web address to forward to a host somewhere else, such as a VPS running the DNS Seeder software.

2.1) In your website host’s admin panel website, create a subdomain. If you are self-hosting you probably might not need to create a subdomain and can just use DNS records to achieve the desired result. Use the address entered in your currency’s main.cpp i.e dnsseed.yourcoin.org. Web host admin panels vary tremendously, so you may need to Google how to do this on yours. This link has useful info on creating an NS record http://help.dnsmadeeasy.com/spry_menu/ns-record/

You might need to do this twice – once for dnsseed.yourcoin.org and again for www.dnsseed.yourcoin.org. Alternatively, if you self-host, you will need to use the run in this Linux terminal command to create the NS record:

Code:
dnsseed.yourcoin.org   86400    IN      NS     192.168.0.1

(Obviously changing the dnsseed.yourcoin.org and 192.168.0.1 to the relevant domain name and IP address of your VPS).

2.2) Create an 'A Record' (Address record) that points your dnsseed.yourcoin.org to the IP address of your VPS.

You can check the DNS status by typing the following into a Windows/Linux/Mac command prompt/terminal, even on your home PC:

Code:
nslookup dnsseed.yourcoin.org

The IP address of your VPS should be displayed if the record is working correctly but be aware it may take a while for the DNS record to propagate, so please be patient.

Please note that some web hosts do not allow you to create NS records on shared hosting plans, so if the option to create one isn't available, send their support team a message. They create one for you or may tell you that you need to upgrade your hosting plan. Try your luck with just an A record instead and see if it works.


Running the seeder

The seeder has to be compiled before it can be used!

3.1) Clone your seeder’s GitHub repository onto the VPS/server that will be running it and navigate into the seeder’s main folder.

3.2) If you are using 64-bit operating systems, make sure that initial compiler flags in the Makefile are set to:

Code:
CXXFLAGS = -O3 -g0 	(i.e. remove –march=native because this will cause architecture issues)

3.3) To compile, type the following the terminal:

Code:
make

3.4)  Now you need to instruct the seeder to run and look up the host and name server, so in the terminal you need to enter something along the lines of the following but (obviously!!)..... change dnsseed.yourcoin.org to your seeder’s website address and the 192.168.0.1 to your server/VPS IP address.

Code:
./dnsseed -h dnsseed.yourcoin.org -n 192.168.0.1

This guide isn’t a definitive guide and WILL need some improvements so if you come across any problems, please post them in here rather than PM me as I don’t have time to help everybody. Hopefully people who have come across similar issues too will be able to help out and turn this thread into something that is a useful resource.

Pages:
Jump to: