arg.py (3983B)
1 def process_args(argparser, args, flags): 2 # session flags 3 argparser.add_argument('--state-dir', dest='state_dir', type=str, help='Directory to store sync state') 4 argparser.add_argument('--session-id', dest='session_id', type=str, help='Use state from specified session id') 5 # TODO: deprecate! 6 argparser.add_argument('--cache-dir', dest='cache_dir', type=str, help='Directory to store tx data') 7 argparser.add_argument('--cache-spec', dest='cache_spec', type=str, help='URL backend selector to store tx data') 8 9 # address rules flags 10 argparser.add_argument('--input', action='append', type=str, help='Add input (recipient) addresses to includes list') 11 argparser.add_argument('--output', action='append', type=str, help='Add output (sender) addresses to includes list') 12 argparser.add_argument('--exec', action='append', type=str, help='Add exec (contract) addresses to includes list') 13 argparser.add_argument('--txhash', action='append', type=str, help='Add tx hash part to includes list') 14 argparser.add_argument('--data', action='append', type=str, help='Add data prefix strings to include list') 15 argparser.add_argument('--data-in', action='append', dest='data_in', type=str, help='Add data contain strings to include list') 16 argparser.add_argument('--x-data', action='append', dest='x_data', type=str, help='Add data prefix string to exclude list') 17 argparser.add_argument('--x-data-in', action='append', dest='x_data_in', type=str, help='Add data contain string to exclude list') 18 argparser.add_argument('--address', action='append', type=str, help='Add addresses as input, output and exec to includes list') 19 argparser.add_argument('--x-input', action='append', type=str, dest='x_input', help='Add input (recipient) addresses to excludes list') 20 argparser.add_argument('--x-output', action='append', type=str, dest='x_output', help='Add output (sender) addresses to excludes list') 21 argparser.add_argument('--x-exec', action='append', type=str, dest='x_exec', help='Add exec (contract) addresses to excludes list') 22 argparser.add_argument('--x-txhash', action='append', type=str, help='Add tx hash part to excludes list') 23 argparser.add_argument('--x-address', action='append', type=str, dest='x_address', help='Add addresses as input, output and exec to excludes list') 24 argparser.add_argument('--includes-file', type=str, dest='includes_file', help='Load include rules from file') 25 argparser.add_argument('--excludes-file', type=str, dest='excludes_file', help='Load exclude rules from file') 26 argparser.add_argument('--include-default', dest='include_default', action='store_true', help='Include all transactions by default') 27 28 # filter flags 29 argparser.add_argument('--renderer', type=str, action='append', default=[], help='Python modules to dynamically load for rendering of transaction output') 30 argparser.add_argument('--filter', type=str, action='append', help='Add python module to tx filter path') 31 argparser.add_argument('--block-filter', type=str, dest='block_filter', action='append', help='Add python module to block filter path') 32 33 # cache flags 34 argparser.add_argument('--store-tx-data', action='store_true', dest='store_tx_data', help='Store tx data in cache store') 35 argparser.add_argument('--store-block-data', action='store_true', dest='store_block_data', help='Store block data in cache store') 36 argparser.add_argument('--fresh', action='store_true', help='Do not read block and tx data from cache, even if available') 37 argparser.add_argument('--match-all', action='store_true', dest='match_all', help='Match all include filter criteria') 38 39 # misc flags 40 argparser.add_argument('-k', '--context-key', dest='context_key', action='append', type=str, help='Add a key-value pair to be added to the context') 41 argparser.add_argument('--run-dir', type=str, dest='run_dir', help='Output key sync and processing state properties to given diretory')