Skip to content

Commit f7b7fd1

Browse files
committed
feat: chunk broadcasting support
1 parent 05b7928 commit f7b7fd1

File tree

5 files changed

+453
-414
lines changed

5 files changed

+453
-414
lines changed

apps/price_pusher/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ pnpm run start injective --grpc-endpoint https://grpc-endpoint.com \
114114
--network testnet \
115115
[--gas-price 160000000] \
116116
[--gas-multiplier 1.1] \
117+
[--priceIds-process-chunk-size 100] \
117118
[--pushing-frequency 10] \
118119
[--polling-frequency 5]
119120

apps/price_pusher/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
},
6161
"dependencies": {
6262
"@coral-xyz/anchor": "^0.30.0",
63-
"@injectivelabs/networks": "^1.14.6",
64-
"@injectivelabs/sdk-ts": "1.10.72",
63+
"@injectivelabs/networks": "1.14.47",
64+
"@injectivelabs/utils": "^1.14.47",
65+
"@injectivelabs/sdk-ts": "1.14.49",
6566
"@mysten/sui": "^1.3.0",
6667
"@pythnetwork/hermes-client": "^1.3.1",
6768
"@pythnetwork/price-service-sdk": "workspace:^",

apps/price_pusher/src/injective/command.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ export default {
2727
required: true,
2828
} as Options,
2929
"gas-price": {
30-
description: "Gas price to be used for each transasction",
30+
description: "Gas price to be used for each transaction",
3131
type: "number",
3232
} as Options,
3333
"gas-multiplier": {
34-
description: "Gas multiplier to be used for each transasction",
34+
description: "Gas multiplier to be used for each transaction",
3535
type: "number",
3636
} as Options,
37+
"price-ids-process-chunk-size": {
38+
description: "Set in case we wanna split price feeds updates into chunks to have smaller transactions. Set to -1 to disable chunking.",
39+
type: "number",
40+
required: false
41+
} as Options,
3742
...options.priceConfigFile,
3843
...options.priceServiceEndpoint,
3944
...options.mnemonicFile,
@@ -46,18 +51,19 @@ export default {
4651
handler: async function (argv: any) {
4752
// FIXME: type checks for this
4853
const {
54+
network,
55+
logLevel,
4956
gasPrice,
50-
gasMultiplier,
5157
grpcEndpoint,
52-
priceConfigFile,
53-
priceServiceEndpoint,
5458
mnemonicFile,
55-
pythContractAddress,
56-
pushingFrequency,
59+
gasMultiplier,
60+
priceConfigFile,
5761
pollingFrequency,
58-
network,
59-
logLevel,
62+
pushingFrequency,
6063
controllerLogLevel,
64+
pythContractAddress,
65+
priceServiceEndpoint,
66+
priceIdsProcessChunkSize,
6167
} = argv;
6268

6369
const logger = pino({ level: logLevel });
@@ -111,6 +117,7 @@ export default {
111117
chainId: getNetworkInfo(network).chainId,
112118
gasPrice,
113119
gasMultiplier,
120+
priceIdsProcessChunkSize
114121
},
115122
);
116123

0 commit comments

Comments
 (0)