py-substrate-interface
py-substrate-interface copied to clipboard
SubstrateInterface information for HydraDX network connection
Hi friends! Thank you very much for you work. py-substrate-interface is working great, but unfortunately i cant find information for connection to HydraDX network
I am trying to connect to https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-01.snakenet.hydradx.io#/explorer Not to local node!
If i am correct i need something like this:
substrate = SubstrateInterface(
url="wss://rpc-01.snakenet.hydradx.io/",
ss58_format=63,
type_registry_preset='hydradx'
)
But i get:
WebSocketBadStatusException Traceback (most recent call last)
<ipython-input-38-6ae9b2f5584b> in <module>
----> 1 substrate = SubstrateInterface(
2 url="wss://rpc-01.snakenet.hydradx.io",
3 ss58_format=63,
4 type_registry_preset='hydradx'
5 )
C:\ProgramData\Anaconda3\lib\site-packages\substrateinterface\base.py in __init__(self, url, websocket, ss58_format, type_registry, type_registry_preset, cache_region, address_type, runtime_config, use_remote_preset)
425
426 if self.url and (self.url[0:6] == 'wss://' or self.url[0:5] == 'ws://'):
--> 427 self.connect_websocket()
428
429 elif websocket:
C:\ProgramData\Anaconda3\lib\site-packages\substrateinterface\base.py in connect_websocket(self)
459 if self.url and (self.url[0:6] == 'wss://' or self.url[0:5] == 'ws://'):
460 self.debug_message("Connecting to {} ...".format(self.url))
--> 461 self.websocket = create_connection(
462 self.url,
463 max_size=2 ** 32,
C:\ProgramData\Anaconda3\lib\site-packages\websocket\_core.py in create_connection(url, timeout, class_, **options)
590 skip_utf8_validation=skip_utf8_validation, **options)
591 websock.settimeout(timeout if timeout is not None else getdefaulttimeout())
--> 592 websock.connect(url, **options)
593 return websock
C:\ProgramData\Anaconda3\lib\site-packages\websocket\_core.py in connect(self, url, **options)
250
251 try:
--> 252 self.handshake_response = handshake(self.sock, *addrs, **options)
253 for attempt in range(options.pop('redirect_limit', 3)):
254 if self.handshake_response.status in SUPPORTED_REDIRECT_STATUSES:
C:\ProgramData\Anaconda3\lib\site-packages\websocket\_handshake.py in handshake(sock, hostname, port, resource, **options)
77 dump("request header", header_str)
78
---> 79 status, resp = _get_resp_headers(sock)
80 if status in SUPPORTED_REDIRECT_STATUSES:
81 return handshake_response(status, resp, None)
C:\ProgramData\Anaconda3\lib\site-packages\websocket\_handshake.py in _get_resp_headers(sock, success_statuses)
162 status, resp_headers, status_message = read_headers(sock)
163 if status not in success_statuses:
--> 164 raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
165 return status, resp_headers
166
WebSocketBadStatusException: Handshake status 403 Forbidden
Also you have option using Json file with data which i dont know where to get:
{
"runtime_id": 2,
"types": {
"MyCustomInt": "u32",
"MyStruct": {
"type": "struct",
"type_mapping": [
["account", "AccountId"],
["message", "Vec<u8>"]
]
}
},
"versioning": [
]
If you have correct data for connection or know where i can det it please help
Thank you very much for any help
Best regards