config.py (1144B)
1 # standard imports 2 import os 3 4 # external imports 5 from chainlib.cli.config import ( 6 Config as BaseConfig, 7 process_config as base_process_config, 8 ) 9 10 11 script_dir = os.path.dirname(os.path.realpath(__file__)) 12 data_dir = os.path.join(script_dir, '..') 13 14 15 class Config(BaseConfig): 16 """Convenience constructor to set Ethereum defaults for the chainlib cli config object 17 """ 18 default_base_config_dir = os.path.join(data_dir, 'data', 'config') 19 default_fee_limit = 21000 20 21 22 def process_config(config, arg, args, flags, positional_name=None): 23 config = base_process_config(config, arg, args, flags, positional_name=positional_name) 24 # if arg.match('provider', flags): 25 # if not bool(config.get('RPC_DIALECT')): 26 # config.add('default', 'RPC_DIALECT', exists_ok=True) 27 # elif config.get('RPC_DIALECT') not in [ 28 # 'openethereum', 29 # 'default', 30 # ]: 31 # raise ValueError('unknown rpc dialect {}'.format(config.get('RPC_DIALECT'))) 32 33 #if arg.match('create', flags): 34 # config.add(getattr(args, 'null'), '_NULL') 35 36 37 return config