KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
103 stars 94 forks source link

Add seed nodes domains #750

Open tonymorony opened 3 years ago

tonymorony commented 3 years ago

Creating issue to not forget :)

domains are:

seed1.kmd.io seed2.kmd.io seed3.kmd.io

artemii235 commented 3 years ago

It might be better to use similar approach that is used for Bitcoin: https://developer.bitcoin.org/devguide/p2p_network.html#peer-discovery, example:

dig seed.bitcoin.sipa.be

; <<>> DiG 9.16.8 <<>> seed.bitcoin.sipa.be
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18266
;; flags: qr rd ra; QUERY: 1, ANSWER: 25, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;seed.bitcoin.sipa.be.      IN  A

;; ANSWER SECTION:
seed.bitcoin.sipa.be.   3600    IN  A   176.31.236.182
seed.bitcoin.sipa.be.   3600    IN  A   185.80.219.132
...
seed.bitcoin.sipa.be.   3600    IN  A   159.100.250.198

;; Query time: 3 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Вт ноя 24 14:09:49 +07 2020
;; MSG SIZE  rcvd: 438

E.g. we will have the DNS 7777.seed.kmd.io that will return multiple A records of available seed nodes IPs for 7777 netid, it seems to be more clear than using simply seed1...seed3.kmd.io.

ca333 commented 3 years ago

It might be better to use similar approach that is used for Bitcoin: https://developer.bitcoin.org/devguide/p2p_network.html#peer-discovery, example:

dig seed.bitcoin.sipa.be

; <<>> DiG 9.16.8 <<>> seed.bitcoin.sipa.be
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18266
;; flags: qr rd ra; QUERY: 1, ANSWER: 25, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;seed.bitcoin.sipa.be.        IN  A

;; ANSWER SECTION:
seed.bitcoin.sipa.be. 3600    IN  A   176.31.236.182
seed.bitcoin.sipa.be. 3600    IN  A   185.80.219.132
...
seed.bitcoin.sipa.be. 3600    IN  A   159.100.250.198

;; Query time: 3 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Вт ноя 24 14:09:49 +07 2020
;; MSG SIZE  rcvd: 438

E.g. we will have the DNS 7777.seed.kmd.io that will return multiple A records of available seed nodes IPs for 7777 netid, it seems to be more clear than using simply seed1...seed3.kmd.io.

yes, we can and certainly will use a atomicdex DNS seeder - however, we do not have such required implementation yet. Such a seeder implementation crawls the ADEX network and basically revisit seed nodes it has in the registry to ensure they still alive/up and also explore new ones to add to the list.

BTC for example uses the one provided by sipa: https://github.com/sipa/bitcoin-seeder

We can maybe add a DNS_seed mode to ADEX and use ADEX API as such a seeder since it already contains all essential logic such as seed reg, p2p node exploration, et cetera.

cipig commented 3 years ago

are the IPs exchanged between the existing seed nodes? if so, we only need couple of working IPs in xxxx.seed.kmd.io to start with, all the others will then be exchanged

artemii235 commented 3 years ago

are the IPs exchanged between the existing seed nodes? if so, we only need couple of working IPs in xxxx.seed.kmd.io to start with, all the others will then be exchanged

Yes, the IPs are exchanged, but in current setup we have only 3 seed/bootstrap nodes which DNS have to be managed manually. The automated DNS seed seems to be not hard to implement and this approach will help to save our time on DNS management and speed up initial bootstrap because there will be more MM2 nodes addresses known immediately.