diff --git a/setup.py b/setup.py index f43f3d58..a62c4bcf 100644 --- a/setup.py +++ b/setup.py @@ -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')} diff --git a/src/network/bootstrap_servers.list b/src/network/bootstrap_servers.list new file mode 100644 index 00000000..59b31cb7 --- /dev/null +++ b/src/network/bootstrap_servers.list @@ -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