update config and worker

This commit is contained in:
smart_ex 2022-07-04 23:09:06 +10:00
parent 4edf32a76e
commit 0e1a9043be
5 changed files with 10 additions and 7 deletions

View File

@ -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 }}

View File

@ -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;

View File

@ -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 = () => {

View File

@ -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();

View File

@ -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();
}
}