fix: update docker

This commit is contained in:
nikdementev 2021-05-05 20:43:32 +03:00
parent a632aafb8c
commit 1e823711b3
No known key found for this signature in database
GPG Key ID: 769B05D57CF16FE2
7 changed files with 35 additions and 11 deletions

View File

@ -10,8 +10,9 @@ APP_PORT=8000
# Gas price in Gwei
GAS_PRICE=200
# should not be more often than CONFIRMATION_BLOCKS time. default is once per hour
CRON_EXPRESSION="0 0 * * * *"
VIRTUAL_HOST=example.duckdns.org
LETSENCRYPT_HOST=example.duckdns.org
CONFIRMATION_BLOCKS=1

View File

@ -2,7 +2,8 @@ version: '2'
services:
app:
image: tornadocash/tornado-root-updater:goerli
# image: tornadocash/tornado-root-updater:server
build: .
depends_on: [redis]
restart: always
env_file: .env
@ -31,6 +32,26 @@ services:
logging:
driver: none
dockergen:
image: poma/docker-gen
container_name: dockergen
restart: always
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: always
environment:
NGINX_DOCKER_GEN_CONTAINER: dockergen
volumes_from:
- nginx
- dockergen
volumes:
conf:
vhost:

View File

@ -7,7 +7,7 @@
"server": "node src/server.js",
"treeWatcher": "node src/treeWatcher",
"lint": "eslint --ext .js --ignore-path .gitignore .",
"start": "yarn server & yarn treeWatcher"
"start": "yarn server"
},
"keywords": [],
"author": "Roman Semenov <semenov.roma@gmail.com>",

View File

@ -14,5 +14,4 @@ module.exports = {
port: process.env.APP_PORT || 8000,
insertBatchSize: process.env.INSERT_BATCH_SIZE,
gasPrice: process.env.GAS_PRICE,
cronExpression: process.env.CRON_EXPRESSION,
}

View File

@ -14,7 +14,15 @@ async function getDepositsCallData(req, res) {
return res.json({ callData })
}
function test(req, res) {
const callData = 'test 123'
console.log('deposit:callData', callData)
return res.json({ callData })
}
module.exports = {
test,
getWithdrawalsCallData,
getDepositsCallData,
}

View File

@ -24,6 +24,7 @@ app.use((err, req, res, next) => {
next()
})
app.get('/test', controller.test)
app.get('/deposit', controller.getDepositsCallData)
app.get('/withdrawal', controller.getWithdrawalsCallData)

View File

@ -1,12 +1,8 @@
const cron = require('cron')
const { action } = require('./utils')
const { getEvents } = require('./events')
const { updateTree } = require('./update')
const { redis, getProviderWs } = require('./singletons')
const { cronExpression } = require('./config')
let provider = getProviderWs()
async function processNewBlock(block) {
@ -47,8 +43,6 @@ async function init() {
}
}
cron.job(cronExpression, init, null, true, null, null, true)
process.on('unhandledRejection', error => {
console.error('Unhandled promise rejection', error)
process.exit(1)