systray_thread = threading.Thread(target=LBRYApp) systray_thread.daemon = True systray_thread.start() DaemonControl.start_server_and_listen( launchui=True, use_auth=False, analytics_manager=analytics.Manager.new_instance()) reactor.run() if __name__ == '__main__': utils.setup_certs_for_windows() conf.update_settings_from_file() log_file = settings.get_log_filename() log_support.configure_logging(log_file, console=True) lbry_daemon = JSONRPCProxy.from_url(settings.API_CONNECTION_STRING) try: daemon_running = lbry_daemon.is_running() start_daemon = False except: start_daemon = True try: lbry_name = LBRYURIHandler.parse_name(sys.argv[1]) except IndexError: lbry_name = None start_daemon = True
def start(): parser = argparse.ArgumentParser(description="Launch lbrynet-daemon") parser.add_argument("--wallet", help="lbryum or ptc for testing, default lbryum", type=str, default=conf.LBRYUM_WALLET) parser.add_argument("--ui", help="path to custom UI folder", default=None) parser.add_argument( "--branch", help='Branch of lbry-web-ui repo to use, defaults to {}'.format(settings.ui_branch), default=settings.ui_branch) parser.add_argument('--no-launch', dest='launchui', action="store_false") parser.add_argument("--http-auth", dest="useauth", action="store_true") parser.add_argument( '--log-to-console', dest='logtoconsole', action='store_true', help=('Set to enable console logging. Set the --verbose flag ' ' to enable more detailed console logging')) parser.add_argument( '--quiet', dest='quiet', action="store_true", help=('If log-to-console is not set, setting this disables all console output. ' 'If log-to-console is set, this argument is ignored')) parser.add_argument( '--verbose', nargs="*", help=('Enable debug output. Optionally specify loggers for which debug output ' 'should selectively be applied.')) args = parser.parse_args() utils.setup_certs_for_windows() conf.update_settings_from_file() update_settings_from_args(args) lbrynet_log = settings.get_log_filename() log_support.configure_logging(lbrynet_log, args.logtoconsole, args.verbose) log.debug('Final Settings: %s', settings.get_dict()) try: log.debug('Checking for an existing lbrynet daemon instance') JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running() log.info("lbrynet-daemon is already running") if not args.logtoconsole: print "lbrynet-daemon is already running" return except Exception: log.debug('No lbrynet instance found, continuing to start') pass log.info("Starting lbrynet-daemon from command line") if not args.logtoconsole and not args.quiet: print "Starting lbrynet-daemon from command line" print "To view activity, view the log file here: " + lbrynet_log print "Web UI is available at http://%s:%i" % (settings.API_INTERFACE, settings.api_port) print "JSONRPC API is available at " + settings.API_CONNECTION_STRING print "To quit press ctrl-c or call 'stop' via the API" if test_internet_connection(): analytics_manager = analytics.Manager.new_instance() analytics_manager.send_server_startup() start_server_and_listen(args.launchui, args.useauth, analytics_manager) reactor.run() if not args.logtoconsole and not args.quiet: print "\nClosing lbrynet-daemon" else: log.info("Not connected to internet, unable to start") if not args.logtoconsole: print "Not connected to internet, unable to start" return
systray_thread = threading.Thread(target=LBRYApp) systray_thread.daemon = True systray_thread.start() DaemonControl.start_server_and_listen( launchui=True, use_auth=False, analytics_manager=analytics.Manager.new_instance() ) reactor.run() if __name__ == '__main__': utils.setup_certs_for_windows() conf.update_settings_from_file() log_file = settings.get_log_filename() log_support.configure_logging(log_file, console=True) lbry_daemon = JSONRPCProxy.from_url(settings.API_CONNECTION_STRING) try: daemon_running = lbry_daemon.is_running() start_daemon = False except: start_daemon = True try: lbry_name = LBRYURIHandler.parse_name(sys.argv[1]) except IndexError: lbry_name = None start_daemon = True
def start(): parser = argparse.ArgumentParser(description="Launch lbrynet-daemon") parser.add_argument("--wallet", help="lbrycrd or lbryum, default lbryum", type=str, default=conf.LBRYUM_WALLET) parser.add_argument("--ui", help="path to custom UI folder", default=None) parser.add_argument( "--branch", help='Branch of lbry-web-ui repo to use, defaults to {}'.format( settings.ui_branch), default=settings.ui_branch) parser.add_argument('--no-launch', dest='launchui', action="store_false") parser.add_argument("--http-auth", dest="useauth", action="store_true") parser.add_argument( '--log-to-console', dest='logtoconsole', action='store_true', help=('Set to enable console logging. Set the --verbose flag ' ' to enable more detailed console logging')) parser.add_argument( '--quiet', dest='quiet', action="store_true", help= ('If log-to-console is not set, setting this disables all console output. ' 'If log-to-console is set, this argument is ignored')) parser.add_argument( '--verbose', nargs="*", help= ('Enable debug output. Optionally specify loggers for which debug output ' 'should selectively be applied.')) args = parser.parse_args() utils.setup_certs_for_windows() conf.update_settings_from_file() update_settings_from_args(args) lbrynet_log = settings.get_log_filename() log_support.configure_logging(lbrynet_log, args.logtoconsole, args.verbose) log.debug('Final Settings: %s', settings.get_dict()) try: log.debug('Checking for an existing lbrynet daemon instance') JSONRPCProxy.from_url(settings.API_CONNECTION_STRING).is_running() log.info("lbrynet-daemon is already running") if not args.logtoconsole: print "lbrynet-daemon is already running" return except Exception: log.debug('No lbrynet instance found, continuing to start') pass log.info("Starting lbrynet-daemon from command line") if not args.logtoconsole and not args.quiet: print "Starting lbrynet-daemon from command line" print "To view activity, view the log file here: " + lbrynet_log print "Web UI is available at http://%s:%i" % (settings.API_INTERFACE, settings.api_port) print "JSONRPC API is available at " + settings.API_CONNECTION_STRING print "To quit press ctrl-c or call 'stop' via the API" if test_internet_connection(): analytics_manager = analytics.Manager.new_instance() analytics_manager.send_server_startup() start_server_and_listen(args.launchui, args.useauth, analytics_manager) reactor.run() if not args.logtoconsole and not args.quiet: print "\nClosing lbrynet-daemon" else: log.info("Not connected to internet, unable to start") if not args.logtoconsole: print "Not connected to internet, unable to start" return