diff --git a/hathor/builder/cli_builder.py b/hathor/builder/cli_builder.py index 9d0cc2da1..1ee82f9bb 100644 --- a/hathor/builder/cli_builder.py +++ b/hathor/builder/cli_builder.py @@ -158,8 +158,17 @@ def create_manager(self, reactor: Reactor) -> HathorManager: hostname = self.get_hostname() network = settings.NETWORK_NAME - enable_sync_v1 = not self._args.x_sync_v2_only - enable_sync_v2 = self._args.x_sync_v2_only or self._args.x_sync_bridge + + arg_sync_v2_only = self._args.x_sync_v2_only or self._args.sync_v2_only + if self._args.x_sync_v2_only: + self.log.warn('--x-sync-v2-only is deprecated and will be removed, use --sync-v2-only instead') + + arg_sync_bridge = self._args.x_sync_bridge or self._args.sync_bridge + if self._args.x_sync_bridge: + self.log.warn('--x-sync-bridge is deprecated and will be removed, use --sync-bridge instead') + + enable_sync_v1 = not arg_sync_v2_only + enable_sync_v2 = arg_sync_v2_only or arg_sync_bridge pubsub = PubSubManager(reactor) diff --git a/hathor/cli/run_node.py b/hathor/cli/run_node.py index 7b5ac15ed..42415688c 100644 --- a/hathor/cli/run_node.py +++ b/hathor/cli/run_node.py @@ -108,6 +108,11 @@ def create_parser(cls) -> ArgumentParser: help='Enable support for running both sync protocols. DO NOT ENABLE, IT WILL BREAK.') v2args.add_argument('--x-sync-v2-only', action='store_true', help='Disable support for running sync-v1. DO NOT ENABLE, IT WILL BREAK.') + # XXX: new safe arguments along side the unsafe --x- arguments so transition is easier + v2args.add_argument('--sync-bridge', action='store_true', + help='Enable support for running both sync protocols.') + v2args.add_argument('--sync-v2-only', action='store_true', + help='Disable support for running sync-v1.') parser.add_argument('--x-localhost-only', action='store_true', help='Only connect to peers on localhost') parser.add_argument('--x-rocksdb-indexes', action='store_true', help=SUPPRESS) parser.add_argument('--x-enable-event-queue', action='store_true', help='Enable event queue mechanism') diff --git a/hathor/cli/run_node_args.py b/hathor/cli/run_node_args.py index ca581bfed..3beca2b0f 100644 --- a/hathor/cli/run_node_args.py +++ b/hathor/cli/run_node_args.py @@ -65,6 +65,8 @@ class RunNodeArgs(BaseModel, extra=Extra.allow): enable_crash_api: bool x_sync_bridge: bool x_sync_v2_only: bool + sync_bridge: bool + sync_v2_only: bool x_localhost_only: bool x_rocksdb_indexes: bool x_enable_event_queue: bool