diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5f2d50..3696d7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,8 @@ jobs: - run: yarn install --network-concurrency=2 # - run: yarn test - run: yarn lint - - name: Telegram Failure Notification - uses: appleboy/telegram-action@master -# TODO if: failure() +# - name: Telegram Failure Notification +# uses: appleboy/telegram-action@master # if: failure() # with: # message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} diff --git a/src/config.ts b/src/config.ts index ab0379c..df9f070 100644 --- a/src/config.ts +++ b/src/config.ts @@ -12,7 +12,8 @@ export const rpcUrl = process.env.HTTP_RPC_URL; export const CONFIRMATIONS = Number(process.env.CONFIRMATIONS) || 4; export const MAX_GAS_PRICE = Number(process.env.MAX_GAS_PRICE) || 1000; export const BASE_FEE_RESERVE_PERCENTAGE = Number(process.env.BASE_FEE_RESERVE_PERCENTAGE) || 25; -export const mainnetRpcUrl = process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/'; +export const mainnetRpcUrl = process.env.MAINNET_RPC_URL || process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/'; +export const oracleRpcUrl = process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/'; export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb'; export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca'; export const aggregatorAddress = process.env.AGGREGATOR; diff --git a/src/modules/contracts.ts b/src/modules/contracts.ts index e17cc3e..824461c 100644 --- a/src/modules/contracts.ts +++ b/src/modules/contracts.ts @@ -6,7 +6,7 @@ import { TornadoProxyABI__factory, } from '../contracts'; import { providers } from 'ethers'; -import { mainnetRpcUrl, multiCallAddress, netId, offchainOracleAddress, rpcUrl } from '../config'; +import { mainnetRpcUrl, multiCallAddress, netId, offchainOracleAddress, oracleRpcUrl, rpcUrl } from '../config'; export function getProvider(isStatic = true, customRpcUrl?: string, chainId = netId) { const url = customRpcUrl || rpcUrl; @@ -22,7 +22,7 @@ export const getTornadoProxyLightContract = (proxyAddress: string) => { }; export const getOffchainOracleContract = () => { - return OffchainOracleAbi__factory.connect(offchainOracleAddress, getProvider(true, mainnetRpcUrl)); + return OffchainOracleAbi__factory.connect(offchainOracleAddress, getProvider(true, oracleRpcUrl)); }; export const getMultiCallContract = () => { diff --git a/src/queue/worker.ts b/src/queue/worker.ts index 165a9c8..41ded48 100644 --- a/src/queue/worker.ts +++ b/src/queue/worker.ts @@ -4,6 +4,7 @@ import { configService, getHealthService } from '../services'; export const priceWorker = async () => { await configService.init(); + if (configService.isLightMode) return; const healthService = getHealthService(); const price = new PriceQueueHelper(); diff --git a/src/services/job.service.ts b/src/services/job.service.ts index ee35c8e..db19179 100644 --- a/src/services/job.service.ts +++ b/src/services/job.service.ts @@ -48,7 +48,9 @@ export class JobService { } async setupRepeatableJobs() { - await this.price.addRepeatable(this.config.tokens); + if (!this.config.isLightMode) { + await this.price.addRepeatable(this.config.tokens); + } await this.health.addRepeatable(); } }