aboutsummaryrefslogtreecommitdiff
path: root/contrib/seeds
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2022-02-22 15:04:46 +0100
committerlaanwj <126646+laanwj@users.noreply.github.com>2022-02-22 15:04:46 +0100
commit9f27157894ee689736d0d0936d1af1620fd8f7d8 (patch)
tree3e62a9f888f03e00b66af930a4665de25fa5e8ef /contrib/seeds
parentc44e734dca64a15fae92255a5d848c04adaad2fa (diff)
downloadbitcoin-9f27157894ee689736d0d0936d1af1620fd8f7d8.tar.xz
contrib: make-seeds updates for 23.x
Documentation: - Use https URL for bitcoin.sipa.be (http sends a redirect, fooling curl). - Add explicit step to add manual seeds. Code: - Change PATTERN_ONION to v3 (effectively means that the no onion hosts are delivered). - Add versions to PATTERN_AGENT filter. - Print specific message on resolve exception.
Diffstat (limited to 'contrib/seeds')
-rw-r--r--contrib/seeds/README.md3
-rwxr-xr-xcontrib/seeds/makeseeds.py14
2 files changed, 10 insertions, 7 deletions
diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md
index 3bca094d3b..c53446bfb0 100644
--- a/contrib/seeds/README.md
+++ b/contrib/seeds/README.md
@@ -10,8 +10,9 @@ to addrman with).
The seeds compiled into the release are created from sipa's DNS seed data, like this:
- curl -s http://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt
+ curl https://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt
python3 makeseeds.py < seeds_main.txt > nodes_main.txt
+ cat nodes_main_manual.txt >> nodes_main.txt
python3 generate-seeds.py . > ../../src/chainparamsseeds.h
## Dependencies
diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py
index 9be6a690a6..2b377f6c01 100755
--- a/contrib/seeds/makeseeds.py
+++ b/contrib/seeds/makeseeds.py
@@ -25,7 +25,7 @@ with open("suspicious_hosts.txt", mode="r", encoding="utf-8") as f:
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"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$")
+PATTERN_ONION = re.compile(r"^([a-z2-7]{56}\.onion):(\d+)$")
PATTERN_AGENT = re.compile(
r"^/Satoshi:("
r"0.14.(0|1|2|3|99)|"
@@ -33,9 +33,11 @@ PATTERN_AGENT = re.compile(
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|99)|"
- r"0.20.(0|1|99)|"
- r"0.21.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")")
def parseline(line):
@@ -140,8 +142,8 @@ def lookup_asn(net, ip):
reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com',
'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn
- except Exception:
- sys.stderr.write('ERR: Could not resolve ASN for "' + ip + '"\n')
+ except Exception as e:
+ sys.stderr.write(f'ERR: Could not resolve ASN for "{ip}": {e}\n')
return None
# Based on Greg Maxwell's seed_filter.py