From 02c868512fa740447778d54e7a3804cbaa98cda9 Mon Sep 17 00:00:00 2001 From: hackrush Date: Sat, 1 Jul 2017 23:57:25 +0530 Subject: [PATCH] Daemon provides steps on how to change the port. Daemon now points to a faq on how to change the port if it can't connect to 3333(default) and adds support for the required api/cli call. Fixex #710 --- CHANGELOG.md | 1 + docs/cli.md | 1 + docs/index.md | 1 + lbrynet/daemon/Daemon.py | 7 ++++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 281f8acc7..5d54c1953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ at anytime. * Fix default directories to comply to XDG * Fixed BlobManager causing functional tests to fail, removed its unneeded manage() loop * Increased max_key_fee + * Gives message and instructions if port 3333 is used ### Deprecated * diff --git a/docs/cli.md b/docs/cli.md index 3253edfe3..3c89d1d57 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -752,6 +752,7 @@ Args: 'data_rate': (float) data rate, 'max_key_fee': (float) maximum key fee, 'download_directory': (str) path of where files are downloaded, + 'peer_port': (int) port through which daemon should connect, 'max_upload': (float), currently not supported 'max_download': (float), currently not supported 'download_timeout': (int) download timeout in seconds diff --git a/docs/index.md b/docs/index.md index d344a0f8e..4a7fff3c6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -604,6 +604,7 @@ Args: 'data_rate': (float) data rate, 'max_key_fee': (float) maximum key fee, 'download_directory': (str) path of where files are downloaded, + 'peer_port': (int) port through which daemon should connect, 'max_upload': (float), currently not supported 'max_download': (float), currently not supported 'download_timeout': (int) download timeout in seconds diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index a4f8115d2..80aa5bf95 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -309,10 +309,12 @@ class Daemon(AuthJSONRPCServer): self.session.peer_manager) try: + log.info("Daemon bound to port: %d", self.peer_port) self.lbry_server_port = reactor.listenTCP(self.peer_port, server_factory) except error.CannotListenError as e: import traceback - log.error("Couldn't bind to port %d. %s", self.peer_port, traceback.format_exc()) + log.error("Couldn't bind to port %d. Visit lbry.io/faq/how-to-change-port for more details.", self.peer_port) + log.error("%s", traceback.format_exc()) raise ValueError("%s lbrynet may already be running on your computer.", str(e)) return defer.succeed(True) @@ -418,6 +420,7 @@ class Daemon(AuthJSONRPCServer): 'download_directory': str, 'data_rate': float, 'download_timeout': int, + 'peer_port': int, 'max_key_fee': dict, 'use_upnp': bool, 'run_reflector_server': bool, @@ -1122,6 +1125,7 @@ class Daemon(AuthJSONRPCServer): settings_set [ | --download_directory=] [ | --data_rate=] [ | --download_timeout=] + [ | --peer_port=] [ | --max_key_fee=] [ | --use_upnp=] [ | --run_reflector_server=] @@ -1135,6 +1139,7 @@ class Daemon(AuthJSONRPCServer): , --download_directory= : (str) , --data_rate= : (float), 0.0001 , --download_timeout= : (int), 180 + , --peer_port= : (int), 3333 , --max_key_fee= : (dict) maximum key fee for downloads, in the format: { "currency": ,