If yes, could you point me to a suitable websocket client?
I want to demonstrate that I submit data with Navigator, and as soon as some condition gets fulfilled, a new contract gets created, and that we can get a notification from the creation of the new contract without polling the REST API.
Thanks
1 Like
Absolutely, there isn’t anything special about the websocket interface or the JSON API in general. We don’t have a generic websocket client but what you could do is to use create-daml-app
and attach navigator to it as well. If you then create the changes in navigator, you will see them propagate to the UI immediately via the websocket API. If you already have an existing app, it might be a useful starting point
2 Likes
To start Navigator as part of the daml start
command in the create-daml-app
template, you can just change the last line of the generated daml.yaml
from
start-navigator: false
to
start-navigator: true
2 Likes
You should in principle be able to use a general websocket client too. Some googling around shows this question on Stackoverflow, that links to this example of how to use CURL to read a websocket, in general.
Of course, you will need to make sure you start up the HTTP-JSON service, which provides the websocket endpoint. This is the same interface that the create-daml-app
connects to.
And finally a disclaimer: I haven’t tried this myself.
2 Likes