Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stash/app-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env_variables:
MGX_AIRDROP_SNAPSHOTS: '0x8de8328944b57a0fae7b6780d98c8d98e31a8539a393b64e299a38db0f200edf,0x90f9f232b2a8e142a5b268effa53aa47963739dfa73a893962a42f67be60e282,0xf15d54a960d662978f6ece06fb8d345101bc0aa9e474c857e83c2fc8396e112c'
TOKENS_TO_HARDCODE: '11'
MINUTES_FOR_TOKEN_REFRESH: '1440'
SAVE_EVENTS: false

manual_scaling:
instances: 1
Expand Down
1 change: 1 addition & 0 deletions stash/app-holesky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ env_variables:
MGX_AIRDROP_SNAPSHOTS: '0x8de8328944b57a0fae7b6780d98c8d98e31a8539a393b64e299a38db0f200edf,0x90f9f232b2a8e142a5b268effa53aa47963739dfa73a893962a42f67be60e282,0xf15d54a960d662978f6ece06fb8d345101bc0aa9e474c857e83c2fc8396e112c'
TOKENS_TO_HARDCODE: ''
MINUTES_FOR_TOKEN_REFRESH: '5'
SAVE_EVENTS: false

manual_scaling:
instances: 1
Expand Down
1 change: 1 addition & 0 deletions stash/app-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env_variables:
MGX_AIRDROP_SNAPSHOTS: '0x8de8328944b57a0fae7b6780d98c8d98e31a8539a393b64e299a38db0f200edf,0x90f9f232b2a8e142a5b268effa53aa47963739dfa73a893962a42f67be60e282,0xf15d54a960d662978f6ece06fb8d345101bc0aa9e474c857e83c2fc8396e112c'
TOKENS_TO_HARDCODE: '8,9,2,6,12'
MINUTES_FOR_TOKEN_REFRESH: '5'
SAVE_EVENTS: true

manual_scaling:
instances: 1
Expand Down
1 change: 1 addition & 0 deletions stash/app-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env_variables:
MGX_AIRDROP_SNAPSHOTS: '0x8de8328944b57a0fae7b6780d98c8d98e31a8539a393b64e299a38db0f200edf,0x90f9f232b2a8e142a5b268effa53aa47963739dfa73a893962a42f67be60e282,0xf15d54a960d662978f6ece06fb8d345101bc0aa9e474c857e83c2fc8396e112c'
TOKENS_TO_HARDCODE: ''
MINUTES_FOR_TOKEN_REFRESH: '5'
SAVE_EVENTS: false

manual_scaling:
instances: 1
Expand Down
1 change: 1 addition & 0 deletions stash/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASS: ${REDIS_PASS} # Has to be empty to work with local redis host
TOKENS_TO_HARDCODE: ${TOKENS_TO_HARDCODE:-0}
SAVE_EVENTS: ${SAVE_EVENTS:-false}

redis:
image: gaspxyz/redis-stash-test-data:stable
Expand Down
2 changes: 1 addition & 1 deletion stash/src/repository/ChainRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { redis } from '../connector/RedisConnector.js'
import { Event } from '../scraper/BlockScraper.js'
import logger from '../util/Logger.js'

const PREFIX = 'chain:'
const PREFIX = '{chain}:'
const PREFIX_POOL = PREFIX + 'pool:'
const KEY_ASSETS = PREFIX + 'assets'
const KEY_EVENTS = PREFIX + 'events'
Expand Down
4 changes: 2 additions & 2 deletions stash/src/repository/PriceRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import logger from '../util/Logger.js'
import { API_LIMIT } from '../util/Misc.js'
import * as redisUtil from '../util/Redis.js'

const PREFIX = 'price:asset:'
const PREFIX_LATEST = 'price:pool:latest:'
const PREFIX = '{price}:asset:'
const PREFIX_LATEST = '{price}:pool:latest:'

const keyPrice = (id: number | string) => PREFIX + id
const keyLatest = (id: number | string) => PREFIX_LATEST + id
Expand Down
4 changes: 3 additions & 1 deletion stash/src/service/SyncBlockService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const initService = async () => {
// const latestBlock = 3719278
await blocks.withBlocks(api, latestBlock, async (block) => {
try {
await blocks.processEvents(block)
if (process.env.SAVE_EVENTS === 'true') {
await blocks.processEvents(block)
}
await withdrawals.processWithdrawalEvents(api, block)
await deposits.processFerriedDepositEvents(api, block)
await pools.fetchPools(block)
Expand Down
Loading