Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pages/price-feeds/pro/acquire-access-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
```
Expand Down
5 changes: 4 additions & 1 deletion pages/price-feeds/pro/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
});

Expand Down
19 changes: 16 additions & 3 deletions pages/price-feeds/pro/subscribe-price-updates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`

<Callout type="warning" emoji="⚠️">
**Redundancy Required**: For redundancy and to avoid potential interruptions
during deployments, you must connect to **both endpoints**. During
deployments, a single endpoint may briefly go down, so maintaining open
connections to both endpoints ensures continuous service availability.
</Callout>

<Steps>

Expand Down Expand Up @@ -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#L32) 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"
);
```
Expand Down
Loading