diff --git a/bin/mumbai-challenger.env b/bin/mumbai-challenger.env new file mode 100755 index 000000000..d312bd957 --- /dev/null +++ b/bin/mumbai-challenger.env @@ -0,0 +1,17 @@ +#! /bin/bash +set -o allexport +BLOCKCHAIN_URL="$2" +CHALLENGER_KEY="$1" +NF_SERVICES_TO_START='optimist' +APP_SERVICES_TO_START='challenger' +ENVIRONMENT=mumbai +USE_EXTERNAL_NODE=true +ERC20_COIN=WMATIC +FEE_L2_TOKEN_ID=WMATIC +ETH_NETWORK=mumbai +DEPLOY_MOCKED_SANCTIONS_CONTRACT= +STATE_GENESIS_BLOCK=32132680 +CONFIRMATIONS=12 +OPTIMIST_HOST='localhost' +OPTIMIST_WS_PORT='8082' +set +o allexport \ No newline at end of file diff --git a/bin/start-apps b/bin/start-apps index ec4f075f6..6e13fdad4 100755 --- a/bin/start-apps +++ b/bin/start-apps @@ -1,2 +1,36 @@ #! /bin/bash -docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' up + +trap "docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' down --remove-orphans -t 1; exit 1" SIGHUP SIGINT SIGTERM + +usage() +{ + echo "Usage:" + echo " -c or --challenger; to start the challenger" + echo " -p or --proposer; to start the proposer" + echo " -h or --help; to print this message" + echo "If nothing is specified then both challenger and proposer will be run" + echo "if APP_SERVICES_TO _START is exported then it will override the above, acceptable values are 'challenger', 'proposer', 'challenger,proposer'" +} +# if APP_SERVICES_TO_START already exists then it overrides anything we attempt to set with this script. +if [ -z "$APP_SERVICES_TO_START" ]; then + if [ -z "$$1" ]; then + APP_SERVICES_TO_START="challenger,proposer" + fi + + while [ -n "$1" ]; do + case $1 in + -c | --challenger ) APP_SERVICES_TO_START=$APP_SERVICES_TO_START" challenger" + ;; + -p | --proposer ) APP_SERVICES_TO_START=$APP_SERVICES_TO_START" proposer" + ;; + -h | --help ) usage + exit 0 + ;; + * ) usage + exit 1 + esac + shift + done +fi + +docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' up ${APP_SERVICES_TO_START//,/ }