diff --git a/src/server.js b/src/server.js index 4b3ef25..5c85ea3 100644 --- a/src/server.js +++ b/src/server.js @@ -34,5 +34,5 @@ app.post('/relay', controller.tornadoWithdraw) // app.post('/v1/miningWithdraw', controller.miningWithdraw) worker.start() -app.listen(port || 8000) -console.log(`Relayer ${version} started on port ${port || 8000}`) +app.listen(port) +console.log(`Relayer ${version} started on port ${port}`) diff --git a/src/worker.js b/src/worker.js index 861b96e..9964d8a 100644 --- a/src/worker.js +++ b/src/worker.js @@ -30,12 +30,9 @@ async function fetchTree() { } async function start() { - web3 = new Web3(rpcUrl, null, { transactionConfirmationBlocks: 1 }) - const account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) - web3.eth.accounts.wallet.add('0x' + privateKey) - web3.eth.defaultAccount = account.address - updateConfig({ rewardAccount: account.address }) + web3 = new Web3(rpcUrl) txManager = new TxManager({ privateKey, rpcUrl }) + updateConfig({ rewardAccount: txManager.address }) queue.process(process) redisSubscribe.subscribe('treeUpdate', fetchTree) await fetchTree()