feat: add env baseFeeReserve variable

This commit is contained in:
Danil Kovtonyuk 2021-09-08 17:37:49 +10:00
parent 82e5f4ee70
commit 8f5b673f3b
4 changed files with 10 additions and 1 deletions

View File

@ -20,4 +20,5 @@ CONFIRMATIONS=4
# in GWEI # in GWEI
MAX_GAS_PRICE=1000 MAX_GAS_PRICE=1000
BASE_FEE_RESERVE_PERCENTAGE=25
AGGREGATOR=0x8cb1436F64a3c33aD17bb42F94e255c4c0E871b2 AGGREGATOR=0x8cb1436F64a3c33aD17bb42F94e255c4c0E871b2

View File

@ -46,6 +46,7 @@ wget https://raw.githubusercontent.com/tornadocash/tornado-relayer/master/.env.e
- update `AGGREGATOR` if needed - Contract address of aggregator instance. - update `AGGREGATOR` if needed - Contract address of aggregator instance.
- update `CONFIRMATIONS` if needed - how many block confirmations to wait before processing an event. Not recommended to set less than 3 - update `CONFIRMATIONS` if needed - how many block confirmations to wait before processing an event. Not recommended to set less than 3
- update `MAX_GAS_PRICE` if needed - maximum value of gwei value for relayer's transaction - update `MAX_GAS_PRICE` if needed - maximum value of gwei value for relayer's transaction
- update `BASE_FEE_RESERVE_PERCENTAGE` if needed - how much in % will the network baseFee increase
If you want to use more than 1 eth address for relaying transactions, please add as many `workers` as you want. For example, you can comment out `worker2` in docker-compose.yml file, but please use a different `PRIVATE_KEY` for each worker. If you want to use more than 1 eth address for relaying transactions, please add as many `workers` as you want. For example, you can comment out `worker2` in docker-compose.yml file, but please use a different `PRIVATE_KEY` for each worker.

View File

@ -26,4 +26,5 @@ module.exports = {
[jobType.MINING_WITHDRAW]: 400000, [jobType.MINING_WITHDRAW]: 400000,
}, },
minimumBalance: '1000000000000000000', minimumBalance: '1000000000000000000',
baseFeeReserve: Number(process.env.BASE_FEE_RESERVE_PERCENTAGE),
} }

View File

@ -22,6 +22,7 @@ const {
privateKey, privateKey,
httpRpcUrl, httpRpcUrl,
oracleRpcUrl, oracleRpcUrl,
baseFeeReserve,
miningServiceFee, miningServiceFee,
tornadoServiceFee, tornadoServiceFee,
tornadoGoerliProxy, tornadoGoerliProxy,
@ -79,7 +80,12 @@ async function start() {
txManager = new TxManager({ txManager = new TxManager({
privateKey, privateKey,
rpcUrl: httpRpcUrl, rpcUrl: httpRpcUrl,
config: { CONFIRMATIONS, MAX_GAS_PRICE, THROW_ON_REVERT: false, BASE_FEE_RESERVE_PERCENTAGE: 25 }, config: {
CONFIRMATIONS,
MAX_GAS_PRICE,
THROW_ON_REVERT: false,
BASE_FEE_RESERVE_PERCENTAGE: baseFeeReserve,
},
}) })
swap = new web3.eth.Contract(swapABI, await resolver.resolve(torn.rewardSwap.address)) swap = new web3.eth.Contract(swapABI, await resolver.resolve(torn.rewardSwap.address))
minerContract = new web3.eth.Contract(miningABI, await resolver.resolve(torn.miningV2.address)) minerContract = new web3.eth.Contract(miningABI, await resolver.resolve(torn.miningV2.address))