diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 2a12af014..66e273929 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -160,7 +160,6 @@ class AdjustableSettings(Setting): self.check_ui_requirements = True self.local_ui_path = False self.api_port = 5279 - self.search_servers = ['lighthouse1.lbry.io:50005'] self.data_rate = .0001 # points/megabyte self.min_info_rate = .02 # points/1000 infos self.min_valuable_info_rate = .05 # points/1000 infos diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index abcfdfb87..d03b593e4 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -207,7 +207,7 @@ class Daemon(AuthJSONRPCServer): 'is_running', 'is_first_run', 'get_time_behind_blockchain', 'stop', 'daemon_status', 'get_start_notice', - 'version', 'get_search_servers' + 'version' ] last_version = {'last_version': {'lbrynet': lbrynet_version, 'lbryum': lbryum_version}} conf.settings.update(last_version) @@ -276,7 +276,6 @@ class Daemon(AuthJSONRPCServer): self.name_cache = {} self.set_wallet_attributes() self.exchange_rate_manager = ExchangeRateManager() - self.lighthouse_client = LighthouseClient() calls = { Checker.INTERNET_CONNECTION: LoopingCall(CheckInternetConnection(self)), Checker.VERSION: LoopingCall(CheckRemoteVersions(self)), @@ -1065,9 +1064,6 @@ class Daemon(AuthJSONRPCServer): return defer.succeed(None) - def _search(self, search): - return self.lighthouse_client.search(search) - def jsonrpc_is_running(self): """ Check if lbrynet daemon is running @@ -1567,42 +1563,6 @@ class Daemon(AuthJSONRPCServer): d.addCallback(lambda r: self._render_response(r, OK_CODE)) return d - def jsonrpc_search_nametrie(self, p): - """ - Search the nametrie for claims - - Args: - 'search': search query, string - Returns: - List of search results - """ - - # TODO: change this function to "search" - - if 'search' in p.keys(): - search = p['search'] - else: - return self._render_response(None, BAD_REQUEST) - - # TODO: have ui accept the actual outputs - def _clean(n): - t = [] - for i in n: - td = {k: i['value'][k] for k in i['value']} - td['cost_est'] = float(i['cost']) - td['thumbnail'] = i['value'].get('thumbnail', "img/Free-speech-flag.svg") - td['name'] = i['name'] - t.append(td) - return t - - log.info('Search: %s' % search) - - d = self._search(search) - d.addCallback(_clean) - d.addCallback(lambda results: self._render_response(results, OK_CODE)) - - return d - @AuthJSONRPCServer.auth_required def jsonrpc_delete_lbry_file(self, p): """ @@ -2248,18 +2208,6 @@ class Daemon(AuthJSONRPCServer): d.addCallback(lambda r: self._render_response(r, OK_CODE)) return d - def jsonrpc_get_search_servers(self): - """ - Get list of lighthouse servers - Args: - None - Returns: - List of address:port - """ - - d = self._render_response(lbrynet_settings.search_servers, OK_CODE) - return d - def jsonrpc_get_mean_availability(self): """ Get mean blob availability diff --git a/lbrynet/lbrynet_daemon/Lighthouse.py b/lbrynet/lbrynet_daemon/Lighthouse.py deleted file mode 100644 index fb574e55c..000000000 --- a/lbrynet/lbrynet_daemon/Lighthouse.py +++ /dev/null @@ -1,27 +0,0 @@ -import logging -import random -from txjsonrpc.web.jsonrpc import Proxy -from lbrynet.conf import settings - -log = logging.getLogger(__name__) - - -class LighthouseClient(object): - def __init__(self, servers=None): - self.servers = servers or settings.search_servers - - def _get_random_server(self): - return Proxy(random.choice(self.servers)) - - def _run_query(self, func, arg): - return self._get_random_server().callRemote(func, arg) - - def search(self, search): - return self._run_query('search', search) - - def announce_sd(self, sd_hash): - log.info("Announce sd to lighthouse") - return self._run_query('announce_sd', sd_hash) - - def check_available(self, sd_hash): - return self._run_query('check_available', sd_hash)