Eth watcher should now work on ci env

This commit is contained in:
Kirill Fedoseev 2019-10-29 18:24:38 +03:00
parent 4db5f2ac93
commit de76a1aaad
3 changed files with 10 additions and 32 deletions

View File

@ -27,15 +27,12 @@ orbs:
- run:
name: "Backup blockchains data using temporary container"
command: |
mkdir -p ./workspace
mkdir -p ./workspace/ganache_side_data
mkdir -p ./workspace/ganache_home_data
docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4
docker cp "tmp:/ganache_side_data" "./workspace/ganache_side_data"
docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data"
docker cp "tmp:/ganache_side_data/." "./workspace/ganache_side_data"
docker cp "tmp:/ganache_home_data/." "./workspace/ganache_home_data"
docker kill tmp
du -sh ./workspace/ganache_side_data
du -sh ./workspace/ganache_home_data
ls ./workspace/ganache_side_data
ls ./workspace/ganache_home_data
- persist_to_workspace:
root: ./workspace
paths:
@ -47,15 +44,11 @@ orbs:
- run:
name: "Restore blockchains data from backup using temporary container"
command: |
du -sh ./workspace/ganache_side_data
du -sh ./workspace/ganache_home_data
ls ./workspace/ganache_side_data
ls ./workspace/ganache_home_data
docker volume create ganache_side_data
docker volume create ganache_home_data
docker run --rm -v "ganache_side_data:/ganache_side_data" -v "ganache_home_data:/ganache_home_data" -itd --name tmp alpine:3.9.4
docker cp "./workspace/ganache_side_data" "tmp:/ganache_side_data"
docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data"
docker cp "./workspace/ganache_side_data/." "tmp:/ganache_side_data"
docker cp "./workspace/ganache_home_data/." "tmp:/ganache_home_data"
docker kill tmp
restore_tss_image:
description: "Restores tss image from cache"
@ -159,9 +152,6 @@ jobs:
command: |
BLOCK_TIME=3 ./demo/start-environment.sh
cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100
- run:
name: "Get bridge deployed code"
command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545"
- run:
name: "Stop dev environment"
command: docker kill ganache_side ganache_home
@ -188,9 +178,6 @@ jobs:
N=2 ./demo/validator-demo.sh -d
N=3 ./demo/validator-demo.sh -d
docker ps
- run:
name: "Get bridge deployed code"
command: docker run --network blockchain_home --entrypoint ash appropriate/curl:latest -c "curl -X POST --data \{\"jsonrpc\":\"2.0\",\"method\":\"eth_getCode\",\"params\":[\"0x44c158FE850821ae69DaF37AADF5c539e9d0025B\",\"latest\"],\"id\":1\} http://ganache_home:8545"
- run:
name: "Wait until validator nodes are ready"
command: |

View File

@ -103,16 +103,7 @@ async function initialize () {
foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0
}
logger.debug('Checking if current validator')
let currentValidators = []
try {
logger.debug('1')
currentValidators = await bridge.methods.getValidators().call()
logger.debug('2')
logger.debug('%o', currentValidators)
} catch (e) {
logger.debug('%o', e)
}
isCurrentValidator = (currentValidators).includes(validatorAddress)
isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress)
logger.debug(`${isCurrentValidator}`)
if (isCurrentValidator) {
logger.info(`${validatorAddress} is a current validator`)
@ -183,7 +174,7 @@ initialize().then(async () => {
while (true) {
await main()
}
})
}, e => logger.warn('Initialization failed %o', e))
async function sendKeygen (event) {
const newEpoch = event.returnValues.newEpoch.toNumber()

View File

@ -358,10 +358,10 @@ async function info (req, res) {
votesForCancelKeygen,
confirmationsForFundsTransfer
}
logger.debug('%o', msg)
logger.trace('%o', msg)
res.send(msg)
} catch (e) {
logger.debug('%o', { message: 'Something went wrong, resend request', error: e })
logger.debug('%o', e)
res.send({ message: 'Something went wrong, resend request', error: e })
}
logger.debug('Info end')