Jump to content

Generic-Seeder DNS Seeds


buzzkillb
 Share

Recommended Posts

A really nice fork of sipa dns seeder that makes everything easy for basically any bitcoin fork (altcoin) like a Denarius. https://github.com/team-exor/generic-seeder

Clone and make the binary

sudo apt-get install build-essential libboost-all-dev libssl-dev libcurl4-openssl-dev libconfig++-dev
git clone https://github.com/team-exor/generic-seeder
cd generic-seeder
make

settings.conf

protocol_version="33900"
init_proto_version="33900"
min_peer_proto_version="33900"
caddr_time_version="33900"
pchMessageStart_0 = "0xfa"
pchMessageStart_1 = "0xf2"
pchMessageStart_2 = "0xef"
pchMessageStart_3 = "0xb4"
wallet_port="33369"
explorer_url="https://chainz.cryptoid.info/d/api.dws?q=getblockcount"
second_explorer_url=""
explorer_requery_seconds="60"
block_count="3272984"
seed_1="dnsseed.denarius.guide"
seed_2="dnsseed.denarius.pro"
seed_3="mseed.denarius.guide"
seed_4=""
seed_5=""
seed_6=""
seed_7=""
seed_8=""
seed_9=""
seed_10=""
cf_domain=""
cf_domain_prefix=""
cf_username="[email protected]"
cf_api_key=""
cf_seed_dump="dnsseed.dump"

Using bseed.denarius.guide as the sample seeder that's in Denarius wallet already.

A record setup

image.png.eafa944d0824eb44e6b6ae69e2260b71.png

NS setup

image.png.223d12f554d48da185d1afa30deeaf0c.png

Give that a few minutes to propagate and then run the seeder like this which matches the above.

./dnsseed -h bseed.denarius.guide -n vps.denarius.guide -m buzz.denarius.guide

Wait to get some seeds.

image.thumb.png.b791d9548e0b1ead77506850040343e9.png

Then check propagation from https://www.whatsmydns.net/#A/vps.denarius.guide

 image.png.3dfb5ca8ce0427bd75212bd48d3d10af.png

Then check your seeder is working https://www.whatsmydns.net/#A/bseed.denarius.guide

image.png.3adb0631f5e268332dbe2f28eb90fddf.png

Then spinup a linux vm and type

nslookup bseed.denarius.guide

and you should see

Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
Name:	bseed.denarius.guide
Address: 95.111.245.53
Name:	bseed.denarius.guide
Address: 67.172.231.51
Name:	bseed.denarius.guide
Address: 77.56.152.58
Name:	bseed.denarius.guide
Address: 92.106.177.110

And your seeder is setup. huge thanks to @joeuhren for getting this to work on Denarius extremely easy.

To exit and leave screen session open type

ctrl a+d

to get back in type

screen -ls

will show 

There is a screen on:
	13441.generic-seeder	(05/18/2020 06:36:18 AM)	(Detached)

type

screen -r 13441.generic-seeder

to get back in. example: screen -r number then push tab to autocomplete the rest and push enter

  • Like 1
Link to comment
Share on other sites

Awesome guide! I'm looking forward to further simplifying and improving the seeder process in the future.

Also, I figure I should move any further correspondence about the generic-seeder over to this thread since I sort of hijacked the Duct Tape DNS Seeder thread earlier.

In response to your last question from the other thread:

Quote

Does this handle onion nodes?

I haven't actually played much with tor and onion nodes before, so I can't give a definite YES, but the original sipa bitcoin-seeder has a single onion seed listed (kjy2eqzk4zwi5zd3.onion) and seems to have the necessary plumbing to handle onion nodes, I'm just not sure exactly how to use it. There is a cmd line argument that looks like it may help:

-o <ip:port>    Tor proxy IP/Port

So I assume you need to setup and run a tor instance that is outside of the seeder - something like this https://www.linux.com/topic/networking/beginners-guide-tor-ubuntu/, and then you can run the seeder as per normal with the extra -o argument to pass your tor proxy ip and port so that the seeder can communicate with onion nodes. In theory I think that should be it. Someone please correct me if I am wrong because I'm assuming all of this just from a quick glance.

  • Like 3
Link to comment
Share on other sites

Going to try this out, more since I am running a daemon on the seeder vps, and want to see if the seeder grabs any of the onion nodes I am currently running. I am running fortunastake on port 9999, but typical person would switch out 9999 to 33369. Also denarius uses tor=127.0.0.1:9050 in denarius.conf. Again don't need to run a daemon on the seeder itself, just like an all in one vps, and curious if this will only pick up port 33369 onions or also port 9999.

install tor quickly

sudo apt install tor

sudo nano /etc/tor/torrc

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServiceVersion 2
HiddenServicePort 9999 127.0.0.1:9999
HiddenServicePort 33369 127.0.0.1:9999

restart tor

sudo service tor restart

get the new onion address

sudo cat /var/lib/tor/hidden_service/hostname

add these lines to denarius.conf

tor=127.0.0.1:9050
externalip=xnbolpbtb6hjgz67.onion

restart daemon, then restart seeder with the option

-o 127.0.0.1:9050

Don't actually need to do any of that except install tor.

and the final generic-seeder line is

./dnsseed -h dnsseed.denarius.pro -n vps.denarius.pro -m buzz.denarius.io -o 127.0.0.1:9050

already picking other onion nodes up and both ports =], good enough for now.

37gfwk6647pdqxci.onion:33369                        0   1589841222   24.29%   6.72%   2.29%   0.33%   0.08%  3276995  0000001f  33900 "/Denarii:3.3.9.7/"
ylyw4ttjkbws3yj4.onion:9999                         0   1589841238   23.77%   6.56%   2.24%   0.32%   0.08%  3276995  00000001  33900 "/Denarii:3.3.9.7/"

 

  • Like 1
Link to comment
Share on other sites

Attempting a docker just because, but not sure if there is an easy way to pass the settings.conf file through to keep it generic using variables or something.

Dockerfile

FROM alpine:3.11 as builder

RUN apk update && apk add \
    g++ \
    gcc \
    libc-dev \
    make \
    git \
    openssl-dev \
    curl-dev \
    libconfig-dev \
    boost-dev && \
    git clone https://github.com/team-exor/generic-seeder.git && \
    cd generic-seeder && \
    make

FROM alpine:3.11

RUN apk --no-cache add    \
      libgcc              \
      libstdc++ \
      libconfig-dev \
      curl-dev

RUN mkdir -p /data

VOLUME ["/data"]

COPY --from=builder /generic-seeder/dnsseed /usr/local/bin/

EXPOSE 53

ENTRYPOINT ["dnsseed"]
CMD ["--help"]

I built locally as seeder:1.0 in a ~/docker/seeder folder

docker build --tag seeder:1.0 .

A simple run of the above after building to make sure the commands pass through.

docker run -it -v ~/docker/seeder/settings.conf:/settings.conf seeder:1.0 -o 127.0.0.1:9050

The image comes out to about 10megs, haven't tested connecting or anything, and probably exposing port 53 isn't the best for something generic. Unclear if building in debian:buster-slim is better than alpine, or even some ubuntu slimmed down version. Eventually combine into a daemon, electrumx, tor, and seeder docker-compose.yml.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Figured I would post a github up for this and a docker-compose.yml sample.  Building locally on a pi4 4gb to test, and was curious if armv7 would compile. Going to build the x64 dockerhub first, and maybe do an arm dockerhub build. Keeps its very generic, and also smallest alpine build I could think of, though no python/cloudflare option yet for mine. Below example of image size, Ubuntu and Debian base image was becoming enormous. TOR is not install, but the full command line does work, and configured inside the docker-compose.

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
seeder              1.0                 af13223bc05b        41 minutes ago      8.18MB

https://github.com/buzzkillb/docker-generic-seeder

In action from docker-compose.

image.thumb.png.2e0d541fab82b620986b3b77c4335f8c.png

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...