Trying to figure out why eth watcher does not work properly on CI env 4

This commit is contained in:
Kirill Fedoseev 2019-10-29 12:41:41 +03:00
parent e29ea876f5
commit adbb1f09c7
2 changed files with 14 additions and 7 deletions

View File

@ -10,13 +10,17 @@ const { publicKeyToAddress } = require('./crypto')
const abiBridge = require('./contracts_data/Bridge.json').abi
logger.debug('%o', abiBridge)
setInterval(() => {
logger.debug("alive")
}, 5000)
const { HOME_RPC_URL, HOME_BRIDGE_ADDRESS, RABBITMQ_URL, HOME_START_BLOCK, VALIDATOR_PRIVATE_KEY } = process.env
setInterval(() => {
axios.post(HOME_RPC_URL, {
jsonrpc: '2.0',
method: "eth_blockNumber",
params: [],
id: 1
}).then(console.log, console.log)
}, 5000)
const homeWeb3 = new Web3(HOME_RPC_URL)
const bridge = new homeWeb3.eth.Contract(abiBridge, HOME_BRIDGE_ADDRESS)
const validatorAddress = homeWeb3.eth.accounts.privateKeyToAccount(`0x${VALIDATOR_PRIVATE_KEY}`).address

View File

@ -336,7 +336,7 @@ async function info (req, res) {
])
const foreignAddress = publicKeyToAddress({ x, y })
const balances = await getForeignBalances(foreignAddress)
res.send({
const msg = {
epoch,
rangeSize,
nextRangeSize,
@ -357,8 +357,11 @@ async function info (req, res) {
votesForKeygen,
votesForCancelKeygen,
confirmationsForFundsTransfer
})
}
logger.debug('%o', msg)
res.send(msg)
} catch (e) {
logger.debug('%o', { message: 'Something went wrong, resend request', error: e })
res.send({ message: 'Something went wrong, resend request', error: e })
}
logger.debug('Info end')