Websocket
Creating a subscription
Last updated
Creating a subscription
Last updated
Streams are available with Websocket via both Gateway and Cloud-API. Subscriptions are created using the RPC call subscribe
with the stream (feed) name and subscription options set as parameters. Each stream has a different subscription name and can accept different subscription options. Please refer to the specific stream page for info.
subscribe
returns a subscription ID that will be paired with all related notifications.
Before using the subscribe call, you need to open a Websocket connection to the Gateway or the Cloud-API.
Notes:
We assume that the Gateway IP is 127.0.0.1 with default ws port 28333 in the example below.
Subscribing to Gateway Stream in Python (version 3.7 or higher):
For more help subscribing to a Websocket stream, follow our step-by-step .
Please check for examples in wscat, node.js and Golang.