mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2025-08-22 04:29:35 -04:00
wip
This commit is contained in:
parent
3c5eaa2c4b
commit
4595085d61
58 changed files with 17604 additions and 1070 deletions
51
src/config.ts
Normal file
51
src/config.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { jobType } from './types';
|
||||
import tornConfig from 'torn-token';
|
||||
import { EnsResolver } from './modules';
|
||||
import { getProvider } from './modules/contracts';
|
||||
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
|
||||
export const netId = Number(process.env.NET_ID) || 1;
|
||||
export const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379';
|
||||
export const httpRpcUrl = process.env.HTTP_RPC_URL;
|
||||
export const wsRpcUrl = process.env.WS_RPC_URL;
|
||||
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;
|
||||
export const minerMerkleTreeHeight = 20;
|
||||
export const privateKey = process.env.PRIVATE_KEY;
|
||||
export const instances = tornConfig.instances;
|
||||
export const torn = tornConfig;
|
||||
export const port = process.env.APP_PORT || 8000;
|
||||
export const tornadoServiceFee = Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE);
|
||||
export const miningServiceFee = Number(process.env.MINING_SERVICE_FEE);
|
||||
export const rewardAccount = process.env.REWARD_ACCOUNT;
|
||||
export const governanceAddress = '0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce';
|
||||
export const tornadoGoerliProxy = '0x454d870a72e29d5E5697f635128D18077BD04C60';
|
||||
export const gasLimits = {
|
||||
[jobType.TORNADO_WITHDRAW]: 390000,
|
||||
WITHDRAW_WITH_EXTRA: 700000,
|
||||
[jobType.MINING_REWARD]: 455000,
|
||||
[jobType.MINING_WITHDRAW]: 400000,
|
||||
};
|
||||
export const minimumBalance = '1000000000000000000';
|
||||
export const baseFeeReserve = Number(process.env.BASE_FEE_RESERVE_PERCENTAGE);
|
||||
|
||||
let tornadoProxyAddress: string;
|
||||
let tornadoMiningAddress: string;
|
||||
|
||||
export const initConfig = async () => {
|
||||
const provider = getProvider();
|
||||
const resolver = new EnsResolver(provider);
|
||||
if (netId === 5) {
|
||||
tornadoProxyAddress = tornadoGoerliProxy;
|
||||
} else {
|
||||
tornadoProxyAddress = await resolver.resolve(torn.tornadoRouter.address);
|
||||
}
|
||||
tornadoMiningAddress = await resolver.resolve(torn.miningV2.address);
|
||||
};
|
||||
|
||||
export { tornadoProxyAddress, tornadoMiningAddress };
|
Loading…
Add table
Add a link
Reference in a new issue