Add list of bootstrap servers and regenerate it in sdist

This commit is contained in:
Dmitri Bogomolov 2021-03-01 23:10:39 +02:00
parent 96c4b58c5e
commit e845aa8b00
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 25 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import sys
from importlib import import_module
from setuptools import setup, Extension
from setuptools.command.install import install
from setuptools.command.sdist import sdist
from src.version import softwareVersion
@ -48,6 +49,20 @@ class InstallCmd(install):
return install.run(self)
class SdistCmd(sdist):
def run(self):
# generate bootstrap servers list from DNS seeds
try:
from src.helper_startup import enumerate_bootstrap_servers
except ImportError:
pass
else:
with open('src/network/bootstrap_servers.list', 'wb') as dst:
for peer in enumerate_bootstrap_servers():
dst.write('{0}, {1}\n'.format(*peer))
return sdist.run(self)
if __name__ == "__main__":
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
@ -136,6 +151,7 @@ if __name__ == "__main__":
packages=packages,
package_data={'': [
'bitmessageqt/*.ui', 'bitmsghash/*.cl', 'sslkeys/*.pem',
'network/bootstrap_servers.list',
'translations/*.ts', 'translations/*.qm',
'images/*.png', 'images/*.ico', 'images/*.icns'
]},
@ -172,7 +188,9 @@ if __name__ == "__main__":
] if sys.platform[:3] == 'win' else []
},
scripts=['src/pybitmessage'],
cmdclass={'install': InstallCmd},
cmdclass={
'install': InstallCmd,
'sdist': SdistCmd},
command_options={
'build_sphinx': {
'source_dir': ('setup.py', 'docs')}

View File

@ -0,0 +1,6 @@
185.19.31.46, 8080
158.69.63.42, 8080
2607:5300:201:3000::57ae, 8080
185.158.248.216, 8444
85.25.152.9, 8444
85.114.135.102, 8444