From f3e003896d6555f28c0112f287ec536705a512bd Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Tue, 10 Nov 2020 13:08:32 -0800 Subject: [PATCH 1/5] synthetix deployer --- optional/synthetix-service.yml | 12 ++++++++++++ test.sh | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 optional/synthetix-service.yml diff --git a/optional/synthetix-service.yml b/optional/synthetix-service.yml new file mode 100644 index 0000000..484f27b --- /dev/null +++ b/optional/synthetix-service.yml @@ -0,0 +1,12 @@ +version: "3" + +services: + + synthetix_deployer: + image: ethereumoptimism/synthetix-deployer:${SYNTHETIX_DEPLOYER_TAG:-latest} + env_file: + - ./docker-compose.env + environment: + - SYNTHETIX_TARGET=${SYNTHETIX_TARGET:-L2} + ports: + - 8081:8081 diff --git a/test.sh b/test.sh index 7f2241e..4a9d603 100755 --- a/test.sh +++ b/test.sh @@ -46,13 +46,14 @@ INTEGRATION_TESTS_TAG=$(echo $INTEGRATION_TESTS_TAG | sed 's/\//_/g') DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" + function run { cmd="docker-compose -f $DIR/$DOCKERFILE" if [ -f "$DIR/optional/$PKGS-service.yml" ]; then cmd="$cmd -f $DIR/optional/$PKGS-service.yml" fi - cmd="$cmd up" - cmd="$cmd --exit-code-from integration_tests" + cmd="$cmd up --exit-code-from integration_tests" cmd="$cmd --abort-on-container-exit" PKGS=$PKGS \ From b7c62eed949376843b336f3f1f2ccb705a88aa4b Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Thu, 12 Nov 2020 08:01:28 -0800 Subject: [PATCH 2/5] envfile: updates --- docker-compose.env | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.env b/docker-compose.env index 8d55c77..99afdb1 100644 --- a/docker-compose.env +++ b/docker-compose.env @@ -59,5 +59,9 @@ RUN_TX_BATCH_SUBMITTER=true RUN_STATE_BATCH_SUBMITTER=true MAX_BATCH_SUBMISSION_TIME=240 +# derived key from mnemonic that is seeded with ETH on L1 +DEPLOYER_PRIVATE_KEY_2=0x23d9aeeaa08ab710a57972eb56fc711d9ab13afdecc92c89586e0150bfa380a6 + L1_NODE_WEB3_URL=http://l1_chain:9545 L2_NODE_WEB3_URL=http://geth_l2:8545 +SYNTHETIX_DEPLOYER_URL=http://synthetix_deployer:8081 From 4e86fc75e1dafff332a4785fcbfaf6dccb60342e Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Thu, 12 Nov 2020 08:02:33 -0800 Subject: [PATCH 3/5] test: modularize command --- test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index 4a9d603..0adcdf1 100755 --- a/test.sh +++ b/test.sh @@ -53,7 +53,8 @@ function run { if [ -f "$DIR/optional/$PKGS-service.yml" ]; then cmd="$cmd -f $DIR/optional/$PKGS-service.yml" fi - cmd="$cmd up --exit-code-from integration_tests" + cmd="$cmd up" + cmd="$cmd --exit-code-from integration_tests" cmd="$cmd --abort-on-container-exit" PKGS=$PKGS \ From 0d34900f82a160eeabd97db539d2f18f646af37f Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Wed, 13 Jan 2021 10:40:56 -0800 Subject: [PATCH 4/5] synthetix-deployer: move env var to optional directory --- docker-compose.env | 3 --- optional/synthetix-service.yml | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docker-compose.env b/docker-compose.env index 99afdb1..1da9916 100644 --- a/docker-compose.env +++ b/docker-compose.env @@ -59,9 +59,6 @@ RUN_TX_BATCH_SUBMITTER=true RUN_STATE_BATCH_SUBMITTER=true MAX_BATCH_SUBMISSION_TIME=240 -# derived key from mnemonic that is seeded with ETH on L1 -DEPLOYER_PRIVATE_KEY_2=0x23d9aeeaa08ab710a57972eb56fc711d9ab13afdecc92c89586e0150bfa380a6 - L1_NODE_WEB3_URL=http://l1_chain:9545 L2_NODE_WEB3_URL=http://geth_l2:8545 SYNTHETIX_DEPLOYER_URL=http://synthetix_deployer:8081 diff --git a/optional/synthetix-service.yml b/optional/synthetix-service.yml index 484f27b..03c3de6 100644 --- a/optional/synthetix-service.yml +++ b/optional/synthetix-service.yml @@ -1,12 +1,12 @@ version: "3" services: - synthetix_deployer: - image: ethereumoptimism/synthetix-deployer:${SYNTHETIX_DEPLOYER_TAG:-latest} + image: ethereumoptimism/synthetix-deployer:${SYNTHETIX_DEPLOYER_TAG:-master} env_file: - - ./docker-compose.env + - docker-compose.env environment: - - SYNTHETIX_TARGET=${SYNTHETIX_TARGET:-L2} + # derived key from mnemonic that is seeded with ETH on L1 + - DEPLOYER_PRIVATE_KEY_2=0x23d9aeeaa08ab710a57972eb56fc711d9ab13afdecc92c89586e0150bfa380a6 ports: - 8081:8081 From 002d8d53b91f5bf222201241ef9f151b910abf8d Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Wed, 13 Jan 2021 10:45:55 -0800 Subject: [PATCH 5/5] synthetix: add up script --- .../{synthetix-service.yml => synthetix.yml} | 1 + up-synthetix.sh | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) rename optional/{synthetix-service.yml => synthetix.yml} (99%) create mode 100755 up-synthetix.sh diff --git a/optional/synthetix-service.yml b/optional/synthetix.yml similarity index 99% rename from optional/synthetix-service.yml rename to optional/synthetix.yml index 03c3de6..3095132 100644 --- a/optional/synthetix-service.yml +++ b/optional/synthetix.yml @@ -8,5 +8,6 @@ services: environment: # derived key from mnemonic that is seeded with ETH on L1 - DEPLOYER_PRIVATE_KEY_2=0x23d9aeeaa08ab710a57972eb56fc711d9ab13afdecc92c89586e0150bfa380a6 + ports: - 8081:8081 diff --git a/up-synthetix.sh b/up-synthetix.sh new file mode 100755 index 0000000..dd49a20 --- /dev/null +++ b/up-synthetix.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Start services without the integration tests +# The `-s` flag takes a string of services to run. +# The `-l` flag will use mounted code. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" +SERVICES='geth_l2 l1_chain batch_submitter deployer message_relayer synthetix_deployer' +DOCKERFILE="docker-compose.yml" + +while (( "$#" )); do + case "$1" in + -l|--local) + DOCKERFILE="docker-compose.local.yml" + shift 1 + ;; + -s|--services) + SERVICES="$2" + shift 2 + ;; + *) + echo "Unknown argument $1" >&2 + shift + ;; + esac +done + +docker-compose \ + -f $DIR/$DOCKERFILE \ + -f $DIR/optional/tx-ingestion-service.yml \ + -f $DIR/optional/synthetix.yml \ + down -v --remove-orphans + +docker-compose \ + -f $DIR/$DOCKERFILE \ + -f $DIR/optional/tx-ingestion-service.yml \ + -f $DIR/optional/synthetix.yml \ + up $SERVICES