package main import ( ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) // bootstrapRecords turns a node's addresses into the DNS TXT values that make // it a bootstrap node, one per publicly routable address. Loopback and private // addresses are left out: nobody else could use them. func bootstrapRecords(addrs []string) []string { var out []string for _, a := range addrs { m, err := ma.NewMultiaddr(a) if err != nil || !manet.IsPublicAddr(m) { continue } out = append(out, "dnsaddr="+a) } return out }