Eth watcher should now work on ci env
This commit is contained in:
parent
4db5f2ac93
commit
de76a1aaad
|
@ -27,15 +27,12 @@ orbs:
|
||||||
- run:
|
- run:
|
||||||
name: "Backup blockchains data using temporary container"
|
name: "Backup blockchains data using temporary container"
|
||||||
command: |
|
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 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_side_data/." "./workspace/ganache_side_data"
|
||||||
docker cp "tmp:/ganache_home_data" "./workspace/ganache_home_data"
|
docker cp "tmp:/ganache_home_data/." "./workspace/ganache_home_data"
|
||||||
docker kill tmp
|
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:
|
- persist_to_workspace:
|
||||||
root: ./workspace
|
root: ./workspace
|
||||||
paths:
|
paths:
|
||||||
|
@ -47,15 +44,11 @@ orbs:
|
||||||
- run:
|
- run:
|
||||||
name: "Restore blockchains data from backup using temporary container"
|
name: "Restore blockchains data from backup using temporary container"
|
||||||
command: |
|
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_side_data
|
||||||
docker volume create ganache_home_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 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_side_data/." "tmp:/ganache_side_data"
|
||||||
docker cp "./workspace/ganache_home_data" "tmp:/ganache_home_data"
|
docker cp "./workspace/ganache_home_data/." "tmp:/ganache_home_data"
|
||||||
docker kill tmp
|
docker kill tmp
|
||||||
restore_tss_image:
|
restore_tss_image:
|
||||||
description: "Restores tss image from cache"
|
description: "Restores tss image from cache"
|
||||||
|
@ -159,9 +152,6 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
BLOCK_TIME=3 ./demo/start-environment.sh
|
BLOCK_TIME=3 ./demo/start-environment.sh
|
||||||
cat ./tests/config.json | jq .users[].ethAddress | xargs -I {} ./src/test-services/ethereumSend/run.sh {} 100
|
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:
|
- run:
|
||||||
name: "Stop dev environment"
|
name: "Stop dev environment"
|
||||||
command: docker kill ganache_side ganache_home
|
command: docker kill ganache_side ganache_home
|
||||||
|
@ -188,9 +178,6 @@ jobs:
|
||||||
N=2 ./demo/validator-demo.sh -d
|
N=2 ./demo/validator-demo.sh -d
|
||||||
N=3 ./demo/validator-demo.sh -d
|
N=3 ./demo/validator-demo.sh -d
|
||||||
docker ps
|
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:
|
- run:
|
||||||
name: "Wait until validator nodes are ready"
|
name: "Wait until validator nodes are ready"
|
||||||
command: |
|
command: |
|
||||||
|
|
|
@ -103,16 +103,7 @@ async function initialize () {
|
||||||
foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0
|
foreignNonce[epoch] = parseInt(await redis.get(`foreignNonce${epoch}`)) || 0
|
||||||
}
|
}
|
||||||
logger.debug('Checking if current validator')
|
logger.debug('Checking if current validator')
|
||||||
let currentValidators = []
|
isCurrentValidator = (await bridge.methods.getValidators().call()).includes(validatorAddress)
|
||||||
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)
|
|
||||||
logger.debug(`${isCurrentValidator}`)
|
logger.debug(`${isCurrentValidator}`)
|
||||||
if (isCurrentValidator) {
|
if (isCurrentValidator) {
|
||||||
logger.info(`${validatorAddress} is a current validator`)
|
logger.info(`${validatorAddress} is a current validator`)
|
||||||
|
@ -183,7 +174,7 @@ initialize().then(async () => {
|
||||||
while (true) {
|
while (true) {
|
||||||
await main()
|
await main()
|
||||||
}
|
}
|
||||||
})
|
}, e => logger.warn('Initialization failed %o', e))
|
||||||
|
|
||||||
async function sendKeygen (event) {
|
async function sendKeygen (event) {
|
||||||
const newEpoch = event.returnValues.newEpoch.toNumber()
|
const newEpoch = event.returnValues.newEpoch.toNumber()
|
||||||
|
|
|
@ -358,10 +358,10 @@ async function info (req, res) {
|
||||||
votesForCancelKeygen,
|
votesForCancelKeygen,
|
||||||
confirmationsForFundsTransfer
|
confirmationsForFundsTransfer
|
||||||
}
|
}
|
||||||
logger.debug('%o', msg)
|
logger.trace('%o', msg)
|
||||||
res.send(msg)
|
res.send(msg)
|
||||||
} catch (e) {
|
} 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 })
|
res.send({ message: 'Something went wrong, resend request', error: e })
|
||||||
}
|
}
|
||||||
logger.debug('Info end')
|
logger.debug('Info end')
|
||||||
|
|
Loading…
Reference in New Issue