diff --git a/Dockerfile b/Dockerfile index e1ea4ed..0e0aba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ FROM node:12 WORKDIR /app -COPY package.json package-lock.json ./ -RUN npm install && npm cache clean --force +COPY package.json yarn.lock ./ +RUN yarn && yarn cache clean --force COPY . . EXPOSE 8000 -HEALTHCHECK CMD curl -f http://localhost:8000/status -CMD ["npm", "run", "start"] +# HEALTHCHECK CMD curl -f http://localhost:8000/status +ENTRYPOINT ["yarn"] +CMD ["server"] diff --git a/docker-compose.yml b/docker-compose.yml index 4398985..7cec4b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: kovan: image: tornadocash/relayer restart: always + command: server environment: VIRTUAL_HOST: example.duckdns.org LETSENCRYPT_HOST: example.duckdns.org @@ -20,24 +21,26 @@ services: depends_on: - redis - mainnet: + tree-monitor: image: tornadocash/relayer restart: always + command: tree-monitor environment: - VIRTUAL_HOST: example2.duckdns.org - LETSENCRYPT_HOST: example2.duckdns.org - NET_ID: 1 - RPC_URL: https://mainnet.infura.io - # ORACLE_RPC_URL should always point to the mainnet - ORACLE_RPC_URL: https://mainnet.infura.io - # without 0x prefix - PRIVATE_KEY: - # 2.5 means 2.5% - RELAYER_FEE: 2.5 - REDIS_URL: redis://redis/1 - nginx_proxy_read_timeout: 600 - depends_on: - - redis + qwe: ads + + worker1: + image: tornadocash/relayer + restart: always + command: worker + environment: + PRIVATE_KEY: qwe + + worker2: + image: tornadocash/relayer + restart: always + command: worker + environment: + PRIVATE_KEY: qwe redis: image: redis diff --git a/package.json b/package.json index 9156753..aec01de 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,12 @@ "gas-price-oracle": "^0.1.5", "ioredis": "^4.14.1", "node-fetch": "^2.6.0", - "snarkjs": "git+https://github.com/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5", "tornado-cash-anonymity-mining": "git+https://github.com/tornadocash/tornado-anonymity-mining.git#e3ae8b98b14eb7fee7cb8c93221920a20b1e0cd8", "tx-manager": "git+https://github.com/tornadocash/tx-manager.git#df118be318b007e597e157504d105dfa3e6322a1", "uuid": "^8.3.0", "web3": "^1.3.0", "web3-core-promievent": "^1.3.0", "web3-utils": "^1.2.2", - "websnark": "git+https://github.com/tornadocash/websnark.git#86a526718cd6f6f5d31bdb1fe26a9ec8819f633e", "why-is-node-running": "^2.2.0" }, "devDependencies": { diff --git a/src/worker.js b/src/worker.js index bbb7e90..3cecd77 100644 --- a/src/worker.js +++ b/src/worker.js @@ -89,7 +89,7 @@ async function checkTornadoFee({ args, contract }) { async function checkMiningFee({ args }) { const swap = new web3.eth.Contract(swapABI, swapAddress) - const TornAmount = await swap.getExpectedReturn(args.fee).call() + const TornAmount = await swap.methods.getExpectedReturn(args.fee).call() console.log('TornAmount', TornAmount) // todo: use desired torn/eth rate and compute the same way as in tornado