mirror of
https://github.com/tornadocash/tornado-relayer
synced 2024-02-02 15:04:06 +01:00
tx-manager conf from env
This commit is contained in:
parent
8649a5d258
commit
a4fdadafd7
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@ -20,12 +20,13 @@ jobs:
|
|||||||
- run: yarn lint
|
- run: yarn lint
|
||||||
- name: Telegram Failure Notification
|
- name: Telegram Failure Notification
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
if: failure()
|
# TODO if: failure()
|
||||||
with:
|
# if: failure()
|
||||||
message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }}
|
# with:
|
||||||
format: markdown
|
# message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }}
|
||||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
# format: markdown
|
||||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
# to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||||
|
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||||
# TODO: Edit this step
|
# TODO: Edit this step
|
||||||
# publish:
|
# publish:
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
@ -8,6 +8,8 @@ export const netId = <availableIds>Number(process.env.NET_ID || 1);
|
|||||||
export const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379';
|
export const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379';
|
||||||
export const rpcUrl = process.env.HTTP_RPC_URL;
|
export const rpcUrl = process.env.HTTP_RPC_URL;
|
||||||
export const CONFIRMATIONS = Number(process.env.CONFIRMATIONS) || 4;
|
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.ORACLE_RPC_URL || 'https://mainnet.infura.io/';
|
||||||
export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb';
|
export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb';
|
||||||
export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca';
|
export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca';
|
||||||
|
@ -40,13 +40,13 @@ export class NotifierService {
|
|||||||
private telegram: Telegram | MockTelegram;
|
private telegram: Telegram | MockTelegram;
|
||||||
private readonly token: string;
|
private readonly token: string;
|
||||||
private readonly chatId: string;
|
private readonly chatId: string;
|
||||||
prefix: string;
|
host: string;
|
||||||
|
|
||||||
constructor(private store: RedisStore, private config: ConfigService) {
|
constructor(private store: RedisStore, private config: ConfigService) {
|
||||||
this.token = process.env.TELEGRAM_NOTIFIER_BOT_TOKEN;
|
this.token = process.env.TELEGRAM_NOTIFIER_BOT_TOKEN;
|
||||||
this.chatId = process.env.TELEGRAM_NOTIFIER_CHAT_ID;
|
this.chatId = process.env.TELEGRAM_NOTIFIER_CHAT_ID;
|
||||||
this.telegram = this.token ? new Telegram(this.token) : new MockTelegram();
|
this.telegram = this.token ? new Telegram(this.token) : new MockTelegram();
|
||||||
this.prefix = this.config.host;
|
this.host = this.config.host;
|
||||||
}
|
}
|
||||||
|
|
||||||
async processAlert(message: string) {
|
async processAlert(message: string) {
|
||||||
@ -72,7 +72,7 @@ export class NotifierService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
send(message: string, level: Levels) {
|
send(message: string, level: Levels) {
|
||||||
const text = `${AlertLevel[level]} ${this.prefix}: ${message}`;
|
const text = `${AlertLevel[level]} ${this.host}: ${message}`;
|
||||||
return this.telegram.sendMessage(this.chatId, text, { parse_mode: 'HTML' });
|
return this.telegram.sendMessage(this.chatId, text, { parse_mode: 'HTML' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { Provider } from '@ethersproject/providers';
|
|||||||
import { formatEther, parseUnits } from 'ethers/lib/utils';
|
import { formatEther, parseUnits } from 'ethers/lib/utils';
|
||||||
import { BigNumber, BigNumberish, BytesLike } from 'ethers';
|
import { BigNumber, BigNumberish, BytesLike } from 'ethers';
|
||||||
import { ProxyLightABI, TornadoProxyABI } from '../contracts';
|
import { ProxyLightABI, TornadoProxyABI } from '../contracts';
|
||||||
import { CONFIRMATIONS, gasLimits, tornadoServiceFee } from '../config';
|
import { BASE_FEE_RESERVE_PERCENTAGE, CONFIRMATIONS, gasLimits, MAX_GAS_PRICE, tornadoServiceFee } from '../config';
|
||||||
import { JobStatus, RelayerJobType } from '../types';
|
import { JobStatus, RelayerJobType } from '../types';
|
||||||
import { PriceService } from './price.service';
|
import { PriceService } from './price.service';
|
||||||
import { Job } from 'bullmq';
|
import { Job } from 'bullmq';
|
||||||
@ -47,7 +47,7 @@ export class TxService {
|
|||||||
this.txManager = new TxManager({
|
this.txManager = new TxManager({
|
||||||
privateKey,
|
privateKey,
|
||||||
rpcUrl,
|
rpcUrl,
|
||||||
config: { THROW_ON_REVERT: true, CONFIRMATIONS },
|
config: { THROW_ON_REVERT: true, CONFIRMATIONS, MAX_GAS_PRICE, BASE_FEE_RESERVE_PERCENTAGE },
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
});
|
});
|
||||||
this.oracle = new GasPriceOracle({
|
this.oracle = new GasPriceOracle({
|
||||||
|
Loading…
Reference in New Issue
Block a user