From 6dd9c8662d8fe05600e5eec2dba0956428482477 Mon Sep 17 00:00:00 2001 From: poma Date: Sat, 26 Oct 2019 21:16:31 +0300 Subject: [PATCH] update readme, code cleanup --- Dockerfile | 3 +-- README.md | 29 ++++++++++++----------------- docker-compose.yml | 7 ------- frontend/docker-compose.yml | 23 ----------------------- index.js | 5 ++--- 5 files changed, 15 insertions(+), 52 deletions(-) delete mode 100644 frontend/docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 59576c7..1982521 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM node:11 WORKDIR /app COPY package.json package-lock.json ./ -RUN npm install - +RUN npm install && npm cache clean --force COPY . . EXPOSE 8000 diff --git a/README.md b/README.md index dd804ef..44f2043 100644 --- a/README.md +++ b/README.md @@ -12,29 +12,24 @@ Relayer should return a transaction hash. ## Proof example ```json { - "pi_a":[ + "contract": "0xf15f151CEf196E4a2dC28De496811e435552E93e", + "proof": { + "proof":[ "0x0ed9b1afc791a551f5baa2f84786963b1463ca3f7c68eb0de3b267e6cb491f05", - "0x1335f2af3c71e442fd82f63f8f1c605ca2612b8d0fa22b4cbd1239cca839aa3d" - ], - "pi_b":[ - [ - "0x000189f7f1067a768d116cd86980eae6963dd9bc6c1f8204ceacf90a94f60d81", - "0x1abb4b71da0efa67cbc76a97ac360826b17a88f07bd89151258bf076474a4804" - ], - [ - "0x0526b509ba2cda2b21b09401d70d23ea0225be4fdaa9097af842ff6783d1e0f4", - "0x15b11f9f5441adeea61534105902170a409b228e159fe7428abf6e863fc05273" - ] - ], - "pi_c":[ + "0x1335f2af3c71e442fd82f63f8f1c605ca2612b8d0fa22b4cbd1239cca839aa3d", + "0x1abb4b71da0efa67cbc76a97ac360826b17a88f07bd89151258bf076474a4804", + "0x000189f7f1067a768d116cd86980eae6963dd9bc6c1f8204ceacf90a94f60d81", + "0x15b11f9f5441adeea61534105902170a409b228e159fe7428abf6e863fc05273", + "0x0526b509ba2cda2b21b09401d70d23ea0225be4fdaa9097af842ff6783d1e0f4", "0x2cd9a2305827f7da64aa1a3136c11ae1d3d7b3cb69832d8c04ab39d8b9393cda", "0x2090cd3f9d09d66ca4e1e9bed2c72d5fa174b47599cb47e572324b1a98a3cb7a" - ], - "publicSignals":[ + ], + "publicSignals":[ "0x1e8a85160889dfb5c03a8e2a6cca18b4c476c0b486003e9ed666a33e04114658", "0x00bfb0befe19eac571ecaf7858e50d70273fbe2952cc8431f59399bb28665796", "0x00000000000000000000000003ebd0748aa4d1457cf479cce56309641e0a98f5", "0x0000000000000000000000000000000000000000000000000000000000000000" - ] + ] + }, } ``` diff --git a/docker-compose.yml b/docker-compose.yml index 0159a4d..42325f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,6 @@ services: LETSENCRYPT_HOST: kovan.tornado.cash env_file: ./.env - monitor: - image: arefaslani/docker-telegram-notifier - restart: always - volumes: - - /var/run/docker.sock:/var/run/docker.sock - env_file: ./.env - networks: default: external: diff --git a/frontend/docker-compose.yml b/frontend/docker-compose.yml deleted file mode 100644 index c2bd757..0000000 --- a/frontend/docker-compose.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: '2' - -services: - - nginx: - image: jwilder/nginx-proxy - restart: always - ports: - - 80:80 - - 443:443 - volumes: - - /var/run/docker.sock:/tmp/docker.sock:ro - - /etc/nginx/certs - - /etc/nginx/vhost.d - - /usr/share/nginx/html - - letsencrypt: - image: jrcs/letsencrypt-nginx-proxy-companion - restart: always - volumes_from: - - nginx - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro \ No newline at end of file diff --git a/index.js b/index.js index e128374..38aa3bd 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,6 @@ const { numberToHex, toWei, toHex, toBN, toChecksumAddress } = require('web3-utils') +const { netId, rpcUrl, privateKey, mixers, defaultGasPrice } = require('./config') +const { fetchGasPrice, isValidProof, fetchDAIprice, isKnownContract } = require('./utils') const Web3 = require('web3') const express = require('express') @@ -20,9 +22,6 @@ app.use(function(req, res, next) { next() }) -const { netId, rpcUrl, privateKey, mixers, defaultGasPrice } = require('./config') -const { fetchGasPrice, isValidProof, fetchDAIprice, isKnownContract } = require('./utils') - const web3 = new Web3(rpcUrl, null, { transactionConfirmationBlocks: 1 }) const account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) web3.eth.accounts.wallet.add('0x' + privateKey)