@@ -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
86
+ pnpm install
87
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.
0 commit comments