XRPL-Labs / xrpl-client

Connect to the XRP Ledger using WebSockets
https://www.npmjs.com/package/xrpl-client
MIT License
12 stars 8 forks source link

expose the nodswitch event that can be invoked from the client #3

Closed shortthefomo closed 2 years ago

shortthefomo commented 2 years ago

Expose the nodeswitch event that it can be invoked from the client

WietseWind commented 2 years ago

Thanks :)

I assume you want to manually switch a node if e.g. the node you're connected to doesn't satisfy ?

I'm afraid that sending the event won't do anything here, as the lib doesn't rely on the event to perform the actual switch: it just sends the event to inform the client. To do the actual switching, there's a routine in the connect method:

https://github.com/XRPL-Labs/xrpl-client/blob/main/src/index.ts#L659

I'm happy to help out here btw, if I know the use case. It'll need a bit more than sending the event 😇

Although (please test) I believe calling the connect or reinstate method will already do what a nodeswitch seems to suggest you're looking for :)

shortthefomo commented 2 years ago

yup thats perfect thanks @WietseWind