Reputation: 1
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.
Upvotes: 0
Views: 182
Reputation: 1
I'm learning to connect to the test net like this, using JavaScript:
const api = new xrpl.Client("wss://s.altnet.rippletest.net/");
Upvotes: 0
Reputation: 61
if you connect to a websocket, the URL should start with wss://
and not https://
.
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
Upvotes: 1