2019-05-31 16:24:45 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
cd $(dirname $0)
|
2019-06-04 14:49:39 +02:00
|
|
|
set -e # exit when any command fails
|
2019-05-31 16:24:45 +02:00
|
|
|
|
|
|
|
./down.sh
|
2020-07-14 21:53:05 +07:00
|
|
|
docker-compose build parity1 parity2
|
|
|
|
test -n "$NODOCKERPULL" || ./pull.sh $@
|
2019-07-26 10:14:25 +02:00
|
|
|
docker network create --driver bridge ultimate || true
|
2019-07-16 16:12:33 +02:00
|
|
|
docker-compose up -d parity1 parity2 e2e
|
2019-05-31 16:24:45 +02:00
|
|
|
|
2020-01-20 17:00:04 -03:00
|
|
|
startValidator () {
|
|
|
|
docker-compose $1 run -d --name $4 redis
|
|
|
|
docker-compose $1 run -d --name $5 rabbit
|
|
|
|
docker-compose $1 run $2 $3 -d oracle yarn watcher:signature-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle yarn watcher:collected-signatures
|
|
|
|
docker-compose $1 run $2 $3 -d oracle yarn watcher:affirmation-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20 yarn watcher:signature-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20 yarn watcher:collected-signatures
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20 yarn watcher:affirmation-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20 yarn watcher:transfer
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn watcher:signature-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn watcher:collected-signatures
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn watcher:affirmation-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn watcher:transfer
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn watcher:half-duplex-transfer
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn worker:swap-tokens
|
2020-02-17 23:48:43 +03:00
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn worker:convert-to-chai
|
2020-01-20 17:00:04 -03:00
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:signature-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:collected-signatures
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:affirmation-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn sender:home
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-erc20-native yarn sender:foreign
|
|
|
|
}
|
|
|
|
|
2020-07-29 07:30:36 -03:00
|
|
|
startAMBValidator () {
|
|
|
|
docker-compose $1 run -d --name $4 redis
|
|
|
|
docker-compose $1 run -d --name $5 rabbit
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:signature-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:collected-signatures
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn watcher:affirmation-request
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn sender:home
|
|
|
|
docker-compose $1 run $2 $3 -d oracle-amb yarn sender:foreign
|
|
|
|
}
|
|
|
|
|
2019-05-31 16:24:45 +02:00
|
|
|
while [ "$1" != "" ]; do
|
|
|
|
if [ "$1" == "oracle" ]; then
|
2020-07-14 21:53:05 +07:00
|
|
|
docker-compose up -d redis rabbit
|
2019-05-31 16:24:45 +02:00
|
|
|
|
|
|
|
docker-compose run -d oracle yarn watcher:signature-request
|
|
|
|
docker-compose run -d oracle yarn watcher:collected-signatures
|
|
|
|
docker-compose run -d oracle yarn watcher:affirmation-request
|
|
|
|
docker-compose run -d oracle-erc20 yarn watcher:signature-request
|
|
|
|
docker-compose run -d oracle-erc20 yarn watcher:collected-signatures
|
|
|
|
docker-compose run -d oracle-erc20 yarn watcher:affirmation-request
|
2019-10-29 11:55:47 -03:00
|
|
|
docker-compose run -d oracle-erc20 yarn watcher:transfer
|
2019-05-31 16:24:45 +02:00
|
|
|
docker-compose run -d oracle-erc20-native yarn watcher:signature-request
|
|
|
|
docker-compose run -d oracle-erc20-native yarn watcher:collected-signatures
|
|
|
|
docker-compose run -d oracle-erc20-native yarn watcher:affirmation-request
|
2019-10-29 11:55:47 -03:00
|
|
|
docker-compose run -d oracle-erc20-native yarn watcher:transfer
|
2019-12-02 17:20:53 -03:00
|
|
|
docker-compose run -d oracle-erc20-native yarn watcher:half-duplex-transfer
|
|
|
|
docker-compose run -d oracle-erc20-native yarn worker:swap-tokens
|
2020-02-17 23:48:43 +03:00
|
|
|
docker-compose run -d oracle-erc20-native yarn worker:convert-to-chai
|
2019-09-18 16:45:13 -03:00
|
|
|
docker-compose run -d oracle-amb yarn watcher:signature-request
|
|
|
|
docker-compose run -d oracle-amb yarn watcher:collected-signatures
|
|
|
|
docker-compose run -d oracle-amb yarn watcher:affirmation-request
|
2019-05-31 16:24:45 +02:00
|
|
|
docker-compose run -d oracle yarn sender:home
|
|
|
|
docker-compose run -d oracle yarn sender:foreign
|
|
|
|
fi
|
|
|
|
|
2020-01-20 17:00:04 -03:00
|
|
|
if [ "$1" == "oracle-validator-2" ]; then
|
|
|
|
oracle2name="-p validator2"
|
|
|
|
oracle2Values="-e ORACLE_VALIDATOR_ADDRESS=0xdCC784657C78054aa61FbcFFd2605F32374816A4 -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=5a5c3645d0f04e9eb4f27f94ed4c244a225587405b8838e7456f7781ce3a9513"
|
|
|
|
oracle2comp="-e ORACLE_QUEUE_URL=amqp://rabbit2 -e ORACLE_REDIS_URL=redis://redis2"
|
|
|
|
startValidator "$oracle2name" "$oracle2Values" "$oracle2comp" "redis2" "rabbit2"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "oracle-validator-3" ]; then
|
|
|
|
oracle3name="-p validator3"
|
|
|
|
oracle3Values="-e ORACLE_VALIDATOR_ADDRESS=0xDcef88209a20D52165230104B245803C3269454d -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=f877f62a1c19f852cff1d29f0fb1ecac18821c0080d4cc0520c60c098293dca1"
|
|
|
|
oracle3comp="-e ORACLE_QUEUE_URL=amqp://rabbit3 -e ORACLE_REDIS_URL=redis://redis3"
|
|
|
|
startValidator "$oracle3name" "$oracle3Values" "$oracle3comp" "redis3" "rabbit3"
|
|
|
|
fi
|
|
|
|
|
2019-05-31 16:24:45 +02:00
|
|
|
if [ "$1" == "ui" ]; then
|
2020-07-14 21:53:05 +07:00
|
|
|
# this should only rebuild last 3 steps from ui/Dockerfile
|
|
|
|
docker-compose build ui-erc20 ui-erc20-native ui-amb-stake-erc20-erc20
|
|
|
|
|
2020-06-01 14:58:03 -03:00
|
|
|
docker-compose up -d ui ui-erc20 ui-erc20-native ui-amb-stake-erc20-erc20
|
2019-06-03 10:11:00 +02:00
|
|
|
|
2019-06-14 15:50:22 +02:00
|
|
|
docker-compose run -d -p 3000:3000 ui yarn start
|
|
|
|
docker-compose run -d -p 3001:3000 ui-erc20 yarn start
|
|
|
|
docker-compose run -d -p 3002:3000 ui-erc20-native yarn start
|
2020-06-01 14:58:03 -03:00
|
|
|
docker-compose run -d -p 3003:3000 ui-amb-stake-erc20-erc20 yarn start
|
2019-06-03 10:11:00 +02:00
|
|
|
fi
|
|
|
|
|
2020-07-29 07:30:36 -03:00
|
|
|
if [ "$1" == "alm" ]; then
|
|
|
|
docker-compose up -d alm
|
|
|
|
|
|
|
|
docker-compose run -d -p 3004:3000 alm serve -p 3000 -s .
|
|
|
|
fi
|
|
|
|
|
2019-06-03 13:47:52 +02:00
|
|
|
if [ "$1" == "deploy" ]; then
|
|
|
|
docker-compose run e2e e2e-commons/scripts/deploy.sh
|
|
|
|
fi
|
|
|
|
|
2019-06-03 15:49:40 +02:00
|
|
|
if [ "$1" == "blocks" ]; then
|
2020-02-11 20:50:34 +03:00
|
|
|
docker-compose up -d blocks
|
2019-06-03 15:49:40 +02:00
|
|
|
fi
|
|
|
|
|
2019-06-27 09:57:45 +02:00
|
|
|
if [ "$1" == "monitor" ]; then
|
2019-11-13 03:51:11 -03:00
|
|
|
docker-compose up -d monitor monitor-erc20 monitor-erc20-native monitor-amb
|
2019-06-27 09:57:45 +02:00
|
|
|
fi
|
|
|
|
|
2019-07-17 10:14:58 +02:00
|
|
|
if [ "$1" == "native-to-erc" ]; then
|
2019-08-29 10:30:34 +02:00
|
|
|
../deployment-e2e/molecule.sh ultimate-native-to-erc
|
2019-07-17 10:14:58 +02:00
|
|
|
fi
|
|
|
|
|
2019-08-08 16:09:24 +02:00
|
|
|
if [ "$1" == "erc-to-native" ]; then
|
2019-08-29 10:30:34 +02:00
|
|
|
../deployment-e2e/molecule.sh ultimate-erc-to-native
|
2019-08-08 16:09:24 +02:00
|
|
|
fi
|
|
|
|
|
2019-08-20 10:19:42 +02:00
|
|
|
if [ "$1" == "erc-to-erc" ]; then
|
2019-08-29 10:30:34 +02:00
|
|
|
../deployment-e2e/molecule.sh ultimate-erc-to-erc
|
2019-08-20 10:19:42 +02:00
|
|
|
fi
|
|
|
|
|
2020-02-03 13:39:21 -03:00
|
|
|
if [ "$1" == "amb" ]; then
|
|
|
|
../deployment-e2e/molecule.sh ultimate-amb
|
|
|
|
fi
|
|
|
|
|
2020-06-01 14:58:03 -03:00
|
|
|
if [ "$1" == "ultimate-amb-stake-erc-to-erc" ]; then
|
|
|
|
../deployment-e2e/molecule.sh ultimate-amb-stake-erc-to-erc
|
|
|
|
fi
|
|
|
|
|
2020-07-29 07:30:36 -03:00
|
|
|
if [ "$1" == "alm-e2e" ]; then
|
|
|
|
docker-compose up -d redis rabbit
|
|
|
|
|
|
|
|
docker-compose run -d oracle-amb yarn watcher:signature-request
|
|
|
|
docker-compose run -d oracle-amb yarn watcher:collected-signatures
|
|
|
|
docker-compose run -d oracle-amb yarn watcher:affirmation-request
|
|
|
|
docker-compose run -d oracle-amb yarn sender:home
|
|
|
|
docker-compose run -d oracle-amb yarn sender:foreign
|
|
|
|
|
|
|
|
oracle2name="-p validator2"
|
|
|
|
oracle2Values="-e ORACLE_VALIDATOR_ADDRESS=0xdCC784657C78054aa61FbcFFd2605F32374816A4 -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=5a5c3645d0f04e9eb4f27f94ed4c244a225587405b8838e7456f7781ce3a9513"
|
|
|
|
oracle2comp="-e ORACLE_QUEUE_URL=amqp://rabbit2 -e ORACLE_REDIS_URL=redis://redis2"
|
|
|
|
startAMBValidator "$oracle2name" "$oracle2Values" "$oracle2comp" "redis2" "rabbit2"
|
|
|
|
|
|
|
|
oracle3name="-p validator3"
|
|
|
|
oracle3Values="-e ORACLE_VALIDATOR_ADDRESS=0xDcef88209a20D52165230104B245803C3269454d -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=f877f62a1c19f852cff1d29f0fb1ecac18821c0080d4cc0520c60c098293dca1"
|
|
|
|
oracle3comp="-e ORACLE_QUEUE_URL=amqp://rabbit3 -e ORACLE_REDIS_URL=redis://redis3"
|
|
|
|
startAMBValidator "$oracle3name" "$oracle3Values" "$oracle3comp" "redis3" "rabbit3"
|
|
|
|
fi
|
|
|
|
|
2019-05-31 16:24:45 +02:00
|
|
|
shift # Shift all the parameters down by one
|
|
|
|
done
|