more refactor + fix some node tests

This commit is contained in:
meejah
2018-01-28 01:27:25 -07:00
parent 71484b4a12
commit 43d857a0bd
5 changed files with 115 additions and 68 deletions

View File

@ -206,17 +206,21 @@ def create_client(basedir=u".", _client_factory=None):
config = read_config(basedir, u"client.port", _valid_config_sections=_valid_config_sections)
return create_client_from_config(basedir, config)
# this can/should be async
# @defer.inlineCallbacks
def create_client_from_config(basedir, config):
default_connection_handlers, foolscap_connection_handlers = create_connection_handlers(reactor, basedir, config)
from twisted.internet import reactor
from allmydata.node import create_i2p_provider, create_tor_provider
i2p_provider = create_i2p_provider(reactor, basedir, config)
tor_provider = create_tor_provider(reactor, basedir, config)
handlers = create_connection_handlers(reactor, basedir, config, i2p_provider, tor_provider)
default_connection_handlers, foolscap_connection_handlers = handlers
tub_options = create_tub_options(config)
i2p_provider = None
tor_provider = None
main_tub, is_listening = create_main_tub(
basedir, config, tub_options, default_connection_handlers,
foolscap_connection_handlers,
foolscap_connection_handlers, i2p_provider, tor_provider,
)
control_tub = create_control_tub()
return defer.succeed(