Add rpc timeout proxy args
This commit is contained in:
parent
2ad84fc5aa
commit
272bf43ba5
@ -11,6 +11,7 @@ import sys
|
||||
from aiee.arg import (
|
||||
ArgFlag as BaseArgFlag,
|
||||
Arg as BaseArg,
|
||||
process_args,
|
||||
)
|
||||
|
||||
logg = logging.getLogger(__name__)
|
||||
@ -98,6 +99,8 @@ class Arg(BaseArg):
|
||||
self.add('p', 'provider', help='RPC HTTP(S) provider url')
|
||||
self.set_long('p', 'provider')
|
||||
self.add_long('rpc-dialect', 'provider', help='RPC HTTP(S) backend dialect')
|
||||
self.add_long('rpc-timeout', 'provider', help='RPC autentication credential values')
|
||||
self.add_long('rpc-proxy', 'provider', help='RPC autentication credential values')
|
||||
|
||||
self.add_long('height', 'no_target', default='latest', help='Block height to execute against')
|
||||
|
||||
|
@ -61,7 +61,7 @@ class Rpc:
|
||||
self.id_generator = IntSequenceGenerator()
|
||||
|
||||
self.chain_spec = config.get('CHAIN_SPEC')
|
||||
self.conn = self.constructor(url=config.get('RPC_PROVIDER'), chain_spec=self.chain_spec, auth=auth, verify_identity=config.true('RPC_VERIFY'))
|
||||
self.conn = self.constructor(url=config.get('RPC_PROVIDER'), chain_spec=self.chain_spec, auth=auth, verify_identity=config.true('RPC_VERIFY'), timeout=float(config.get('RPC_TIMEOUT')))
|
||||
|
||||
return self.conn
|
||||
|
||||
|
@ -5,6 +5,8 @@ credentials =
|
||||
dialect = default
|
||||
scheme = http
|
||||
verify = 1
|
||||
timeout = 10.0
|
||||
proxy =
|
||||
|
||||
[chain]
|
||||
spec =
|
||||
|
@ -122,34 +122,6 @@ class TestCli(unittest.TestCase):
|
||||
|
||||
config = Config()
|
||||
config = process_config(config, self.arg, args, flags)
|
||||
print(config)
|
||||
|
||||
|
||||
# def test_args_process_extra(self):
|
||||
# ap = ArgumentParser()
|
||||
# flags = self.flags.VERBOSE | self.flags.CONFIG
|
||||
# process_args(ap, self.arg, flags)
|
||||
# ap.add_argument('--foo', type=str)
|
||||
# argv = [
|
||||
# '--foo',
|
||||
# 'bar',
|
||||
# ]
|
||||
# args = ap.parse_args(argv)
|
||||
# extra_args = {
|
||||
# 'foo': None,
|
||||
# }
|
||||
#
|
||||
# config = Config()
|
||||
# config = process_config(config, self.arg, args, flags)
|
||||
# self.assertEqual(config.get('_FOO'), 'bar')
|
||||
#
|
||||
# extra_args = {
|
||||
# 'foo': 'FOOFOO',
|
||||
# }
|
||||
#
|
||||
# config = Config()
|
||||
# config = process_config(config, self.arg, args, flags)
|
||||
# self.assertEqual(config.get('FOOFOO'), 'bar')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user