diff --git a/README.rst b/README.rst index 7429a54..4bfe093 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ ElectrumX - Reimplementation of electrum-server =============================================== :Licence: MIT - :Language: Python (>= 3.5.1) + :Language: Python (>= 3.5.3) :Author: Neil Booth Getting Started diff --git a/docs/ENVIRONMENT.rst b/docs/ENVIRONMENT.rst index 41edcbb..6c35b80 100644 --- a/docs/ENVIRONMENT.rst +++ b/docs/ENVIRONMENT.rst @@ -252,9 +252,7 @@ some of this. * **TOR_PROXY_HOST** - The host where your Tor proxy is running. Defaults to *127.0.0.1*. - If you use a hostname here rather than an IP address, you must have - Python version >= 3.5.3, Python 3.5.2 will **not** work. + The host where your Tor proxy is running. Defaults to *localhost*. If you are not running a Tor proxy just leave this environment variable undefined. diff --git a/docs/HOWTO.rst b/docs/HOWTO.rst index 8cbdbbc..7404920 100644 --- a/docs/HOWTO.rst +++ b/docs/HOWTO.rst @@ -10,7 +10,8 @@ small - pull requests are welcome. ================ ======================== Package Notes ================ ======================== -Python3 ElectrumX uses asyncio. Python version >= 3.5 is **required**. +Python3 ElectrumX uses asyncio. Python version >= 3.5.3 is + **required**. `aiohttp`_ Python library for asynchronous HTTP. Version >= 1.0 required; I am using 1.0.5. `pylru`_ Python LRU cache package. I'm using 1.0.9. diff --git a/electrumx_server.py b/electrumx_server.py index dd57f2a..695924d 100755 --- a/electrumx_server.py +++ b/electrumx_server.py @@ -13,6 +13,7 @@ import asyncio import logging import os import signal +import sys import traceback from functools import partial @@ -28,9 +29,12 @@ SUPPRESS_MESSAGES = [ def main_loop(): '''Start the server.''' + if sys.version_info < (3, 5, 3): + raise RuntimeError('Python >= 3.5.3 is required to run ElectrumX') + if os.geteuid() == 0: - raise Exception('DO NOT RUN AS ROOT! Create an unpriveleged user ' - 'account and use that') + raise RuntimeError('DO NOT RUN AS ROOT! Create an unpriveleged user ' + 'account and use that') loop = asyncio.get_event_loop() # loop.set_debug(True) diff --git a/server/controller.py b/server/controller.py index e04d13f..c0cbf6b 100644 --- a/server/controller.py +++ b/server/controller.py @@ -289,8 +289,7 @@ class Controller(util.LoggedClass): if env.tcp_port is not None: await self.start_server('TCP', env.host, env.tcp_port) if env.ssl_port is not None: - # Python 3.5.3: use PROTOCOL_TLS - sslc = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + sslc = ssl.SSLContext(ssl.PROTOCOL_TLS) sslc.load_cert_chain(env.ssl_certfile, keyfile=env.ssl_keyfile) await self.start_server('SSL', env.host, env.ssl_port, ssl=sslc) diff --git a/server/env.py b/server/env.py index 774277c..6b1831d 100644 --- a/server/env.py +++ b/server/env.py @@ -51,8 +51,7 @@ class Env(LoggedClass): # Peer discovery self.peer_discovery = bool(self.default('PEER_DISCOVERY', True)) self.peer_announce = bool(self.default('PEER_ANNOUNCE', True)) - # Python 3.5.3 - revert back to localhost? - self.tor_proxy_host = self.default('TOR_PROXY_HOST', '127.0.0.1') + self.tor_proxy_host = self.default('TOR_PROXY_HOST', 'localhost') self.tor_proxy_port = self.integer('TOR_PROXY_PORT', None) # The electrum client takes the empty string as unspecified self.donation_address = self.default('DONATION_ADDRESS', '') diff --git a/server/peers.py b/server/peers.py index 03c955e..8eb8501 100644 --- a/server/peers.py +++ b/server/peers.py @@ -475,8 +475,7 @@ class PeerManager(util.LoggedClass): def retry_peer(self, peer, port_pairs): peer.last_try = time.time() kind, port = port_pairs[0] - # Python 3.5.3: use PROTOCOL_TLS - sslc = ssl.SSLContext(ssl.PROTOCOL_SSLv23) if kind == 'SSL' else None + sslc = ssl.SSLContext(ssl.PROTOCOL_TLS) if kind == 'SSL' else None if peer.is_tor: create_connection = self.tor_proxy.create_connection diff --git a/setup.py b/setup.py index b152c25..b5376cc 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name='electrumx', version=VERSION.split()[-1], scripts=['electrumx_server.py', 'electrumx_rpc.py'], - python_requires='>=3.5', + python_requires='>=3.5.3', # "irc" package is only required if IRC connectivity is enabled # via environment variables, in which case I've tested with 15.0.4 # "x11_hash" package (1.4) is required to sync DASH network.