Skip to content

Commit ad864c6

Browse files
authored
[price-service] add /get_vaa endpoint that serves cache and db vaas (#482)
* add /get_vaa endpoint that serves cache and db vaas * update env vars * fix precommit errors * fix precommit errors * rename removeExpiredValuesFromVaasCache to runCacheCleanupLoop * move initialized envOrErr to constructor or func arg * use setInterval * update pyth-price-service env vars on tilt devnet * use undefined instead of null * use status code * make web-api an env var * update env var * fix precommit * fix precommit * fix changes * remove env vars from tilt-devnet * address changes * fix lint issues * fix linting issues again * bump package version * remove unused imports
1 parent 8b9682c commit ad864c6

File tree

11 files changed

+289
-62
lines changed

11 files changed

+289
-62
lines changed

third_party/pyth/price-service/.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ PROM_PORT=8081
1717

1818
# The default is to log with level info.
1919
#LOG_LEVEL=debug
20+
21+
REMOVE_EXPIRED_VALUES_INTERVAL_SECONDS=60
22+
CACHE_TTL_SECONDS=300

third_party/pyth/price-service/docker-compose.mainnet.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ services:
3737
READINESS_SPY_SYNC_TIME_SECONDS: "20"
3838
READINESS_NUM_LOADED_SYMBOLS: "50"
3939
LOG_LEVEL: warning
40+
DB_API_CLUSTER: pythnet
41+
REMOVE_EXPIRED_VALUES_INTERVAL_SECONDS: "60"
42+
CACHE_TTL_SECONDS: "300"
43+
DB_API_ENDPOINT: "https://web-api.pyth.network"
4044
healthcheck:
4145
test:
4246
[

third_party/pyth/price-service/docker-compose.testnet.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ services:
3737
READINESS_SPY_SYNC_TIME_SECONDS: "20"
3838
READINESS_NUM_LOADED_SYMBOLS: "50"
3939
LOG_LEVEL: warning
40+
DB_API_CLUSTER: devnet
41+
REMOVE_EXPIRED_VALUES_INTERVAL_SECONDS: "60"
42+
CACHE_TTL_SECONDS: "300"
43+
DB_API_ENDPOINT: "https://web-api.pyth.network"
4044
healthcheck:
4145
test:
4246
[

third_party/pyth/price-service/package-lock.json

Lines changed: 116 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third_party/pyth/price-service/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-price-service",
3-
"version": "2.2.4",
3+
"version": "2.3.0",
44
"description": "Pyth Price Service",
55
"main": "index.js",
66
"scripts": {
@@ -18,6 +18,7 @@
1818
"@types/jest": "^27.5.0",
1919
"@types/long": "^4.0.1",
2020
"@types/node": "^16.6.1",
21+
"@types/node-fetch": "^2.6.2",
2122
"@types/supertest": "^2.0.12",
2223
"jest": "^28.0.3",
2324
"prettier": "^2.3.2",
@@ -46,6 +47,7 @@
4647
"joi": "^17.6.0",
4748
"lru-cache": "^7.14.1",
4849
"morgan": "^1.10.0",
50+
"node-fetch": "^2.6.1",
4951
"prom-client": "^14.0.1",
5052
"response-time": "^2.3.2",
5153
"winston": "^3.3.3",

0 commit comments

Comments
 (0)