From 5afdb31f364df8c5ff74b017951ef5164246fbce Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 8 Aug 2018 22:38:06 +0100 Subject: [PATCH 1/5] daemon 0.21 updates --- app/src/page/settings/view.js | 5 ++++- app/src/page/splash/view.js | 33 +++++++++++++++++------------- app/src/redux/reducers/settings.js | 15 +------------- buildozer.spec.sample | 2 +- buildozer.spec.travis | 2 +- buildozer.spec.vagrant | 2 +- recipes/netifaces/__init__.py | 25 ++++++++++++++++++++++ recipes/sqlite3/Android.mk | 11 ++++++++++ recipes/sqlite3/__init__.py | 32 +++++++++++++++++++++++++++++ src/main/python/lbrynetservice.py | 33 +++++++++--------------------- 10 files changed, 105 insertions(+), 55 deletions(-) create mode 100644 recipes/netifaces/__init__.py create mode 100644 recipes/sqlite3/Android.mk create mode 100644 recipes/sqlite3/__init__.py diff --git a/app/src/page/settings/view.js b/app/src/page/settings/view.js index 86a3e34e..101e0738 100644 --- a/app/src/page/settings/view.js +++ b/app/src/page/settings/view.js @@ -17,6 +17,9 @@ class SettingsPage extends React.PureComponent { setClientSetting } = this.props; + // default to true if the setting is null or undefined + const actualKeepDaemonRunning = (keepDaemonRunning === null || keepDaemonRunning === undefined) ? true : keepDaemonRunning; + return ( Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date. - { + { setClientSetting(SETTINGS.KEEP_DAEMON_RUNNING, value); if (NativeModules.DaemonServiceControl) { NativeModules.DaemonServiceControl.setKeepDaemonRunning(value); diff --git a/app/src/page/splash/view.js b/app/src/page/splash/view.js index bbefcf41..d8af7049 100644 --- a/app/src/page/splash/view.js +++ b/app/src/page/splash/view.js @@ -49,13 +49,19 @@ class SplashScreen extends React.PureComponent { updateStatus() { Lbry.status().then(status => { + console.log(status); this._updateStatusCallback(status); }); } _updateStatusCallback(status) { const startupStatus = status.startup_status; - if (startupStatus.code == 'started') { + // At the minimum, database, stream_identifier and wallet should be started before calling resolve + const hasStarted = startupStatus.database && + startupStatus.wallet && + startupStatus.stream_identifier && + status.wallet.blocks_behind == 0; + if (hasStarted) { // Wait until we are able to resolve a name before declaring // that we are done. // TODO: This is a hack, and the logic should live in the daemon @@ -88,37 +94,36 @@ class SplashScreen extends React.PureComponent { return; } - const blockchainStatus = status.blockchain_status; - if (blockchainStatus) { + const blockchainHeaders = status.blockchain_headers; + const walletStatus = status.wallet; + + if (blockchainHeaders) { this.setState({ - isDownloadingHeaders: blockchainStatus.is_downloading_headers, - headersDownloadProgress: blockchainStatus.headers_download_progress + isDownloadingHeaders: blockchainHeaders.downloading_headers, + headersDownloadProgress: blockchainHeaders.download_progress }); } - if (blockchainStatus && (blockchainStatus.is_downloading_headers || - (this.state.didDownloadHeaders && 'loading_wallet' === startupStatus.code))) { + if (blockchainHeaders && blockchainHeaders.downloading_headers && blockchainHeaders.download_progress < 100) { if (!this.state.didDownloadHeaders) { this.setState({ didDownloadHeaders: true }); } + const downloadProgress = blockchainHeaders.download_progress ? blockchainHeaders.download_progress : 0; this.setState({ message: 'Blockchain Sync', - details: `Catching up with the blockchain (${blockchainStatus.headers_download_progress}%)`, - isLagging: startupStatus.is_lagging + details: `Catching up with the blockchain (${downloadProgress}%)`, }); - } else if (blockchainStatus && blockchainStatus.blocks_behind > 0) { - const behind = blockchainStatus.blocks_behind; + } else if (walletStatus && walletStatus.blocks_behind > 0) { + const behind = walletStatus.blocks_behind; const behindText = behind + ' block' + (behind == 1 ? '' : 's') + ' behind'; this.setState({ message: 'Blockchain Sync', details: behindText, - isLagging: startupStatus.is_lagging, }); } else { this.setState({ message: 'Network Loading', - details: startupStatus.message + (startupStatus.is_lagging ? '' : '...'), - isLagging: startupStatus.is_lagging, + details: 'Initializing LBRY service...' }); } setTimeout(() => { diff --git a/app/src/redux/reducers/settings.js b/app/src/redux/reducers/settings.js index 8d3db6a7..b4bd1b97 100644 --- a/app/src/redux/reducers/settings.js +++ b/app/src/redux/reducers/settings.js @@ -1,22 +1,10 @@ import { AsyncStorage } from 'react-native'; import { ACTIONS, SETTINGS } from 'lbry-redux'; -getAsyncStorageItem = key => { - return AsyncStorage.getItem(key).then(value => { - if (['true', 'false'].indexOf(value) > -1) { - return value === 'true'; - } - return value; - }); -}; const reducers = {}; const defaultState = { - clientSettings: { - backgroundPlayEnabled: getAsyncStorageItem(SETTINGS.BACKGROUND_PLAY_ENABLED), - keepDaemonRunning: getAsyncStorageItem(SETTINGS.KEEP_DAEMON_RUNNING), - showNsfw: getAsyncStorageItem(SETTINGS.SHOW_NSFW) - } + clientSettings: {} }; reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => { @@ -24,7 +12,6 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => { const clientSettings = Object.assign({}, state.clientSettings); clientSettings[key] = value; - AsyncStorage.setItem(key, String(value)); return Object.assign({}, state, { clientSettings, diff --git a/buildozer.spec.sample b/buildozer.spec.sample index 91603859..dc8de34c 100644 --- a/buildozer.spec.sample +++ b/buildozer.spec.sample @@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.20.4#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite +requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.travis b/buildozer.spec.travis index 91603859..dc8de34c 100644 --- a/buildozer.spec.travis +++ b/buildozer.spec.travis @@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.20.4#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite +requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/buildozer.spec.vagrant b/buildozer.spec.vagrant index 7d78a459..01a7d25b 100644 --- a/buildozer.spec.vagrant +++ b/buildozer.spec.vagrant @@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py # (list) Application requirements # comma seperated e.g. requirements = sqlite3,kivy -requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git@v0.20.4#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite +requirements = openssl, sqlite3, hostpython2, android, distro, pyjnius, certifi==2018.4.16, constantly, incremental, functools32, miniupnpc==1.9, gmpy==1.17, twisted==16.6.0, appdirs==1.4.3, argparse==1.2.1, docopt==0.6.2, base58==0.2.2, colorama==0.3.7, dnspython==1.12.0, ecdsa==0.13, envparse==0.2.0, jsonrpc==1.2, jsonrpclib==0.1.7, jsonschema==2.5.1, pbkdf2==1.3, pyyaml==3.12, qrcode==5.2.2, requests==2.9.1, seccure==0.3.1.3, attrs==18.1.0, pyasn1, pyasn1-modules, service_identity==16.0.0, six==1.9.0, slowaes==0.1a1, txJSON-RPC==0.5, wsgiref==0.1.2, zope.interface==4.3.3, protobuf==3.2.0, keyring==10.4.0, netifaces, txupnp==0.0.1a10, git+https://github.com/lbryio/lbryschema.git@v0.0.16#egg=lbryschema, git+https://github.com/lbryio/lbryum.git#egg=lbryum, git+https://github.com/lbryio/lbry.git#egg=lbrynet, asn1crypto, cryptography==2.2.2, pyopenssl==17.4.0, treq==17.8.0, funcsigs, mock, pbr, unqlite # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes diff --git a/recipes/netifaces/__init__.py b/recipes/netifaces/__init__.py new file mode 100644 index 00000000..0c651887 --- /dev/null +++ b/recipes/netifaces/__init__.py @@ -0,0 +1,25 @@ + +import glob +from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, Recipe +from os.path import join +import sh + + +class NetifacesRecipe(CompiledComponentsPythonRecipe): + version = '0.10.7' + url = 'https://files.pythonhosted.org/packages/81/39/4e9a026265ba944ddf1fea176dbb29e0fe50c43717ba4fcf3646d099fe38/netifaces-{version}.tar.gz' + depends = ['python2', 'setuptools'] + call_hostpython_via_targetpython = False + + def get_recipe_env(self, arch): + env = super(NetifacesRecipe, self).get_recipe_env(arch) + + target_python = Recipe.get_recipe('python2', self.ctx).get_build_dir(arch.arch) + env['PYTHON_ROOT'] = join(target_python, 'python-install') + env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' + env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython2.7' + + return env + +recipe = NetifacesRecipe() diff --git a/recipes/sqlite3/Android.mk b/recipes/sqlite3/Android.mk new file mode 100644 index 00000000..fab4b67e --- /dev/null +++ b/recipes/sqlite3/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir)/.. + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := sqlite3.c + +LOCAL_MODULE := sqlite3 + +LOCAL_CFLAGS := -DSQLITE_ENABLE_FTS4 + +include $(BUILD_SHARED_LIBRARY) diff --git a/recipes/sqlite3/__init__.py b/recipes/sqlite3/__init__.py new file mode 100644 index 00000000..2be8215f --- /dev/null +++ b/recipes/sqlite3/__init__.py @@ -0,0 +1,32 @@ +from pythonforandroid.toolchain import NDKRecipe, shprint, shutil, current_directory +from os.path import join, exists +import sh + +class Sqlite3Recipe(NDKRecipe): + version = '3.24.0' + # Don't forget to change the URL when changing the version + url = 'https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip' + generated_libraries = ['sqlite3'] + + def should_build(self, arch): + return not self.has_libs(arch, 'libsqlite3.so') + + def prebuild_arch(self, arch): + super(Sqlite3Recipe, self).prebuild_arch(arch) + # Copy the Android make file + sh.mkdir('-p', join(self.get_build_dir(arch.arch), 'jni')) + shutil.copyfile(join(self.get_recipe_dir(), 'Android.mk'), + join(self.get_build_dir(arch.arch), 'jni/Android.mk')) + + def build_arch(self, arch, *extra_args): + super(Sqlite3Recipe, self).build_arch(arch) + # Copy the shared library + shutil.copyfile(join(self.get_build_dir(arch.arch), 'libs', arch.arch, 'libsqlite3.so'), + join(self.ctx.get_libs_dir(arch.arch), 'libsqlite3.so')) + + def get_recipe_env(self, arch): + env = super(Sqlite3Recipe, self).get_recipe_env(arch) + env['NDK_PROJECT_PATH'] = self.get_build_dir(arch.arch) + return env + +recipe = Sqlite3Recipe() diff --git a/src/main/python/lbrynetservice.py b/src/main/python/lbrynetservice.py index 2574786e..e61a3cad 100644 --- a/src/main/python/lbrynetservice.py +++ b/src/main/python/lbrynetservice.py @@ -81,8 +81,7 @@ from jsonrpc.proxy import JSONRPCProxy from lbrynet import analytics from lbrynet import conf from lbrynet.core import utils, system_info -from lbrynet.daemon.auth.client import LBRYAPIClient -from lbrynet.daemon.DaemonServer import DaemonServer +from lbrynet.daemon.Daemon import Daemon # https certificate verification # TODO: this is bad. Need to find a way to properly verify https requests @@ -124,34 +123,22 @@ def start(): lbrynet_log = conf.settings.get_log_filename() log_support.configure_logging(lbrynet_log, True, []) - log.debug('Final Settings: %s', conf.settings.get_current_settings_dict()) + + # TODO: specify components, initialise auth + conf.settings.update({ + 'components_to_skip': ['peer_protocol_server'] + }) + + log.info('Final Settings: %s', conf.settings.get_current_settings_dict()) log.info("Starting lbrynet-daemon") if test_internet_connection(): - analytics_manager = analytics.Manager.new_instance() - start_server_and_listen(False, analytics_manager) + daemon = Daemon() + daemon.start_listening() reactor.run() else: log.info("Not connected to internet, unable to start") -@defer.inlineCallbacks -def start_server_and_listen(use_auth, analytics_manager, max_tries=5): - """The primary entry point for launching the daemon. - Args: - use_auth: set to true to enable http authentication - analytics_manager: to send analytics - """ - analytics_manager.send_server_startup() - daemon_server = DaemonServer(analytics_manager) - try: - yield daemon_server.start(use_auth) - analytics_manager.send_server_startup_success() - except Exception as e: - log.exception('Failed to startup') - yield daemon_server.stop() - analytics_manager.send_server_startup_error(str(e)) - reactor.fireSystemEvent("shutdown") - if __name__ == '__main__': start() -- 2.45.2 From 5cb965639f73d4ec66e2c0c4fe1bca5cac8d0a4b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 9 Aug 2018 22:42:27 +0100 Subject: [PATCH 2/5] additional daemon 0.21 modifications and some settings tweaks --- app/src/index.js | 6 +++--- app/src/page/splash/view.js | 8 ++------ app/src/redux/reducers/settings.js | 3 ++- src/main/python/lbrynetservice.py | 3 ++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/index.js b/app/src/index.js index 8e3f74ef..9b154c43 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -10,9 +10,8 @@ import { NativeModules } from 'react-native'; import { createStore, applyMiddleware, compose, combineReducers } from 'redux'; -import { - StackNavigator, addNavigationHelpers -} from 'react-navigation'; +import { createLogger } from 'redux-logger'; +import { StackNavigator, addNavigationHelpers } from 'react-navigation'; import { AppNavigator } from './component/AppNavigator'; import AppWithNavigationState from './component/AppNavigator'; import { persistStore, autoRehydrate } from 'redux-persist'; @@ -80,6 +79,7 @@ const reducers = combineReducers({ }); const bulkThunk = createBulkThunkMiddleware(); +const logger = createLogger({ collapsed: true }); const middleware = [thunk, bulkThunk, reactNavigationMiddleware]; // eslint-disable-next-line no-underscore-dangle diff --git a/app/src/page/splash/view.js b/app/src/page/splash/view.js index d8af7049..68c7c97e 100644 --- a/app/src/page/splash/view.js +++ b/app/src/page/splash/view.js @@ -49,18 +49,14 @@ class SplashScreen extends React.PureComponent { updateStatus() { Lbry.status().then(status => { - console.log(status); this._updateStatusCallback(status); }); } _updateStatusCallback(status) { const startupStatus = status.startup_status; - // At the minimum, database, stream_identifier and wallet should be started before calling resolve - const hasStarted = startupStatus.database && - startupStatus.wallet && - startupStatus.stream_identifier && - status.wallet.blocks_behind == 0; + // At the minimum, wallet should be started and blocks_behind equal to 0 before calling resolve + const hasStarted = startupStatus.wallet && status.wallet.blocks_behind <= 0; if (hasStarted) { // Wait until we are able to resolve a name before declaring // that we are done. diff --git a/app/src/redux/reducers/settings.js b/app/src/redux/reducers/settings.js index b4bd1b97..bab57f18 100644 --- a/app/src/redux/reducers/settings.js +++ b/app/src/redux/reducers/settings.js @@ -1,5 +1,5 @@ import { AsyncStorage } from 'react-native'; -import { ACTIONS, SETTINGS } from 'lbry-redux'; +import { ACTIONS } from 'lbry-redux'; const reducers = {}; @@ -18,6 +18,7 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => { }); }; + export default function reducer(state = defaultState, action) { const handler = reducers[action.type]; if (handler) return handler(state, action); diff --git a/src/main/python/lbrynetservice.py b/src/main/python/lbrynetservice.py index e61a3cad..376faa1e 100644 --- a/src/main/python/lbrynetservice.py +++ b/src/main/python/lbrynetservice.py @@ -126,7 +126,8 @@ def start(): # TODO: specify components, initialise auth conf.settings.update({ - 'components_to_skip': ['peer_protocol_server'] + 'components_to_skip': ['peer_protocol_server', 'reflector'], + 'concurrent_announcers': 0 }) log.info('Final Settings: %s', conf.settings.get_current_settings_dict()) -- 2.45.2 From 2a3fe9e35429140272046e829ad718adf719cceb Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 9 Aug 2018 22:58:20 +0100 Subject: [PATCH 3/5] phrasing --- src/main/python/lbrynetservice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/lbrynetservice.py b/src/main/python/lbrynetservice.py index 376faa1e..ccad0f38 100644 --- a/src/main/python/lbrynetservice.py +++ b/src/main/python/lbrynetservice.py @@ -138,7 +138,7 @@ def start(): daemon.start_listening() reactor.run() else: - log.info("Not connected to internet, unable to start") + log.info("Not connected to the Internet. Unable to start.") if __name__ == '__main__': -- 2.45.2 From 440ef4b1ad7f3665d9f6871e7adbb55527b6f01f Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 9 Aug 2018 23:03:39 +0100 Subject: [PATCH 4/5] use daemon component name constants --- src/main/python/lbrynetservice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/python/lbrynetservice.py b/src/main/python/lbrynetservice.py index ccad0f38..d156f440 100644 --- a/src/main/python/lbrynetservice.py +++ b/src/main/python/lbrynetservice.py @@ -81,6 +81,7 @@ from jsonrpc.proxy import JSONRPCProxy from lbrynet import analytics from lbrynet import conf from lbrynet.core import utils, system_info +from lbrynet.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, REFLECTOR_COMPONENT from lbrynet.daemon.Daemon import Daemon # https certificate verification @@ -126,7 +127,7 @@ def start(): # TODO: specify components, initialise auth conf.settings.update({ - 'components_to_skip': ['peer_protocol_server', 'reflector'], + 'components_to_skip': [PEER_PROTOCOL_SERVER_COMPONENT, REFLECTOR_COMPONENT], 'concurrent_announcers': 0 }) -- 2.45.2 From 43a68fe8469a35702ac613d23988706f41dee5ff Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 13 Aug 2018 06:40:05 +0100 Subject: [PATCH 5/5] remove didDownloadHeaders from component state as it's no longer needed --- app/src/page/splash/view.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/page/splash/view.js b/app/src/page/splash/view.js index 68c7c97e..3996a152 100644 --- a/app/src/page/splash/view.js +++ b/app/src/page/splash/view.js @@ -26,7 +26,6 @@ class SplashScreen extends React.PureComponent { isRunning: false, isLagging: false, launchUrl: null, - didDownloadHeaders: false, isDownloadingHeaders: false, headersDownloadProgress: 0 }); @@ -100,10 +99,7 @@ class SplashScreen extends React.PureComponent { }); } - if (blockchainHeaders && blockchainHeaders.downloading_headers && blockchainHeaders.download_progress < 100) { - if (!this.state.didDownloadHeaders) { - this.setState({ didDownloadHeaders: true }); - } + if (blockchainHeaders && blockchainHeaders.downloading_headers) { const downloadProgress = blockchainHeaders.download_progress ? blockchainHeaders.download_progress : 0; this.setState({ message: 'Blockchain Sync', -- 2.45.2