Skip to content

Commit

Permalink
Merge pull request #237 from cruelnovo/23.x-seeds
Browse files Browse the repository at this point in the history
23.x-rebase: Seed files for Vertcoin Core
  • Loading branch information
vertiond authored Sep 10, 2023
2 parents b2bb0bc + a3451e7 commit f8c2119
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 762 deletions.
26 changes: 10 additions & 16 deletions contrib/seeds/makeseeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

MAX_SEEDS_PER_ASN=2

MIN_BLOCKS = 337600
MIN_BLOCKS = 1680000

# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
Expand All @@ -25,19 +25,13 @@

PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$")
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
PATTERN_ONION = re.compile(r"^([a-z2-7]{56}\.onion):(\d+)$")
PATTERN_ONION = re.compile(r"^([a-z2-7]{16}\.onion):(\d+)$")
PATTERN_AGENT = re.compile(
r"^/Satoshi:("
r"0.14.(0|1|2|3|99)|"
r"0.15.(0|1|2|99)|"
r"0.16.(0|1|2|3|99)|"
r"0.17.(0|0.1|1|2|99)|"
r"0.18.(0|1|99)|"
r"0.19.(0|1|2|99)|"
r"0.20.(0|1|2|99)|"
r"0.21.(0|1|2|99)|"
r"22.(0|99)|"
r"23.99"
r"0.17.(0|1|2|3|99)|"
r"0.18.(0|1|2|99)|"
r"22.(0|1|2|3|99)|"
r"23.(0|1|2|3|99)|"
r")")

def parseline(line):
Expand Down Expand Up @@ -138,7 +132,7 @@ def lookup_asn(net, ip):
ipaddr = res.rstrip('.') # 2.0.0.1.4.8.6.0.b.0.0.2.0.0.2.3
prefix = '.origin6'

asn = int([x.to_text() for x in dns.resolver.resolve('.'.join(
asn = int([x.to_text() for x in dns.resolver.query('.'.join(
reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com',
'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn
Expand Down Expand Up @@ -199,10 +193,10 @@ def main():
# Require service bit 1.
ips = [ip for ip in ips if (ip['service'] & 1) == 1]
print('%s Require service bit 1' % (ip_stats(ips)), file=sys.stderr)
# Require at least 50% 30-day uptime for clearnet, 10% for onion.
# Require at least 10% 30-day uptime for clearnet, 10% for onion.
req_uptime = {
'ipv4': 50,
'ipv6': 50,
'ipv4': 10,
'ipv6': 10,
'onion': 10,
}
ips = [ip for ip in ips if ip['uptime'] > req_uptime[ip['net']]]
Expand Down
Loading

0 comments on commit f8c2119

Please sign in to comment.