Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions price_pusher/docker-compose.mainnet.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
spy:
# Find latest Guardian images in https://github.com/wormhole-foundation/wormhole/pkgs/container/guardiand
image: ghcr.io/wormhole-foundation/guardiand:v2.17.0
image: ghcr.io/wormhole-foundation/guardiand:v2.19.0
command:
- "spy"
- "--nodeKey"
Expand All @@ -16,7 +16,7 @@ services:
- "warn"
price-service:
# Find latest price service images https://gallery.ecr.aws/pyth-network/xc-server
image: public.ecr.aws/pyth-network/xc-server:v3.0.3
image: public.ecr.aws/pyth-network/xc-server:v3.0.8
environment:
SPY_SERVICE_HOST: "spy:7072"
SPY_SERVICE_FILTERS: |
Expand All @@ -32,8 +32,8 @@ services:
]
REST_PORT: "4200"
PROM_PORT: "8081"
READINESS_SPY_SYNC_TIME_SECONDS: "20"
READINESS_NUM_LOADED_SYMBOLS: "50"
READINESS_SPY_SYNC_TIME_SECONDS: "5"
READINESS_NUM_LOADED_SYMBOLS: "280"
LOG_LEVEL: warning
WORMHOLE_CLUSTER: mainnet
healthcheck:
Expand All @@ -50,12 +50,20 @@ services:
depends_on:
- spy
price-pusher:
build:
context: .
# Uncomment this line (and comment out the above lines) to use a prebuilt image. Replace <version>
# with the latest released image of the price pusher from this repo release page:
# https://github.com/pyth-network/pyth-crosschain/releases
# image: public.ecr.aws/pyth-network/xc-price-pusher:v<version>
# Use this to build the price pusher from source. A dependency of the pusher docker
# image is the pyth-crosschain monorepo lerna docker image. Build lerna image
# using the following command from the repo root:
# `docker buildx build -f tilt_devnet/docker_images/Dockerfile.lerna -t lerna .`
#
# Please note that the docker build from source only works in x86_64 platforms
# and doesn't work on arm platforms (like Apple M1/M2).
#
# build:
# context: .

# Replace <version> with the latest released image of the price pusher from here:
# https://gallery.ecr.aws/pyth-network/xc-price-pusher
image: public.ecr.aws/pyth-network/xc-price-pusher:v<version>
restart: always
command:
- "--"
Expand Down
28 changes: 18 additions & 10 deletions price_pusher/docker-compose.testnet.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
spy:
# Find latest Guardian images in https://github.com/wormhole-foundation/wormhole/pkgs/container/guardiand
image: ghcr.io/wormhole-foundation/guardiand:v2.17.0
image: ghcr.io/wormhole-foundation/guardiand:v2.19.0
command:
- "spy"
- "--nodeKey"
Expand All @@ -16,7 +16,7 @@ services:
- "warn"
price-service:
# Find latest price service images https://gallery.ecr.aws/pyth-network/xc-server
image: public.ecr.aws/pyth-network/xc-server:v3.0.3
image: public.ecr.aws/pyth-network/xc-server:v3.0.8
environment:
SPY_SERVICE_HOST: "spy:7072"
SPY_SERVICE_FILTERS: |
Expand All @@ -32,8 +32,8 @@ services:
]
REST_PORT: "4200"
PROM_PORT: "8081"
READINESS_SPY_SYNC_TIME_SECONDS: "20"
READINESS_NUM_LOADED_SYMBOLS: "50"
READINESS_SPY_SYNC_TIME_SECONDS: "5"
READINESS_NUM_LOADED_SYMBOLS: "280"
LOG_LEVEL: warning
WORMHOLE_CLUSTER: testnet
healthcheck:
Expand All @@ -50,12 +50,20 @@ services:
depends_on:
- spy
price-pusher:
build:
context: .
# Uncomment this line (and comment out the above lines) to use a prebuilt image. Replace <version>
# with the latest released image of the price pusher from this repo release page:
# https://github.com/pyth-network/pyth-crosschain/releases
# image: public.ecr.aws/pyth-network/xc-price-pusher:v<version>
# Use this to build the price pusher from source. A dependency of the pusher docker
# image is the pyth-crosschain monorepo lerna docker image. Build lerna image
# using the following command from the repo root:
# `docker buildx build -f tilt_devnet/docker_images/Dockerfile.lerna -t lerna .`
#
# Please note that the docker build from source only works in x86_64 platforms
# and doesn't work on arm platforms (like Apple M1/M2).
#
# build:
# context: .

# Replace <version> with the latest released image of the price pusher from here:
# https://gallery.ecr.aws/pyth-network/xc-price-pusher
image: public.ecr.aws/pyth-network/xc-price-pusher:v<version>
restart: always
command:
- "--"
Expand Down
2 changes: 1 addition & 1 deletion price_pusher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/price-pusher",
"version": "5.4.3",
"version": "5.4.4",
"description": "Pyth Price Pusher",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion price_service/client/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/price-service-client",
"version": "1.6.0",
"version": "1.6.1",
"description": "Pyth price service client",
"author": {
"name": "Pyth Data Association"
Expand Down
43 changes: 32 additions & 11 deletions price_service/client/js/src/PriceServiceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class PriceServiceConnection {
private wsClient: undefined | ResilientWebSocket;
private wsEndpoint: undefined | string;

private logger: undefined | Logger;
private logger: Logger;

private priceFeedRequestConfig: PriceFeedRequestConfig;

Expand Down Expand Up @@ -96,9 +96,30 @@ export class PriceServiceConnection {

this.priceFeedCallbacks = new Map();

this.logger = config?.logger;
// Default logger is console for only warnings and errors.
this.logger = config?.logger || {
trace: () => {},
debug: () => {},
info: () => {},
warn: console.warn,
error: console.error,
};

this.onWsError = (error: Error) => {
this.logger?.error(error);
this.logger.error(error);

// Exit the process if it is running in node.
if (
typeof process !== "undefined" &&
typeof process.exit === "function"
) {
this.logger.error("Halting the process due to the websocket error");
process.exit(1);
} else {
this.logger.error(
"Cannot halt process. Please handle the websocket error."
);
}
};

this.wsEndpoint = makeWebsocketUrl(endpoint);
Expand Down Expand Up @@ -333,28 +354,28 @@ export class PriceServiceConnection {
binary: this.priceFeedRequestConfig.binary,
};

this.logger?.info("Resubscribing to existing price feeds.");
this.logger.info("Resubscribing to existing price feeds.");
this.wsClient?.send(JSON.stringify(message));
}
};

this.wsClient.onMessage = (data: WebSocket.Data) => {
this.logger?.info(`Received message ${data.toString()}`);
this.logger.info(`Received message ${data.toString()}`);

let message: ServerMessage;

try {
message = JSON.parse(data.toString()) as ServerMessage;
} catch (e: any) {
this.logger?.error(`Error parsing message ${data.toString()} as JSON.`);
this.logger?.error(e);
this.logger.error(`Error parsing message ${data.toString()} as JSON.`);
this.logger.error(e);
this.onWsError(e);
return;
}

if (message.type === "response") {
if (message.status === "error") {
this.logger?.error(
this.logger.error(
`Error response from the websocket server ${message.error}.`
);
this.onWsError(new Error(message.error));
Expand All @@ -364,10 +385,10 @@ export class PriceServiceConnection {
try {
priceFeed = PriceFeed.fromJson(message.price_feed);
} catch (e: any) {
this.logger?.error(
this.logger.error(
`Error parsing price feeds from message ${data.toString()}.`
);
this.logger?.error(e);
this.logger.error(e);
this.onWsError(e);
return;
}
Expand All @@ -378,7 +399,7 @@ export class PriceServiceConnection {
}
}
} else {
this.logger?.warn(
this.logger.warn(
`Ignoring unsupported server response ${data.toString()}.`
);
}
Expand Down
8 changes: 4 additions & 4 deletions price_service/server/docker-compose.mainnet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
spy:
# Find latest Guardian images in https://github.com/wormhole-foundation/wormhole/pkgs/container/guardiand
image: ghcr.io/wormhole-foundation/guardiand:v2.17.0
image: ghcr.io/wormhole-foundation/guardiand:v2.19.0
restart: on-failure
command:
- "spy"
Expand All @@ -17,7 +17,7 @@ services:
- "warn"
price-service:
# Find latest price service images https://gallery.ecr.aws/pyth-network/xc-server
image: public.ecr.aws/pyth-network/xc-server:v3.0.3
image: public.ecr.aws/pyth-network/xc-server:v3.0.8
restart: on-failure
# Or alternatively use a locally built image
# image: pyth_price_server
Expand All @@ -36,8 +36,8 @@ services:
]
REST_PORT: "4200"
PROM_PORT: "8081"
READINESS_SPY_SYNC_TIME_SECONDS: "20"
READINESS_NUM_LOADED_SYMBOLS: "50"
READINESS_SPY_SYNC_TIME_SECONDS: "5"
READINESS_NUM_LOADED_SYMBOLS: "280"
LOG_LEVEL: warning
WORMHOLE_CLUSTER: mainnet
DB_API_CLUSTER: pythnet
Expand Down
8 changes: 4 additions & 4 deletions price_service/server/docker-compose.testnet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
spy:
# Find latest Guardian images in https://github.com/wormhole-foundation/wormhole/pkgs/container/guardiand
image: ghcr.io/wormhole-foundation/guardiand:v2.17.0
image: ghcr.io/wormhole-foundation/guardiand:v2.19.0
restart: on-failure
command:
- "spy"
Expand All @@ -17,7 +17,7 @@ services:
- "warn"
price-service:
# Find latest price service images https://gallery.ecr.aws/pyth-network/xc-server
image: public.ecr.aws/pyth-network/xc-server:v3.0.3
image: public.ecr.aws/pyth-network/xc-server:v3.0.8
restart: on-failure
# Or alternatively use a locally built image
# image: pyth_price_server
Expand All @@ -36,8 +36,8 @@ services:
]
REST_PORT: "4200"
PROM_PORT: "8081"
READINESS_SPY_SYNC_TIME_SECONDS: "20"
READINESS_NUM_LOADED_SYMBOLS: "50"
READINESS_SPY_SYNC_TIME_SECONDS: "5"
READINESS_NUM_LOADED_SYMBOLS: "280"
LOG_LEVEL: warning
WORMHOLE_CLUSTER: testnet
DB_API_CLUSTER: devnet
Expand Down
2 changes: 1 addition & 1 deletion target_chains/cosmwasm/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-terra-js",
"version": "1.3.0",
"version": "1.3.1",
"description": "Pyth Network Terra Utils in JS",
"homepage": "https://pyth.network",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion target_chains/ethereum/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-evm-js",
"version": "1.20.0",
"version": "1.20.1",
"description": "Pyth Network EVM Utils in JS",
"homepage": "https://pyth.network",
"author": {
Expand Down