move daemon construction from cli into daemon function

This commit is contained in:
Lex Berezhny 2020-09-16 16:34:55 -04:00
parent 144eb248e3
commit f26aadbd44

View file

@ -12,9 +12,6 @@ from lbry import __version__
from lbry.conf import Config, CLIConfig from lbry.conf import Config, CLIConfig
from lbry.service import Daemon, Client from lbry.service import Daemon, Client
from lbry.service.metadata import interface from lbry.service.metadata import interface
from lbry.service.full_node import FullNode
from lbry.blockchain.ledger import Ledger
from lbry.console import Advanced as AdvancedConsole, Basic as BasicConsole
def split_subparser_argument(parent, original, name, condition): def split_subparser_argument(parent, original, name, condition):
@ -251,12 +248,7 @@ def main(argv=None):
if args.help: if args.help:
args.start_parser.print_help() args.start_parser.print_help()
elif args.full_node: elif args.full_node:
service = FullNode(Ledger(conf)) return Daemon.from_config(conf).run()
if conf.console == "advanced":
console = AdvancedConsole(service)
else:
console = BasicConsole(service)
return Daemon(service, console).run()
else: else:
print('Only `start --full-node` is currently supported.') print('Only `start --full-node` is currently supported.')
elif args.command == 'install': elif args.command == 'install':