peer discovery – Why does not Lightning have DNS bootstrapping?

0
57


It does!
There’s even a BOLT for it (take a look at: https://github.com/lightningnetwork/lightning-rfc/blob/grasp/10-dns-bootstrap.md )

from there you may have the next instance:

dig lseed.bitcoinstats.com AAAA
lseed.bitcoinstats.com. 60      IN      AAAA    2a02:aa16:1105:4a80:1234:1234:37c1:9c9

Christian Decker is sustaining the dns seed checklist. I even used this in my autopilot (the c-lightning wrapper). take a look at:

  def __get_seed_keys(self):
        """
        retrieve the nodeids of the ln seed nodes from lseed.bitcoinstats.com
        """
        area = "lseed.bitcoinstats.com"
        srv_records = dns.resolver.question(area,"SRV")
        res = []
        for srv in srv_records:
            bech32 = str(srv.goal).rstrip(".").cut up(".")[0]
            information = bech32_decode(bech32)[1]
            decoded = convertbits(information, 5, 4)
            res.append("".be a part of(
                ['{:1x}'.format(integer) for integer in decoded])[:-1])
        return res


    def __connect_to_seeds(self):
        """
        units up peering connection to seed nodes of the lightning community

        That is obligatory in case the node working the autopilot has by no means
        been linked to the lightning community.
        """
        strive:
            for nodeid in random.shuffle(self.__get_seed_keys()):
                self.__clogger.data("peering with node: " + nodeid)
                self.__rpc_interface.join(nodeid)
                # FIXME: higher technique than sleep(2) for build up
                time.sleep(2)
        besides:
            go

LEAVE A REPLY

Please enter your comment!
Please enter your name here