Skip to content

Instantly share code, notes, and snippets.

@coderfi
Created November 16, 2018 00:09
Show Gist options
  • Save coderfi/32e92c36e8c9b7ac7503f07c70a9b77f to your computer and use it in GitHub Desktop.
Save coderfi/32e92c36e8c9b7ac7503f07c70a9b77f to your computer and use it in GitHub Desktop.
A little script to parse the ethereum foundation seed ip addresses directly from the git source code.
#!/usr/bin/env python3
import json
from datetime import datetime
from urllib.request import urlopen
# todo: https://github.com/ethereum/go-ethereum/blob/release/1.8/params/bootnodes.go
url = 'https://github.com/paritytech/parity-ethereum/blob/v1.11.11/ethcore/res/ethereum/foundation.json?raw=true'
with urlopen(url) as rs:
print(" # updated %s %s %s" % (datetime.now().strftime("%c"), url, __file__))
j = json.loads(rs.read().decode('ascii'))
for s in j['nodes']:
# enode://fdd1b9bb613cfbc200bba17ce199a9490edc752a833f88d4134bf52bb0d858aa5524cb3ec9366c7a4ef4637754b8b15b5dc913e4ed9fdb6022f7512d7b63f181@212.47.247.103:30303
hp = s.split('@')[-1]
host, port = hp.split(':')
if port != '30303':
continue
print(" - " + host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment