From a97ac67d09f0ad4c990e5e13798bea2fa3ce579a Mon Sep 17 00:00:00 2001 From: Westlad Date: Fri, 19 May 2023 15:13:06 +0100 Subject: [PATCH 1/4] feat: start-apps script can now select services to start --- bin/start-apps | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/bin/start-apps b/bin/start-apps index ec4f075f6..dc0b1d8f9 100755 --- a/bin/start-apps +++ b/bin/start-apps @@ -1,2 +1,37 @@ #! /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 -d --remove-orphans ${APP_SERVICES_TO_START//,/ } +docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' logs -f ${APP_SERVICES_TO_START//,/ } From 8173b98e2a144bd54ba41c13cd04f68cc4ba0429 Mon Sep 17 00:00:00 2001 From: Westlad Date: Mon, 22 May 2023 12:51:58 +0100 Subject: [PATCH 2/4] fix: do not detach containers for apps --- bin/start-apps | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/start-apps b/bin/start-apps index dc0b1d8f9..6e13fdad4 100755 --- a/bin/start-apps +++ b/bin/start-apps @@ -33,5 +33,4 @@ if [ -z "$APP_SERVICES_TO_START" ]; then done fi -docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' up -d --remove-orphans ${APP_SERVICES_TO_START//,/ } -docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' logs -f ${APP_SERVICES_TO_START//,/ } +docker-compose -f docker/docker-compose.apps.yml -p 'nightfall_3' up ${APP_SERVICES_TO_START//,/ } From c49ec3cbf8eb6411471cafcc2f1a8676832064e6 Mon Sep 17 00:00:00 2001 From: Westlad Date: Wed, 24 May 2023 11:03:32 +0100 Subject: [PATCH 3/4] feat: added environment file for a challenger on Mumbai --- bin/mumbai-challenger.env | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/mumbai-challenger.env diff --git a/bin/mumbai-challenger.env b/bin/mumbai-challenger.env new file mode 100755 index 000000000..907086f2b --- /dev/null +++ b/bin/mumbai-challenger.env @@ -0,0 +1,15 @@ +#! /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 +set +o allexport \ No newline at end of file From 99493b2800da4646102916ab013f51bc99851977 Mon Sep 17 00:00:00 2001 From: Westlad Date: Fri, 26 May 2023 09:40:42 +0100 Subject: [PATCH 4/4] fix: add optimist URL to env --- bin/mumbai-challenger.env | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/mumbai-challenger.env b/bin/mumbai-challenger.env index 907086f2b..d312bd957 100755 --- a/bin/mumbai-challenger.env +++ b/bin/mumbai-challenger.env @@ -12,4 +12,6 @@ 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