I am new to cryptocurrencies in general and I am at an intermediate level in Python (but a new Websocket user). I am using the xrpl-py library in order to build a Ripple-ledger based App, however I am getting stuck at the very beginning.
When I try to run the following
testnet_url = "https://s.altnet.rippletest.net:51234"
from xrpl.clients import WebsocketClient
client = WebsocketClient(testnet_url)
client.open() #This usage for opening the client is not preferred, but is useful for reproducing the error
I get the following error:
File "/home/gordito/anaconda3/lib/python3.7/site-packages/websockets/uri.py", line 70, in parse_uri raise InvalidURI(uri) from exc
InvalidURI: https://s.altnet.rippletest.net:51234 isn't a valid URI
Am I trying to connect to the wrong url? This is the only address listed in the XRP documentation.
Thanks.
if you connect to a websocket, the URL should start with
wss://and nothttps://.A list of public endpoints to connect to can be found here:
https://xrpl.org/public-servers.html
so in your example, the URL should be:
wss://s.altnet.rippletest.net/if you use
https://then you call the JSON-RPC endpoint and not the websocket endpoint.Best, Daniel