diff --git a/src/tribler/core/components/conftest.py b/src/tribler/core/components/conftest.py index f9fb075cc4e..18b2a07ea76 100644 --- a/src/tribler/core/components/conftest.py +++ b/src/tribler/core/components/conftest.py @@ -32,6 +32,7 @@ def tribler_config(tmp_path) -> TriblerConfig: config.torrent_checking.enabled = False config.ipv8.enabled = False config.ipv8.walk_scaling_enabled = False + config.ipv8.rust_endpoint = False config.discovery_community.enabled = False config.libtorrent.enabled = False config.libtorrent.dht_readiness_timeout = 0 diff --git a/src/tribler/core/components/ipv8/ipv8_component.py b/src/tribler/core/components/ipv8/ipv8_component.py index 0e6e72d5700..ee5253685d7 100644 --- a/src/tribler/core/components/ipv8/ipv8_component.py +++ b/src/tribler/core/components/ipv8/ipv8_component.py @@ -56,7 +56,7 @@ async def run(self): self.rendevous_hook = RendezvousHook(self.rendezvous_db) port = config.ipv8.port - address = config.ipv8.address + address = '127.0.0.1' if config.gui_test_mode else config.ipv8.address self.logger.info('Starting ipv8') self.logger.info(f'Port: {port}. Address: {address}') ipv8_config_builder = (ConfigBuilder() @@ -67,12 +67,10 @@ async def run(self): .set_working_directory(str(config.state_dir)) .set_walker_interval(config.ipv8.walk_interval)) - INTERFACES["UDPIPv4"] = UDPEndpoint + if config.ipv8.rust_endpoint and not config.gui_test_mode: + INTERFACES["UDPIPv4"] = UDPEndpoint - if config.gui_test_mode: - endpoint = DispatcherEndpoint([]) - else: - endpoint = DispatcherEndpoint(["UDPIPv4"], UDPIPv4={'port': port, 'ip': address}) + endpoint = DispatcherEndpoint(["UDPIPv4"], UDPIPv4={'port': port, 'ip': address}) ipv8 = IPv8(ipv8_config_builder.finalize(), enable_statistics=config.ipv8.statistics and not config.gui_test_mode, diff --git a/src/tribler/core/components/ipv8/settings.py b/src/tribler/core/components/ipv8/settings.py index 7f7aeb770f2..1a51bd578f5 100644 --- a/src/tribler/core/components/ipv8/settings.py +++ b/src/tribler/core/components/ipv8/settings.py @@ -19,6 +19,7 @@ class Ipv8Settings(TriblerConfigSection): enabled: bool = True port: int = 7759 address: str = '0.0.0.0' + rust_endpoint: bool = True bootstrap_override: Optional[str] = None statistics: bool = False rendezvous_stats: bool = False diff --git a/src/tribler/core/components/socks_servers/socks5/tests/test_server.py b/src/tribler/core/components/socks_servers/socks5/tests/test_server.py index a6b7819db1e..59bd0531552 100644 --- a/src/tribler/core/components/socks_servers/socks5/tests/test_server.py +++ b/src/tribler/core/components/socks_servers/socks5/tests/test_server.py @@ -12,7 +12,7 @@ @pytest.fixture(name='socks5_server') async def fixture_socks5_server(free_port): - socks5_server = Socks5Server(free_port, Mock()) + socks5_server = Socks5Server(1, free_port, Mock()) yield socks5_server await socks5_server.stop()