Selaa lähdekoodia

Expose gas-price option for injective price pusher (#1185)

Amin Moghaddam 1 vuosi sitten
vanhempi
sitoutus
1be8a02b94

+ 4 - 2
package-lock.json

@@ -45,6 +45,7 @@
         "@pythnetwork/cosmwasm-deploy-tools": "*",
         "@pythnetwork/price-service-client": "*",
         "@pythnetwork/pyth-sui-js": "*",
+        "aptos": "^1.5.0",
         "bs58": "^5.0.0",
         "ts-node": "^10.9.1",
         "typescript": "^4.9.3"
@@ -54817,7 +54818,7 @@
     },
     "price_pusher": {
       "name": "@pythnetwork/price-pusher",
-      "version": "5.7.1",
+      "version": "6.1.0",
       "license": "Apache-2.0",
       "dependencies": {
         "@injectivelabs/sdk-ts": "1.10.72",
@@ -58001,7 +58002,7 @@
     },
     "target_chains/ethereum/entropy_sdk/solidity": {
       "name": "@pythnetwork/entropy-sdk-solidity",
-      "version": "0.1.0",
+      "version": "1.0.0",
       "license": "Apache-2.0",
       "devDependencies": {
         "prettier": "^2.7.1",
@@ -79628,6 +79629,7 @@
         "@pythnetwork/cosmwasm-deploy-tools": "*",
         "@pythnetwork/price-service-client": "*",
         "@pythnetwork/pyth-sui-js": "*",
+        "aptos": "^1.5.0",
         "bs58": "^5.0.0",
         "prettier": "^2.6.2",
         "ts-node": "^10.9.1",

+ 5 - 4
price_pusher/README.md

@@ -93,7 +93,7 @@ cd price_pusher
 npm run start -- evm --endpoint wss://example-rpc.com \
     --pyth-contract-address 0xff1a0f4744e8582DF...... \
     --price-service-endpoint https://example-hermes-rpc.com \
-    --price-config-file "path/to/price-config.testnet.sample.yaml" \
+    --price-config-file "path/to/price-config.beta.sample.yaml" \
     --mnemonic-file "path/to/mnemonic.txt" \
     [--pushing-frequency 10] \
     [--polling-frequency 5] \
@@ -102,9 +102,10 @@ npm run start -- evm --endpoint wss://example-rpc.com \
 # For Injective
 npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \
     --pyth-contract-address inj1z60tg0... --price-service-endpoint "https://example-hermes-rpc.com" \
-    --price-config-file "path/to/price-config.testnet.sample.yaml" \
+    --price-config-file "path/to/price-config.beta.sample.yaml" \
     --mnemonic-file "path/to/mnemonic.txt" \
     --network testnet \
+    [--gas-price 500000000] \
     [--pushing-frequency 10] \
     [--polling-frequency 5]
 
@@ -112,7 +113,7 @@ npm run start -- injective --grpc-endpoint https://grpc-endpoint.com \
 npm run start -- aptos --endpoint https://fullnode.testnet.aptoslabs.com/v1 \
     --pyth-contract-address 0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387 \
     --price-service-endpoint "https://example-hermes-rpc.com" \
-    --price-config-file "./price-config.testnet.sample.yaml" \
+    --price-config-file "path/to/price-config.beta.sample.yaml" \
     --mnemonic-file "path/to/mnemonic.txt" \
     [--pushing-frequency 10] \
     [--polling-frequency 5]
@@ -127,7 +128,7 @@ npm run start -- sui \
   --price-feed-to-price-info-object-table-id 0xf8929174008c662266a1adde78e1e8e33016eb7ad37d379481e860b911e40ed5 \
   --price-service-endpoint https://example-hermes-rpc.com \
   --mnemonic-file ./mnemonic \
-  --price-config-file ./price-config.testnet.sample.yaml \
+  --price-config-file ./price-config.beta.sample.yaml \
   [--pushing-frequency 10] \
   [--polling-frequency 5] \
   [--num-gas-objects 30]

+ 1 - 1
price_pusher/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/price-pusher",
-  "version": "6.0.0",
+  "version": "6.1.0",
   "description": "Pyth Price Pusher",
   "homepage": "https://pyth.network",
   "main": "lib/index.js",

+ 6 - 0
price_pusher/src/injective/command.ts

@@ -25,6 +25,10 @@ export default {
       type: "string",
       required: true,
     } as Options,
+    "gas-price": {
+      description: "Gas price to be used for each transasction",
+      type: "number",
+    } as Options,
     ...options.priceConfigFile,
     ...options.priceServiceEndpoint,
     ...options.mnemonicFile,
@@ -35,6 +39,7 @@ export default {
   handler: function (argv: any) {
     // FIXME: type checks for this
     const {
+      gasPrice,
       grpcEndpoint,
       priceConfigFile,
       priceServiceEndpoint,
@@ -87,6 +92,7 @@ export default {
       mnemonic,
       {
         chainId: getNetworkInfo(network).chainId,
+        gasPrice,
       }
     );