@@ -115,19 +115,19 @@ def __init__(
115
115
network : Optional [str ] = None ,
116
116
config : Optional ["Config" ] = None ,
117
117
log_verbose : bool = False ,
118
- fallback_chains : Optional [list [str ]] = None ,
118
+ fallback_endpoints : Optional [list [str ]] = None ,
119
119
retry_forever : bool = False ,
120
120
_mock : bool = False ,
121
121
):
122
122
"""
123
123
Initializes an instance of the AsyncSubtensor class.
124
124
125
125
Arguments:
126
- network (str) : The network name or type to connect to.
127
- config (Optional[Config]) : Configuration object for the AsyncSubtensor instance.
128
- log_verbose (bool) : Enables or disables verbose logging.
129
- fallback_chains (list) : List of fallback chains endpoints to use if no network is specified . Defaults to `None`.
130
- retry_forever (bool) : Whether to retry forever on connection errors. Defaults to `False`.
126
+ network: The network name or type to connect to.
127
+ config: Configuration object for the AsyncSubtensor instance.
128
+ log_verbose: Enables or disables verbose logging.
129
+ fallback_endpoints : List of fallback endpoints to use if default or provided network is not available . Defaults to `None`.
130
+ retry_forever: Whether to retry forever on connection errors. Defaults to `False`.
131
131
_mock: Whether this is a mock instance. Mainly just for use in testing.
132
132
133
133
Raises:
@@ -148,7 +148,9 @@ def __init__(
148
148
f"chain_endpoint: [blue]{ self .chain_endpoint } [/blue]..."
149
149
)
150
150
self .substrate = self ._get_substrate (
151
- fallback_chains = fallback_chains , retry_forever = retry_forever , _mock = _mock
151
+ fallback_endpoints = fallback_endpoints ,
152
+ retry_forever = retry_forever ,
153
+ _mock = _mock ,
152
154
)
153
155
if self .log_verbose :
154
156
logging .info (
@@ -284,24 +286,24 @@ async def get_hyperparameter(
284
286
285
287
def _get_substrate (
286
288
self ,
287
- fallback_chains : Optional [list [str ]] = None ,
289
+ fallback_endpoints : Optional [list [str ]] = None ,
288
290
retry_forever : bool = False ,
289
291
_mock : bool = False ,
290
292
) -> Union [AsyncSubstrateInterface , RetryAsyncSubstrate ]:
291
293
"""Creates the Substrate instance based on provided arguments.
292
294
293
295
Arguments:
294
- fallback_chains (list) : List of fallback chains endpoints to use if no network is specified . Defaults to `None`.
295
- retry_forever (bool) : Whether to retry forever on connection errors. Defaults to `False`.
296
+ fallback_endpoints : List of fallback endpoints to use if default or provided network is not available . Defaults to `None`.
297
+ retry_forever: Whether to retry forever on connection errors. Defaults to `False`.
296
298
_mock: Whether this is a mock instance. Mainly just for use in testing.
297
299
298
300
Returns:
299
301
the instance of the SubstrateInterface or RetrySyncSubstrate class.
300
302
"""
301
- if fallback_chains or retry_forever :
303
+ if fallback_endpoints or retry_forever :
302
304
return RetryAsyncSubstrate (
303
305
url = self .chain_endpoint ,
304
- fallback_chains = fallback_chains ,
306
+ fallback_chains = fallback_endpoints ,
305
307
ss58_format = SS58_FORMAT ,
306
308
type_registry = TYPE_REGISTRY ,
307
309
retry_forever = retry_forever ,
0 commit comments