@pythnetwork/price-pusher 6.7.0 → 7.0.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +26 -14
  2. package/lib/aptos/aptos.d.ts +5 -2
  3. package/lib/aptos/aptos.d.ts.map +1 -1
  4. package/lib/aptos/aptos.js +19 -19
  5. package/lib/aptos/command.d.ts +3 -0
  6. package/lib/aptos/command.d.ts.map +1 -1
  7. package/lib/aptos/command.js +12 -14
  8. package/lib/controller.d.ts +3 -1
  9. package/lib/controller.d.ts.map +1 -1
  10. package/lib/controller.js +11 -4
  11. package/lib/evm/command.d.ts +3 -0
  12. package/lib/evm/command.d.ts.map +1 -1
  13. package/lib/evm/command.js +14 -16
  14. package/lib/evm/custom-gas-station.d.ts +4 -2
  15. package/lib/evm/custom-gas-station.d.ts.map +1 -1
  16. package/lib/evm/custom-gas-station.js +7 -6
  17. package/lib/evm/evm.d.ts +7 -3
  18. package/lib/evm/evm.d.ts.map +1 -1
  19. package/lib/evm/evm.js +25 -24
  20. package/lib/index.js +3 -0
  21. package/lib/injective/command.d.ts +3 -0
  22. package/lib/injective/command.d.ts.map +1 -1
  23. package/lib/injective/command.js +11 -13
  24. package/lib/injective/injective.d.ts +5 -2
  25. package/lib/injective/injective.d.ts.map +1 -1
  26. package/lib/injective/injective.js +22 -22
  27. package/lib/interface.d.ts +1 -2
  28. package/lib/interface.d.ts.map +1 -1
  29. package/lib/interface.js +1 -4
  30. package/lib/near/command.d.ts +3 -0
  31. package/lib/near/command.d.ts.map +1 -1
  32. package/lib/near/command.js +14 -13
  33. package/lib/near/near.d.ts +5 -2
  34. package/lib/near/near.d.ts.map +1 -1
  35. package/lib/near/near.js +19 -17
  36. package/lib/options.d.ts +9 -0
  37. package/lib/options.d.ts.map +1 -1
  38. package/lib/options.js +28 -1
  39. package/lib/price-config.d.ts +2 -1
  40. package/lib/price-config.d.ts.map +1 -1
  41. package/lib/price-config.js +4 -6
  42. package/lib/pyth-price-listener.d.ts +3 -1
  43. package/lib/pyth-price-listener.d.ts.map +1 -1
  44. package/lib/pyth-price-listener.js +4 -2
  45. package/lib/solana/command.d.ts +5 -1
  46. package/lib/solana/command.d.ts.map +1 -1
  47. package/lib/solana/command.js +16 -18
  48. package/lib/solana/solana.d.ts +9 -5
  49. package/lib/solana/solana.d.ts.map +1 -1
  50. package/lib/solana/solana.js +42 -39
  51. package/lib/sui/command.d.ts +4 -0
  52. package/lib/sui/command.d.ts.map +1 -1
  53. package/lib/sui/command.js +18 -14
  54. package/lib/sui/sui.d.ts +6 -3
  55. package/lib/sui/sui.d.ts.map +1 -1
  56. package/lib/sui/sui.js +36 -30
  57. package/package.json +21 -11
package/README.md CHANGED
@@ -83,14 +83,14 @@ To run the price pusher, please run the following commands, replacing the comman
83
83
 
84
84
  ```sh
85
85
  # Please run the two following commands once from the root of the repo to build the code.
86
- npm install
87
- npx lerna run build --scope @pythnetwork/price-pusher --include-dependencies
86
+ pnpm install
87
+ pnpm exec lerna run build --scope @pythnetwork/price-pusher --include-dependencies
88
88
 
89
89
  # Navigate to the price_pusher folder
90
90
  cd apps/price_pusher
91
91
 
92
92
  # For EVM
93
- npm run start -- evm --endpoint wss://example-rpc.com \
93
+ pnpm run start evm --endpoint wss://example-rpc.com \
94
94
  --pyth-contract-address 0xff1a0f4744e8582DF...... \
95
95
  --price-service-endpoint https://example-hermes-rpc.com \
96
96
  --price-config-file "path/to/price-config.beta.sample.yaml" \
@@ -100,7 +100,7 @@ npm run start -- evm --endpoint wss://example-rpc.com \
100
100
  [--override-gas-price-multiplier 1.1]
101
101
 
102
102
  # For Injective
103
- npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \
103
+ pnpm run start injective --grpc-endpoint https://grpc-endpoint.com \
104
104
  --pyth-contract-address inj1z60tg0... --price-service-endpoint "https://example-hermes-rpc.com" \
105
105
  --price-config-file "path/to/price-config.beta.sample.yaml" \
106
106
  --mnemonic-file "path/to/mnemonic.txt" \
@@ -110,7 +110,7 @@ npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \
110
110
  [--polling-frequency 5]
111
111
 
112
112
  # For Aptos
113
- npm run start -- aptos --endpoint https://fullnode.testnet.aptoslabs.com/v1 \
113
+ pnpm run start aptos --endpoint https://fullnode.testnet.aptoslabs.com/v1 \
114
114
  --pyth-contract-address 0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387 \
115
115
  --price-service-endpoint "https://example-hermes-rpc.com" \
116
116
  --price-config-file "path/to/price-config.beta.sample.yaml" \
@@ -119,7 +119,7 @@ npm run start -- aptos --endpoint https://fullnode.testnet.aptoslabs.com/v1 \
119
119
  [--polling-frequency 5]
120
120
 
121
121
  # For Sui
122
- npm run start -- sui \
122
+ pnpm run start sui \
123
123
  --endpoint https://sui-testnet-rpc.allthatnode.com \
124
124
  --pyth-package-id 0x975e063f398f720af4f33ec06a927f14ea76ca24f7f8dd544aa62ab9d5d15f44 \
125
125
  --pyth-state-id 0xd8afde3a48b4ff7212bd6829a150f43f59043221200d63504d981f62bff2e27a \
@@ -134,7 +134,7 @@ npm run start -- sui \
134
134
  [--num-gas-objects 30]
135
135
 
136
136
  # For Near
137
- npm run start -- near \
137
+ pnpm run start near \
138
138
  --node-url https://rpc.testnet.near.org \
139
139
  --network testnet \
140
140
  --account-id payer.testnet \
@@ -146,7 +146,7 @@ npm run start -- near \
146
146
  [--polling-frequency 5]
147
147
 
148
148
  # For Solana, using Jito (recommended)
149
- npm run start -- solana \
149
+ pnpm run start solana \
150
150
  --endpoint https://api.mainnet-beta.solana.com \
151
151
  --keypair-file ./id.json \
152
152
  --shard-id 1 \
@@ -161,7 +161,7 @@ npm run start -- solana \
161
161
  [--polling-frequency 5]
162
162
 
163
163
  # For Solana, using Solana RPC
164
- npm run start -- solana \
164
+ pnpm run start solana \
165
165
  --endpoint https://api.devnet.solana.com \
166
166
  --keypair-file ./id.json \
167
167
  --shard-id 1 \
@@ -184,23 +184,35 @@ docker run public.ecr.aws/pyth-network/xc-price-pusher:v<version> -- <above-argu
184
184
  To know more about the arguments the price-pusher accepts. You can run:
185
185
 
186
186
  ```sh
187
- npm run start -- --help
187
+ pnpm run start --help
188
188
 
189
189
  # for specific network run
190
- npm run start -- {network} --help
190
+ pnpm run start {network} --help
191
191
  ```
192
192
 
193
+ ### Logging
194
+
195
+ By default, the logging is set to `info`. You can change the logging level by passing the argument `--log-level` with the desired level.
196
+ The available levels are `error`, `warn`, `info`, `debug`, and `trace`. Also, the logs have JSON format. If you wish to run the code with
197
+ human-readable logs, you can pipe the output of the program to `pino-pretty`. See the example below for more information on how to do this.
198
+
199
+ You can configure the log level of some of the modules of the price pusher as well. The available modules are PriceServiceConnection, which
200
+ is responsible for connecting to the Hermes price service, and Controller, which is responsible for checking the prices from the Hermes
201
+ and the on-chain Pyth contract and deciding whether to push a new price. You can configure the log level of these modules by passing the
202
+ `--price-service-connection-log-level` and `--controller-log-level` arguments, respectively.
203
+
193
204
  ### Example
194
205
 
195
206
  For example, to push `BTC/USD` and `BNB/USD` prices on Fantom testnet, run the following command:
196
207
 
197
208
  ```sh
198
- npm run dev -- evm \
209
+ pnpm run dev evm \
199
210
  --endpoint https://endpoints.omniatech.io/v1/fantom/testnet/public \
200
211
  --pyth-contract-address 0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb \
201
212
  --price-service-endpoint https://hermes.pyth.network \
202
213
  --mnemonic-file "./mnemonic" \
203
- --price-config-file "./price-config.stable.sample.yaml"
214
+ --price-config-file "./price-config.stable.sample.yaml" \
215
+ | pnpm exec pino-pretty # Make logs human-readable
204
216
  ```
205
217
 
206
218
  [`price-config.stable.sample.yaml`](./price-config.stable.sample.yaml) contains configuration for `BTC/USD`
@@ -210,7 +222,7 @@ contains the same configuration for `BTC/USD` and `BNB/USD` on Pyth beta data so
210
222
  You can also provide a config file instead of providing command line options, run the following command:
211
223
 
212
224
  ```sh
213
- npm run start -- injective --config "./config.injective.sample.json"
225
+ pnpm run start injective --config "./config.injective.sample.json"
214
226
  ```
215
227
 
216
228
  [`config.injective.sample.json`](./config.injective.sample.json) contains configuration to publish on Injective testnet.
@@ -1,10 +1,12 @@
1
1
  import { ChainPriceListener, IPricePusher, PriceInfo, PriceItem } from "../interface";
2
2
  import { DurationInSeconds } from "../utils";
3
3
  import { PriceServiceConnection } from "@pythnetwork/price-service-client";
4
+ import { Logger } from "pino";
4
5
  export declare class AptosPriceListener extends ChainPriceListener {
5
6
  private pythModule;
6
7
  private endpoint;
7
- constructor(pythModule: string, endpoint: string, priceItems: PriceItem[], config: {
8
+ private logger;
9
+ constructor(pythModule: string, endpoint: string, priceItems: PriceItem[], logger: Logger, config: {
8
10
  pollingFrequency: DurationInSeconds;
9
11
  });
10
12
  getOnChainPriceInfo(priceId: string): Promise<PriceInfo | undefined>;
@@ -22,13 +24,14 @@ export declare const APTOS_ACCOUNT_HD_PATH = "m/44'/637'/0'/0'/0'";
22
24
  */
23
25
  export declare class AptosPricePusher implements IPricePusher {
24
26
  private priceServiceConnection;
27
+ private logger;
25
28
  private pythContractAddress;
26
29
  private endpoint;
27
30
  private mnemonic;
28
31
  private overrideGasPriceMultiplier;
29
32
  private lastSequenceNumber;
30
33
  private sequenceNumberLocked;
31
- constructor(priceServiceConnection: PriceServiceConnection, pythContractAddress: string, endpoint: string, mnemonic: string, overrideGasPriceMultiplier: number);
34
+ constructor(priceServiceConnection: PriceServiceConnection, logger: Logger, pythContractAddress: string, endpoint: string, mnemonic: string, overrideGasPriceMultiplier: number);
32
35
  /**
33
36
  * Gets price update data which then can be submitted to the Pyth contract to update the prices.
34
37
  * This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price ids)
@@ -1 +1 @@
1
- {"version":3,"file":"aptos.d.ts","sourceRoot":"","sources":["../../src/aptos/aptos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEt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I,CAAC;YAkEF,8BAA8B;YAwB9B,wBAAwB;CA+BvC"}
@@ -6,10 +6,12 @@ const aptos_1 = require("aptos");
6
6
  class AptosPriceListener extends interface_1.ChainPriceListener {
7
7
  pythModule;
8
8
  endpoint;
9
- constructor(pythModule, endpoint, priceItems, config) {
10
- super("aptos", config.pollingFrequency, priceItems);
9
+ logger;
10
+ constructor(pythModule, endpoint, priceItems, logger, config) {
11
+ super(config.pollingFrequency, priceItems);
11
12
  this.pythModule = pythModule;
12
13
  this.endpoint = endpoint;
14
+ this.logger = logger;
13
15
  }
14
16
  async getOnChainPriceInfo(priceId) {
15
17
  try {
@@ -27,16 +29,15 @@ class AptosPriceListener extends interface_1.ChainPriceListener {
27
29
  });
28
30
  const multiplier = priceItemRes.price_feed.price.price.negative === true ? -1 : 1;
29
31
  const price = multiplier * Number(priceItemRes.price_feed.price.price.magnitude);
30
- console.log(`Polled an Aptos on-chain price for feed ${this.priceIdToAlias.get(priceId)} (${priceId}).`);
32
+ this.logger.debug(`Polled an Aptos on-chain price for feed ${this.priceIdToAlias.get(priceId)} (${priceId}).`);
31
33
  return {
32
34
  price: price.toString(),
33
35
  conf: priceItemRes.price_feed.price.conf,
34
36
  publishTime: Number(priceItemRes.price_feed.price.timestamp),
35
37
  };
36
38
  }
37
- catch (e) {
38
- console.error(`Polling Aptos on-chain price for ${priceId} failed. Error:`);
39
- console.error(e);
39
+ catch (err) {
40
+ this.logger.error(err, `Polling Aptos on-chain price for ${priceId} failed.`);
40
41
  return undefined;
41
42
  }
42
43
  }
@@ -56,6 +57,7 @@ exports.APTOS_ACCOUNT_HD_PATH = "m/44'/637'/0'/0'/0'";
56
57
  */
57
58
  class AptosPricePusher {
58
59
  priceServiceConnection;
60
+ logger;
59
61
  pythContractAddress;
60
62
  endpoint;
61
63
  mnemonic;
@@ -64,8 +66,9 @@ class AptosPricePusher {
64
66
  lastSequenceNumber;
65
67
  // If true, we are trying to fetch the most recent sequence number from the blockchain.
66
68
  sequenceNumberLocked;
67
- constructor(priceServiceConnection, pythContractAddress, endpoint, mnemonic, overrideGasPriceMultiplier) {
69
+ constructor(priceServiceConnection, logger, pythContractAddress, endpoint, mnemonic, overrideGasPriceMultiplier) {
68
70
  this.priceServiceConnection = priceServiceConnection;
71
+ this.logger = logger;
69
72
  this.pythContractAddress = pythContractAddress;
70
73
  this.endpoint = endpoint;
71
74
  this.mnemonic = mnemonic;
@@ -95,9 +98,8 @@ class AptosPricePusher {
95
98
  // get the latest VAAs for updatePriceFeed and then push them
96
99
  priceFeedUpdateData = await this.getPriceFeedsUpdateData(priceIds);
97
100
  }
98
- catch (e) {
99
- console.error("Error fetching the latest vaas to push");
100
- console.error(e);
101
+ catch (err) {
102
+ this.logger.error(err, "Error fetching the latest vaas to push.");
101
103
  return;
102
104
  }
103
105
  try {
@@ -113,7 +115,7 @@ class AptosPricePusher {
113
115
  });
114
116
  const signedTx = await client.signTransaction(account, rawTx);
115
117
  const pendingTx = await client.submitTransaction(signedTx);
116
- console.log("Successfully broadcasted txHash:", pendingTx.hash);
118
+ this.logger.debug({ hash: pendingTx.hash }, "Successfully broadcasted tx.");
117
119
  // Sometimes broadcasted txs don't make it on-chain and they cause our sequence number
118
120
  // to go out of sync. Missing transactions are rare and we don't want this check to block
119
121
  // the next price update. So we use spawn a promise without awaiting on it to wait for the
@@ -121,9 +123,8 @@ class AptosPricePusher {
121
123
  this.waitForTransactionConfirmation(client, pendingTx.hash);
122
124
  return;
123
125
  }
124
- catch (e) {
125
- console.error("Error executing messages");
126
- console.error(e);
126
+ catch (err) {
127
+ this.logger.error(err, "Error executing messages");
127
128
  // Reset the sequence number to re-sync it (in case that was the issue)
128
129
  this.lastSequenceNumber = undefined;
129
130
  return;
@@ -136,11 +137,10 @@ class AptosPricePusher {
136
137
  checkSuccess: true,
137
138
  timeoutSecs: 10,
138
139
  });
139
- console.log(`Transaction with txHash "${txHash}" confirmed.`);
140
+ this.logger.info({ hash: txHash }, `Transaction confirmed.`);
140
141
  }
141
- catch (e) {
142
- console.error(`Transaction with txHash "${txHash}" failed to confirm.`);
143
- console.error(e);
142
+ catch (err) {
143
+ this.logger.error({ err, hash: txHash }, `Transaction failed to confirm.`);
144
144
  this.lastSequenceNumber = undefined;
145
145
  }
146
146
  }
@@ -160,7 +160,7 @@ class AptosPricePusher {
160
160
  try {
161
161
  this.sequenceNumberLocked = true;
162
162
  this.lastSequenceNumber = Number((await client.getAccount(account.address())).sequence_number);
163
- console.log(`Fetched account sequence number: ${this.lastSequenceNumber}`);
163
+ this.logger.debug(`Fetched account sequence number: ${this.lastSequenceNumber}`);
164
164
  return this.lastSequenceNumber;
165
165
  }
166
166
  catch (e) {
@@ -3,6 +3,9 @@ declare const _default: {
3
3
  command: string;
4
4
  describe: string;
5
5
  builder: {
6
+ "controller-log-level": Options;
7
+ "price-service-connection-log-level": Options;
8
+ "log-level": Options;
6
9
  "pushing-frequency": Options;
7
10
  "polling-frequency": Options;
8
11
  "pyth-contract-address": Options;
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/aptos/command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;oBAkCL,GAAG;;AA1B9B,wBA2FE"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/aptos/command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;oBAsCL,GAAG;;AA7B9B,wBAqGE"}
@@ -34,6 +34,7 @@ const pyth_price_listener_1 = require("../pyth-price-listener");
34
34
  const controller_1 = require("../controller");
35
35
  const aptos_1 = require("./aptos");
36
36
  const aptos_2 = require("aptos");
37
+ const pino_1 = __importDefault(require("pino"));
37
38
  exports.default = {
38
39
  command: "aptos",
39
40
  describe: "run price pusher for aptos",
@@ -57,29 +58,26 @@ exports.default = {
57
58
  ...options.pythContractAddress,
58
59
  ...options.pollingFrequency,
59
60
  ...options.pushingFrequency,
61
+ ...options.logLevel,
62
+ ...options.priceServiceConnectionLogLevel,
63
+ ...options.controllerLogLevel,
60
64
  },
61
65
  handler: function (argv) {
62
66
  // FIXME: type checks for this
63
- const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, overrideGasPriceMultiplier, } = argv;
67
+ const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, overrideGasPriceMultiplier, logLevel, priceServiceConnectionLogLevel, controllerLogLevel, } = argv;
68
+ const logger = (0, pino_1.default)({ level: logLevel });
64
69
  const priceConfigs = (0, price_config_1.readPriceConfigFile)(priceConfigFile);
65
70
  const priceServiceConnection = new price_service_client_1.PriceServiceConnection(priceServiceEndpoint, {
66
- logger: {
67
- // Log only warnings and errors from the price service client
68
- info: () => undefined,
69
- warn: console.warn,
70
- error: console.error,
71
- debug: () => undefined,
72
- trace: () => undefined,
73
- },
71
+ logger: logger.child({ module: "PriceServiceConnection" }, { level: priceServiceConnectionLogLevel }),
74
72
  });
75
73
  const mnemonic = fs_1.default.readFileSync(mnemonicFile, "utf-8").trim();
76
74
  const account = aptos_2.AptosAccount.fromDerivePath(aptos_1.APTOS_ACCOUNT_HD_PATH, mnemonic);
77
- console.log(`Pushing from account address: ${account.address()}`);
75
+ logger.info(`Pushing from account address: ${account.address()}`);
78
76
  const priceItems = priceConfigs.map(({ id, alias }) => ({ id, alias }));
79
- const pythListener = new pyth_price_listener_1.PythPriceListener(priceServiceConnection, priceItems);
80
- const aptosListener = new aptos_1.AptosPriceListener(pythContractAddress, endpoint, priceItems, { pollingFrequency });
81
- const aptosPusher = new aptos_1.AptosPricePusher(priceServiceConnection, pythContractAddress, endpoint, mnemonic, overrideGasPriceMultiplier);
82
- const controller = new controller_1.Controller(priceConfigs, pythListener, aptosListener, aptosPusher, { pushingFrequency });
77
+ const pythListener = new pyth_price_listener_1.PythPriceListener(priceServiceConnection, priceItems, logger.child({ module: "PythPriceListener" }));
78
+ const aptosListener = new aptos_1.AptosPriceListener(pythContractAddress, endpoint, priceItems, logger.child({ module: "AptosPriceListener" }), { pollingFrequency });
79
+ const aptosPusher = new aptos_1.AptosPricePusher(priceServiceConnection, logger.child({ module: "AptosPricePusher" }), pythContractAddress, endpoint, mnemonic, overrideGasPriceMultiplier);
80
+ const controller = new controller_1.Controller(priceConfigs, pythListener, aptosListener, aptosPusher, logger.child({ module: "Controller" }, { level: controllerLogLevel }), { pushingFrequency });
83
81
  controller.start();
84
82
  },
85
83
  };
@@ -1,13 +1,15 @@
1
1
  import { DurationInSeconds } from "./utils";
2
2
  import { IPriceListener, IPricePusher } from "./interface";
3
3
  import { PriceConfig } from "./price-config";
4
+ import { Logger } from "pino";
4
5
  export declare class Controller {
5
6
  private priceConfigs;
6
7
  private sourcePriceListener;
7
8
  private targetPriceListener;
8
9
  private targetChainPricePusher;
10
+ private logger;
9
11
  private pushingFrequency;
10
- constructor(priceConfigs: PriceConfig[], sourcePriceListener: IPriceListener, targetPriceListener: IPriceListener, targetChainPricePusher: IPricePusher, config: {
12
+ constructor(priceConfigs: PriceConfig[], sourcePriceListener: IPriceListener, targetPriceListener: IPriceListener, targetChainPricePusher: IPricePusher, logger: Logger, config: {
11
13
  pushingFrequency: DurationInSeconds;
12
14
  });
13
15
  start(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAS,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAiC,MAAM,gBAAgB,CAAC;AAE5E,qBAAa,UAAU;IAGnB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,sBAAsB;IALhC,OAAO,CAAC,gBAAgB,CAAoB;gBAElC,YAAY,EAAE,WAAW,EAAE,EAC3B,mBAAmB,EAAE,cAAc,EACnC,mBAAmB,EAAE,cAAc,EACnC,sBAAsB,EAAE,YAAY,EAC5C,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IAKG,KAAK;CA2DZ"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAS,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAiC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,qBAAa,UAAU;IAGnB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,MAAM;IANhB,OAAO,CAAC,gBAAgB,CAAoB;gBAElC,YAAY,EAAE,WAAW,EAAE,EAC3B,mBAAmB,EAAE,cAAc,EACnC,mBAAmB,EAAE,cAAc,EACnC,sBAAsB,EAAE,YAAY,EACpC,MAAM,EAAE,MAAM,EACtB,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IAKG,KAAK;CAgEZ"}
package/lib/controller.js CHANGED
@@ -8,12 +8,14 @@ class Controller {
8
8
  sourcePriceListener;
9
9
  targetPriceListener;
10
10
  targetChainPricePusher;
11
+ logger;
11
12
  pushingFrequency;
12
- constructor(priceConfigs, sourcePriceListener, targetPriceListener, targetChainPricePusher, config) {
13
+ constructor(priceConfigs, sourcePriceListener, targetPriceListener, targetChainPricePusher, logger, config) {
13
14
  this.priceConfigs = priceConfigs;
14
15
  this.sourcePriceListener = sourcePriceListener;
15
16
  this.targetPriceListener = targetPriceListener;
16
17
  this.targetChainPricePusher = targetChainPricePusher;
18
+ this.logger = logger;
17
19
  this.pushingFrequency = config.pushingFrequency;
18
20
  }
19
21
  async start() {
@@ -34,7 +36,7 @@ class Controller {
34
36
  const priceId = priceConfig.id;
35
37
  const targetLatestPrice = this.targetPriceListener.getLatestPriceInfo(priceId);
36
38
  const sourceLatestPrice = this.sourcePriceListener.getLatestPriceInfo(priceId);
37
- const priceShouldUpdate = (0, price_config_1.shouldUpdate)(priceConfig, sourceLatestPrice, targetLatestPrice);
39
+ const priceShouldUpdate = (0, price_config_1.shouldUpdate)(priceConfig, sourceLatestPrice, targetLatestPrice, this.logger);
38
40
  if (priceShouldUpdate == price_config_1.UpdateCondition.YES) {
39
41
  pushThresholdMet = true;
40
42
  }
@@ -45,13 +47,18 @@ class Controller {
45
47
  }
46
48
  }
47
49
  if (pushThresholdMet) {
48
- console.log("Some of the above values passed the threshold. Will push the price.");
50
+ this.logger.info({
51
+ priceIds: pricesToPush.map((priceConfig) => ({
52
+ id: priceConfig.id,
53
+ alias: priceConfig.alias,
54
+ })),
55
+ }, "Some of the checks triggered pushing update. Will push the updates for some feeds.");
49
56
  // note that the priceIds are without leading "0x"
50
57
  const priceIds = pricesToPush.map((priceConfig) => priceConfig.id);
51
58
  this.targetChainPricePusher.updatePriceFeed(priceIds, pubTimesToPush);
52
59
  }
53
60
  else {
54
- console.log("None of the above values passed the threshold. No push needed.");
61
+ this.logger.info("None of the checks were triggered. No push needed.");
55
62
  }
56
63
  await (0, utils_1.sleep)(this.pushingFrequency * 1000);
57
64
  }
@@ -3,6 +3,9 @@ declare const _default: {
3
3
  command: string;
4
4
  describe: string;
5
5
  builder: {
6
+ "controller-log-level": Options;
7
+ "price-service-connection-log-level": Options;
8
+ "log-level": Options;
6
9
  "pushing-frequency": Options;
7
10
  "polling-frequency": Options;
8
11
  "pyth-contract-address": Options;
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/evm/command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;oBAqEL,GAAG;;AAjE9B,wBA8IE"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/evm/command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;oBA6EL,GAAG;;AApE9B,wBA+JE"}
@@ -27,13 +27,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const price_service_client_1 = require("@pythnetwork/price-service-client");
30
+ const fs_1 = __importDefault(require("fs"));
30
31
  const options = __importStar(require("../options"));
31
32
  const price_config_1 = require("../price-config");
32
- const fs_1 = __importDefault(require("fs"));
33
33
  const pyth_price_listener_1 = require("../pyth-price-listener");
34
34
  const controller_1 = require("../controller");
35
35
  const evm_1 = require("./evm");
36
36
  const custom_gas_station_1 = require("./custom-gas-station");
37
+ const pino_1 = __importDefault(require("pino"));
37
38
  exports.default = {
38
39
  command: "evm",
39
40
  describe: "run price pusher for evm",
@@ -92,34 +93,31 @@ exports.default = {
92
93
  ...options.pythContractAddress,
93
94
  ...options.pollingFrequency,
94
95
  ...options.pushingFrequency,
96
+ ...options.logLevel,
97
+ ...options.priceServiceConnectionLogLevel,
98
+ ...options.controllerLogLevel,
95
99
  },
96
100
  handler: function (argv) {
97
101
  // FIXME: type checks for this
98
- const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, customGasStation, txSpeed, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, gasLimit, updateFeeMultiplier, } = argv;
102
+ const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, customGasStation, txSpeed, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, gasLimit, updateFeeMultiplier, logLevel, priceServiceConnectionLogLevel, controllerLogLevel, } = argv;
103
+ const logger = (0, pino_1.default)({ level: logLevel });
99
104
  const priceConfigs = (0, price_config_1.readPriceConfigFile)(priceConfigFile);
100
105
  const priceServiceConnection = new price_service_client_1.PriceServiceConnection(priceServiceEndpoint, {
101
- logger: {
102
- // Log only warnings and errors from the price service client
103
- info: () => undefined,
104
- warn: console.warn,
105
- error: console.error,
106
- debug: () => undefined,
107
- trace: () => undefined,
108
- },
106
+ logger: logger.child({ module: "PriceServiceConnection" }, { level: priceServiceConnectionLogLevel }),
109
107
  });
110
108
  const mnemonic = fs_1.default.readFileSync(mnemonicFile, "utf-8").trim();
111
109
  const priceItems = priceConfigs.map(({ id, alias }) => ({ id, alias }));
112
- const pythListener = new pyth_price_listener_1.PythPriceListener(priceServiceConnection, priceItems);
110
+ const pythListener = new pyth_price_listener_1.PythPriceListener(priceServiceConnection, priceItems, logger.child({ module: "PythPriceListener" }));
113
111
  const pythContractFactory = new evm_1.PythContractFactory(endpoint, mnemonic, pythContractAddress);
114
- console.log(`Pushing updates from wallet address: ${pythContractFactory
112
+ logger.info(`Pushing updates from wallet address: ${pythContractFactory
115
113
  .createWeb3PayerProvider()
116
114
  .getAddress()}`);
117
- const evmListener = new evm_1.EvmPriceListener(pythContractFactory, priceItems, {
115
+ const evmListener = new evm_1.EvmPriceListener(pythContractFactory, priceItems, logger.child({ module: "EvmPriceListener" }), {
118
116
  pollingFrequency,
119
117
  });
120
- const gasStation = (0, custom_gas_station_1.getCustomGasStation)(customGasStation, txSpeed);
121
- const evmPusher = new evm_1.EvmPricePusher(priceServiceConnection, pythContractFactory, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, updateFeeMultiplier, gasLimit, gasStation);
122
- const controller = new controller_1.Controller(priceConfigs, pythListener, evmListener, evmPusher, { pushingFrequency });
118
+ const gasStation = (0, custom_gas_station_1.getCustomGasStation)(logger.child({ module: "CustomGasStation" }), customGasStation, txSpeed);
119
+ const evmPusher = new evm_1.EvmPricePusher(priceServiceConnection, pythContractFactory, logger.child({ module: "EvmPricePusher" }), overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, updateFeeMultiplier, gasLimit, gasStation);
120
+ const controller = new controller_1.Controller(priceConfigs, pythListener, evmListener, evmPusher, logger.child({ module: "Controller" }, { level: controllerLogLevel }), { pushingFrequency });
123
121
  controller.start();
124
122
  },
125
123
  };
@@ -1,10 +1,12 @@
1
+ import { Logger } from "pino";
1
2
  export declare class CustomGasStation {
2
3
  private chain;
3
4
  private speed;
4
5
  private chainMethods;
5
- constructor(chain: number, speed: string);
6
+ private logger;
7
+ constructor(logger: Logger, chain: number, speed: string);
6
8
  getCustomGasPrice(): Promise<string | undefined>;
7
9
  private fetchMaticMainnetGasPrice;
8
10
  }
9
- export declare function getCustomGasStation(customGasStation?: number, txSpeed?: string): CustomGasStation | undefined;
11
+ export declare function getCustomGasStation(logger: Logger, customGasStation?: number, txSpeed?: string): CustomGasStation | undefined;
10
12
  //# sourceMappingURL=custom-gas-station.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-gas-station.d.ts","sourceRoot":"","sources":["../../src/evm/custom-gas-station.ts"],"names":[],"mappings":"AAWA,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,YAAY,CAElB;gBACU,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKlC,iBAAiB;YAIT,yBAAyB;CAexC;AAED,wBAAgB,mBAAmB,CACjC,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,MAAM,gCAKjB"}
1
+ {"version":3,"file":"custom-gas-station.d.ts","sourceRoot":"","sources":["../../src/evm/custom-gas-station.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAI9B,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,YAAY,CAElB;IACF,OAAO,CAAC,MAAM,CAAS;gBACX,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAMlD,iBAAiB;YAIT,yBAAyB;CAexC;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,MAAM,gCAKjB"}
@@ -12,7 +12,9 @@ class CustomGasStation {
12
12
  chainMethods = {
13
13
  137: this.fetchMaticMainnetGasPrice.bind(this),
14
14
  };
15
- constructor(chain, speed) {
15
+ logger;
16
+ constructor(logger, chain, speed) {
17
+ this.logger = logger;
16
18
  this.speed = (0, utils_1.verifyValidOption)(speed, utils_1.txSpeeds);
17
19
  this.chain = (0, utils_1.verifyValidOption)(chain, utils_1.customGasChainIds);
18
20
  }
@@ -27,17 +29,16 @@ class CustomGasStation {
27
29
  const gweiGasPrice = web3_1.default.utils.toWei(gasPrice.toFixed(2), "Gwei");
28
30
  return gweiGasPrice.toString();
29
31
  }
30
- catch (e) {
31
- console.error("Failed to fetch gas price from Matic mainnet. Returning undefined");
32
- console.error(e);
32
+ catch (err) {
33
+ this.logger.error(err, "Failed to fetch gas price from Matic mainnet. Returning undefined");
33
34
  return undefined;
34
35
  }
35
36
  }
36
37
  }
37
38
  exports.CustomGasStation = CustomGasStation;
38
- function getCustomGasStation(customGasStation, txSpeed) {
39
+ function getCustomGasStation(logger, customGasStation, txSpeed) {
39
40
  if (customGasStation && txSpeed) {
40
- return new CustomGasStation(customGasStation, txSpeed);
41
+ return new CustomGasStation(logger, customGasStation, txSpeed);
41
42
  }
42
43
  }
43
44
  exports.getCustomGasStation = getCustomGasStation;
package/lib/evm/evm.d.ts CHANGED
@@ -2,12 +2,15 @@ import { Contract } from "web3-eth-contract";
2
2
  import { IPricePusher, PriceInfo, ChainPriceListener, PriceItem } from "../interface";
3
3
  import { DurationInSeconds } from "../utils";
4
4
  import HDWalletProvider from "@truffle/hdwallet-provider";
5
+ import { HttpProvider, WebsocketProvider } from "web3-core";
6
+ import { Logger } from "pino";
5
7
  import { PriceServiceConnection, HexString, UnixTimestamp } from "@pythnetwork/price-service-client";
6
8
  import { CustomGasStation } from "./custom-gas-station";
7
9
  export declare class EvmPriceListener extends ChainPriceListener {
8
10
  private pythContractFactory;
9
11
  private pythContract;
10
- constructor(pythContractFactory: PythContractFactory, priceItems: PriceItem[], config: {
12
+ private logger;
13
+ constructor(pythContractFactory: PythContractFactory, priceItems: PriceItem[], logger: Logger, config: {
11
14
  pollingFrequency: DurationInSeconds;
12
15
  });
13
16
  start(): Promise<void>;
@@ -17,6 +20,7 @@ export declare class EvmPriceListener extends ChainPriceListener {
17
20
  }
18
21
  export declare class EvmPricePusher implements IPricePusher {
19
22
  private connection;
23
+ private logger;
20
24
  private overrideGasPriceMultiplier;
21
25
  private overrideGasPriceMultiplierCap;
22
26
  private updateFeeMultiplier;
@@ -26,7 +30,7 @@ export declare class EvmPricePusher implements IPricePusher {
26
30
  private web3;
27
31
  private pusherAddress;
28
32
  private lastPushAttempt;
29
- constructor(connection: PriceServiceConnection, pythContractFactory: PythContractFactory, overrideGasPriceMultiplier: number, overrideGasPriceMultiplierCap: number, updateFeeMultiplier: number, gasLimit?: number | undefined, customGasStation?: CustomGasStation);
33
+ constructor(connection: PriceServiceConnection, pythContractFactory: PythContractFactory, logger: Logger, overrideGasPriceMultiplier: number, overrideGasPriceMultiplierCap: number, updateFeeMultiplier: number, gasLimit?: number | undefined, customGasStation?: CustomGasStation);
30
34
  updatePriceFeed(priceIds: string[], pubTimesToPush: UnixTimestamp[]): Promise<void>;
31
35
  private getPriceFeedsUpdateData;
32
36
  }
@@ -51,7 +55,7 @@ export declare class PythContractFactory {
51
55
  */
52
56
  createPythContract(): Contract;
53
57
  hasWebsocketProvider(): boolean;
54
- createWeb3Provider(): import("web3-core").HttpProvider | import("web3-core").WebsocketProvider;
58
+ createWeb3Provider(): HttpProvider | WebsocketProvider;
55
59
  createWeb3PayerProvider(): HDWalletProvider;
56
60
  }
57
61
  //# sourceMappingURL=evm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../src/evm/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAgB,iBAAiB,EAAmB,MAAM,UAAU,CAAC;AAE5E,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EACL,sBAAsB,EACtB,SAAS,EACT,aAAa,EACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,YAAY,CAAW;gBAG7B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IAUG,KAAK;YAeG,iBAAiB;IAc/B,OAAO,CAAC,iBAAiB;IAsBnB,mBAAmB,CACvB,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CAwBlC;AAED,qBAAa,cAAe,YAAW,YAAY;IAQ/C,OAAO,CAAC,UAAU;IAElB,OAAO,CAAC,0BAA0B;IAClC,OAAO,CAAC,6BAA6B;IACrC,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,QAAQ,CAAC;IAZnB,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,YAAY,CAAW;IAC/B,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC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