Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hathor/builder/cli_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,24 @@ def create_manager(self, reactor: Reactor) -> HathorManager:

sync_choice: SyncChoice
if self._args.sync_bridge:
self.log.warn('--sync-bridge is deprecated and will be removed')
sync_choice = SyncChoice.BRIDGE_DEFAULT
elif self._args.sync_v1_only:
self.log.warn('--sync-v1-only is deprecated and will be removed')
sync_choice = SyncChoice.V1_DEFAULT
elif self._args.sync_v2_only:
self.log.warn('--sync-v2-only is the default, this parameter has no effect')
sync_choice = SyncChoice.V2_DEFAULT
elif self._args.x_remove_sync_v1:
sync_choice = SyncChoice.V2_ONLY
elif self._args.x_sync_bridge:
self.log.warn('--x-sync-bridge is deprecated and will be removed, use --sync-bridge instead')
self.log.warn('--x-sync-bridge is deprecated and will be removed')
sync_choice = SyncChoice.BRIDGE_DEFAULT
elif self._args.x_sync_v1_only:
self.log.warn('--x-sync-v1-only is deprecated and will be removed')
sync_choice = SyncChoice.V1_DEFAULT
elif self._args.x_sync_v2_only:
self.log.warn('--x-sync-v2-only is deprecated and will be removed, use --sync-v2-only instead')
self.log.warn('--x-sync-v2-only is deprecated and will be removed')
sync_choice = SyncChoice.V2_DEFAULT
else:
# XXX: this is the default behavior when no parameter is given
Expand Down
15 changes: 9 additions & 6 deletions hathor/cli/run_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class RunNode:
UNSAFE_ARGUMENTS: list[tuple[str, Callable[['RunNodeArgs'], bool]]] = [
('--test-mode-tx-weight', lambda args: bool(args.test_mode_tx_weight)),
('--enable-crash-api', lambda args: bool(args.enable_crash_api)),
('--sync-bridge', lambda args: bool(args.sync_bridge)),
('--sync-v1-only', lambda args: bool(args.sync_v1_only)),
('--x-sync-bridge', lambda args: bool(args.x_sync_bridge)),
('--x-sync-v1-only', lambda args: bool(args.x_sync_v1_only)),
('--x-sync-v2-only', lambda args: bool(args.x_sync_v2_only)),
('--x-enable-event-queue', lambda args: bool(args.x_enable_event_queue)),
('--x-asyncio-reactor', lambda args: bool(args.x_asyncio_reactor)),
Expand Down Expand Up @@ -129,14 +132,14 @@ def create_parser(cls) -> ArgumentParser:
parser.add_argument('--enable-debug-api', action='store_true', help='Enable _debug/* endpoints')
parser.add_argument('--enable-crash-api', action='store_true', help='Enable _crash/* endpoints')
sync_args = parser.add_mutually_exclusive_group()
sync_args.add_argument('--sync-bridge', action='store_true',
help='Enable running both sync protocols.')
sync_args.add_argument('--sync-v1-only', action='store_true', help='Disable support for running sync-v2.')
sync_args.add_argument('--sync-v2-only', action='store_true', help='Disable support for running sync-v1.')
sync_args.add_argument('--sync-bridge', action='store_true', help=SUPPRESS) # moved to --x-sync-bridge
sync_args.add_argument('--sync-v1-only', action='store_true', help=SUPPRESS) # moved to --x-sync-v1-only
sync_args.add_argument('--sync-v2-only', action='store_true', help=SUPPRESS) # already default
sync_args.add_argument('--x-remove-sync-v1', action='store_true', help='Make sync-v1 unavailable, thus '
'impossible to be enable in runtime.')
'impossible to be enabled in runtime.')
sync_args.add_argument('--x-sync-v1-only', action='store_true', help='Disable support for running sync-v2.')
sync_args.add_argument('--x-sync-v2-only', action='store_true', help=SUPPRESS) # old argument
sync_args.add_argument('--x-sync-bridge', action='store_true', help=SUPPRESS) # old argument
sync_args.add_argument('--x-sync-bridge', action='store_true', help='Enable running both sync protocols.')
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')
Expand Down
1 change: 1 addition & 0 deletions hathor/cli/run_node_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class RunNodeArgs(BaseModel, extra=Extra.allow):
enable_debug_api: bool
enable_crash_api: bool
x_sync_bridge: bool
x_sync_v1_only: bool
x_sync_v2_only: bool
x_remove_sync_v1: bool
sync_bridge: bool
Expand Down