diff --git a/pages/price-feeds/pro/acquire-access-token.mdx b/pages/price-feeds/pro/acquire-access-token.mdx index a87266b7..305a4cd6 100644 --- a/pages/price-feeds/pro/acquire-access-token.mdx +++ b/pages/price-feeds/pro/acquire-access-token.mdx @@ -23,7 +23,10 @@ Once you receive your access token, use it to authenticate the websocket connect import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk"; const client = await PythLazerClient.create( - ["wss://pyth-lazer.dourolabs.app/v1/stream"], + [ + "wss://pyth-lazer-0.dourolabs.app/v1/stream", + "wss://pyth-lazer-1.dourolabs.app/v1/stream", + ], "YOUR_ACCESS_TOKEN" ); ``` diff --git a/pages/price-feeds/pro/getting-started.mdx b/pages/price-feeds/pro/getting-started.mdx index 646c0295..8d4ccea4 100644 --- a/pages/price-feeds/pro/getting-started.mdx +++ b/pages/price-feeds/pro/getting-started.mdx @@ -108,7 +108,10 @@ The main example code in `src/index.ts` demonstrates the core Pyth Pro integrati import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk"; const client = await PythLazerClient.create({ - urls: ["wss://pyth-lazer.dourolabs.app/v1/stream"], + urls: [ + "wss://pyth-lazer-0.dourolabs.app/v1/stream", + "wss://pyth-lazer-1.dourolabs.app/v1/stream", + ], token: process.env.ACCESS_TOKEN!, }); diff --git a/pages/price-feeds/pro/subscribe-price-updates.mdx b/pages/price-feeds/pro/subscribe-price-updates.mdx index ca3c0b88..9a550de4 100644 --- a/pages/price-feeds/pro/subscribe-price-updates.mdx +++ b/pages/price-feeds/pro/subscribe-price-updates.mdx @@ -12,7 +12,17 @@ Subscribing to prices is a three-step process: 2. **Configure** subscription parameters. 3. **Subscribe** to the prices via [websocket API](https://pyth-lazer.dourolabs.app/docs). -The websocket server is available at `wss://pyth-lazer.dourolabs.app/v1/stream{:bash}`. +The websocket servers are available at: + +- `wss://pyth-lazer-0.dourolabs.app/v1/stream` +- `wss://pyth-lazer-1.dourolabs.app/v1/stream` + + + **Redundancy Required**: For redundancy and to avoid interruptions during + deployments, you must connect to **both endpoints**. During deployments, a + single endpoint will briefly go down, so maintaining open connections to both + endpoints ensures continuous service availability. + @@ -68,13 +78,16 @@ To subscribe to the prices, send a request to the websocket server. The server w npm install --save @pythnetwork/pyth-lazer-sdk ``` -2. Then create a [`PythLazerClient`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/sdk/js/src/client.ts#L32) object using the URL and the access token requested from our authorized distribution partners (Pyth Data Distributors) in the first step: +2. Then create a [`PythLazerClient`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/sdk/js/src/client.ts#L51) object using both endpoint URLs and the access token requested from our authorized distribution partners (Pyth Data Distributors) in the first step: ```js copy import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk"; const client = await PythLazerClient.create( - ["wss://pyth-lazer.dourolabs.app/v1/stream"], + [ + "wss://pyth-lazer-0.dourolabs.app/v1/stream", + "wss://pyth-lazer-1.dourolabs.app/v1/stream", + ], "YOUR_ACCESS_TOKEN" ); ```