Skip to content

Commit e248be5

Browse files
author
Dev Kalra
authored
fix (#793)
1 parent 71632fa commit e248be5

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

price_pusher/config.injective.testnet.sample.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"pyth-contract-address": "inj1z60tg0tekdzcasenhuuwq3htjcd5slmgf7gpez",
44
"price-service-endpoint": "https://xc-testnet.pyth.network",
55
"mnemonic-file": "./mnemonic",
6-
"price-config-file": "./price-config.testnet.sample.yaml"
6+
"price-config-file": "./price-config.testnet.sample.yaml",
7+
"network": "testnet"
78
}

price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "4.1.2",
3+
"version": "5.0.0",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

price_pusher/src/injective/command.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { InjectivePriceListener, InjectivePricePusher } from "./injective";
66
import { PythPriceListener } from "../pyth-price-listener";
77
import { Controller } from "../controller";
88
import { Options } from "yargs";
9+
import { getNetworkInfo } from "@injectivelabs/networks";
910

1011
export default {
1112
command: "injective",
@@ -19,6 +20,11 @@ export default {
1920
type: "string",
2021
required: true,
2122
} as Options,
23+
network: {
24+
description: "testnet or mainnet",
25+
type: "string",
26+
required: true,
27+
} as Options,
2228
...options.priceConfigFile,
2329
...options.priceServiceEndpoint,
2430
...options.mnemonicFile,
@@ -36,8 +42,13 @@ export default {
3642
pythContractAddress,
3743
pushingFrequency,
3844
pollingFrequency,
45+
network,
3946
} = argv;
4047

48+
if (network !== "testnet" && network !== "mainnet") {
49+
throw new Error("Please specify network. One of [testnet, mainnet]");
50+
}
51+
4152
const priceConfigs = readPriceConfigFile(priceConfigFile);
4253
const priceServiceConnection = new PriceServiceConnection(
4354
priceServiceEndpoint,
@@ -73,7 +84,10 @@ export default {
7384
priceServiceConnection,
7485
pythContractAddress,
7586
grpcEndpoint,
76-
mnemonic
87+
mnemonic,
88+
{
89+
chainId: getNetworkInfo(network).chainId,
90+
}
7791
);
7892

7993
const controller = new Controller(

0 commit comments

Comments
 (0)