cic-internal-integration/apps/cic-cache/cic_cache/cli/arg.py
2021-11-03 13:03:23 +01:00

22 lines
992 B
Python

# external imports
from chainlib.eth.cli import ArgumentParser as BaseArgumentParser
# local imports
from .base import (
CICFlag,
Flag,
)
class ArgumentParser(BaseArgumentParser):
def process_local_flags(self, local_arg_flags):
if local_arg_flags & CICFlag.CELERY:
self.add_argument('-q', '--celery-queue', dest='celery_queue', type=str, default='cic-cache', help='Task queue')
if local_arg_flags & CICFlag.SYNCER:
self.add_argument('--offset', type=int, help='Start block height for initial history sync')
self.add_argument('--no-history', action='store_true', dest='no_history', help='Skip initial history sync')
if local_arg_flags & CICFlag.CHAIN:
self.add_argument('--registry-address', type=str, dest='registry_address', help='CIC registry contract address')
self.add_argument('--trust-address', type=str, dest='trust_address', action='append', help='Add trust address')