From 178570f8f429379dc56a3dfe538f2e6e08ef67ce Mon Sep 17 00:00:00 2001 From: nabarun Date: Thu, 13 Apr 2023 20:15:53 +0530 Subject: [PATCH 1/5] Use standalone mobymask-v2-watcher-ts to run peer test --- .../docker-compose-watcher-mobymask-v2.yml | 26 +++++++++++++-- .../watcher-mobymask-v2/start-server.sh | 24 +------------- .../start-watcher-ts-shell.sh | 32 +++++++++++++++++++ .../cerc-watcher-mobymask-v2/Dockerfile | 2 +- .../cerc-watcher-mobymask-v2/build.sh | 2 +- 5 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh diff --git a/app/data/compose/docker-compose-watcher-mobymask-v2.yml b/app/data/compose/docker-compose-watcher-mobymask-v2.yml index 601d13b6..c85953c5 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v2.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v2.yml @@ -54,6 +54,24 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + watcher-ts-peer: + # TODO: Use watcher-ts local container or publish watcher-ts image + image: ghcr.io/cerc-io/watcher-ts:v0.2.37 + restart: on-failure + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + working_dir: /app/packages/peer + command: ["sh", "start-watcher-ts-shell.sh"] + volumes: + - ../config/watcher-mobymask-v2/start-watcher-ts-shell.sh:/app/packages/peer/start-watcher-ts-shell.sh + - peers_ids:/app/packages/peer + healthcheck: + test: ["CMD", "ls", /app/packages/peer/peer-id.json] + interval: 20s + timeout: 5s + retries: 15 + start_period: 5s + # Starts the mobymask-v2-watcher server mobymask-watcher-server: image: cerc/watcher-mobymask-v2:local @@ -61,6 +79,8 @@ services: depends_on: mobymask-watcher-db: condition: service_healthy + watcher-ts-peer: + condition: service_healthy mobymask: condition: service_completed_successfully env_file: @@ -76,9 +96,9 @@ services: CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT} command: ["sh", "start-server.sh"] volumes: - - ../config/watcher-mobymask-v2/watcher-config-template.toml:/app/packages/mobymask-v2-watcher/environments/watcher-config-template.toml - - ../config/watcher-mobymask-v2/start-server.sh:/app/packages/mobymask-v2-watcher/start-server.sh - - peers_ids:/app/packages/mobymask-v2-watcher/peers + - ../config/watcher-mobymask-v2/watcher-config-template.toml:/app/environments/watcher-config-template.toml + - ../config/watcher-mobymask-v2/start-server.sh:/app/start-server.sh + - peers_ids:/app/peers - mobymask_deployment:/server - fixturenet_geth_accounts:/geth-accounts:ro # Expose GQL, metrics and relay node ports diff --git a/app/data/config/watcher-mobymask-v2/start-server.sh b/app/data/config/watcher-mobymask-v2/start-server.sh index b5a3518e..02184842 100755 --- a/app/data/config/watcher-mobymask-v2/start-server.sh +++ b/app/data/config/watcher-mobymask-v2/start-server.sh @@ -14,26 +14,7 @@ CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRA echo "Using L2 RPC endpoint ${CERC_L2_GETH_RPC}" -# Check for peer ids in ./peers folder, create if not present -if [ -f ./peers/relay-id.json ]; then - echo "Using peer id for relay node from the mounted volume" -else - echo "Creating a new peer id for relay node" - cd ../peer - yarn create-peer -f ../mobymask-v2-watcher/peers/relay-id.json - cd ../mobymask-v2-watcher -fi - -if [ -f ./peers/peer-id.json ]; then - echo "Using peer id for peer node from the mounted volume" -else - echo "Creating a new peer id for peer node" - cd ../peer - yarn create-peer -f ../mobymask-v2-watcher/peers/peer-id.json - cd ../mobymask-v2-watcher -fi - -CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' ./peers/relay-id.json)" +CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /app/peers/relay-id.json)" # Use contract address from environment variable or set from config.json in mounted volume if [ -n "$CERC_DEPLOYED_CONTRACT" ]; then @@ -65,8 +46,5 @@ WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ # Write the modified content to a new file echo "$WATCHER_CONFIG" > environments/local.toml -# Write the relay node's multiaddr to /app/packages/peer/.env for running tests -echo "RELAY=\"$CERC_RELAY_MULTIADDR\"" > /app/packages/peer/.env - echo 'yarn server' yarn server diff --git a/app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh b/app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh new file mode 100644 index 00000000..7d823ef7 --- /dev/null +++ b/app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +# TODO: Build in Dockerfile +apk --update --no-cache add jq +yarn build + +# Check for peer ids in ./peers folder, create if not present +if [ -f ./relay-id.json ]; then + echo "Using peer id for relay node from the mounted volume" +else + echo "Creating a new peer id for relay node" + yarn create-peer -f relay-id.json +fi + +if [ -f ./peer-id.json ]; then + echo "Using peer id for peer node from the mounted volume" +else + echo "Creating a new peer id for peer node" + yarn create-peer -f peer-id.json +fi + +CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' ./relay-id.json)" + +# Write the relay node's multiaddr to /app/packages/peer/.env for running tests +echo "RELAY=\"$CERC_RELAY_MULTIADDR\"" > ./.env + +# TODO: Discuss leave shell running +tail -f .env diff --git a/app/data/container-build/cerc-watcher-mobymask-v2/Dockerfile b/app/data/container-build/cerc-watcher-mobymask-v2/Dockerfile index 18aff5cd..9d1a70b7 100644 --- a/app/data/container-build/cerc-watcher-mobymask-v2/Dockerfile +++ b/app/data/container-build/cerc-watcher-mobymask-v2/Dockerfile @@ -17,4 +17,4 @@ COPY . . RUN echo "Building watcher-ts" && \ yarn && yarn build -WORKDIR /app/packages/mobymask-v2-watcher +WORKDIR /app diff --git a/app/data/container-build/cerc-watcher-mobymask-v2/build.sh b/app/data/container-build/cerc-watcher-mobymask-v2/build.sh index f8b59224..b26ad999 100755 --- a/app/data/container-build/cerc-watcher-mobymask-v2/build.sh +++ b/app/data/container-build/cerc-watcher-mobymask-v2/build.sh @@ -6,4 +6,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh # See: https://stackoverflow.com/a/246128/1701505 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -docker build -t cerc/watcher-mobymask-v2:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/watcher-ts +docker build -t cerc/watcher-mobymask-v2:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/mobymask-v2-watcher-ts -- 2.45.2 From 2519376356117f859b452429942aaf687cb5096a Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 14 Apr 2023 11:28:05 +0530 Subject: [PATCH 2/5] Add watcher-ts image for running peer tests --- .../compose/docker-compose-watcher-mobymask-v2.yml | 14 ++++++++++---- ...atcher-ts-shell.sh => start-watcher-ts-peer.sh} | 7 ------- .../container-build/cerc-watcher-ts/Dockerfile | 10 ++++++++++ app/data/container-build/cerc-watcher-ts/build.sh | 7 +++++++ app/data/container-image-list.txt | 1 + app/data/pod-list.txt | 1 + app/data/stacks/mobymask-v2/README.md | 4 ++-- app/data/stacks/mobymask-v2/stack.yml | 1 + 8 files changed, 32 insertions(+), 13 deletions(-) rename app/data/config/watcher-mobymask-v2/{start-watcher-ts-shell.sh => start-watcher-ts-peer.sh} (85%) mode change 100644 => 100755 create mode 100644 app/data/container-build/cerc-watcher-ts/Dockerfile create mode 100755 app/data/container-build/cerc-watcher-ts/build.sh diff --git a/app/data/compose/docker-compose-watcher-mobymask-v2.yml b/app/data/compose/docker-compose-watcher-mobymask-v2.yml index c85953c5..d86f1a51 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v2.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v2.yml @@ -54,16 +54,22 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + # Creates peer-id files if they don't exist + # Container keeps running so that peer tests can be run watcher-ts-peer: - # TODO: Use watcher-ts local container or publish watcher-ts image - image: ghcr.io/cerc-io/watcher-ts:v0.2.37 + image: cerc/watcher-ts:local restart: on-failure environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} working_dir: /app/packages/peer - command: ["sh", "start-watcher-ts-shell.sh"] + command: + - sh + - -c + - | + ./start-watcher-ts-peer.sh && \ + tail -f /dev/null volumes: - - ../config/watcher-mobymask-v2/start-watcher-ts-shell.sh:/app/packages/peer/start-watcher-ts-shell.sh + - ../config/watcher-mobymask-v2/start-watcher-ts-peer.sh:/app/packages/peer/start-watcher-ts-peer.sh - peers_ids:/app/packages/peer healthcheck: test: ["CMD", "ls", /app/packages/peer/peer-id.json] diff --git a/app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh b/app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh old mode 100644 new mode 100755 similarity index 85% rename from app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh rename to app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh index 7d823ef7..b288875b --- a/app/data/config/watcher-mobymask-v2/start-watcher-ts-shell.sh +++ b/app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh @@ -4,10 +4,6 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then set -x fi -# TODO: Build in Dockerfile -apk --update --no-cache add jq -yarn build - # Check for peer ids in ./peers folder, create if not present if [ -f ./relay-id.json ]; then echo "Using peer id for relay node from the mounted volume" @@ -27,6 +23,3 @@ CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id # Write the relay node's multiaddr to /app/packages/peer/.env for running tests echo "RELAY=\"$CERC_RELAY_MULTIADDR\"" > ./.env - -# TODO: Discuss leave shell running -tail -f .env diff --git a/app/data/container-build/cerc-watcher-ts/Dockerfile b/app/data/container-build/cerc-watcher-ts/Dockerfile new file mode 100644 index 00000000..75ba2efa --- /dev/null +++ b/app/data/container-build/cerc-watcher-ts/Dockerfile @@ -0,0 +1,10 @@ +FROM node:16.17.1-alpine3.16 + +RUN apk --update --no-cache add git python3 alpine-sdk jq + +WORKDIR /app + +COPY . . + +RUN echo "Building watcher-ts" && \ + yarn && yarn build diff --git a/app/data/container-build/cerc-watcher-ts/build.sh b/app/data/container-build/cerc-watcher-ts/build.sh new file mode 100755 index 00000000..e180ec0e --- /dev/null +++ b/app/data/container-build/cerc-watcher-ts/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Build cerc/watcher-erc20 + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/watcher-ts:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/watcher-ts diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index 150d81ae..0635c4c8 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -14,6 +14,7 @@ cerc/laconic-registry-cli cerc/laconic-console-host cerc/fixturenet-eth-geth cerc/fixturenet-eth-lighthouse +cerc/watcher-ts cerc/watcher-mobymask cerc/watcher-erc20 cerc/watcher-erc721 diff --git a/app/data/pod-list.txt b/app/data/pod-list.txt index f24c9ed0..ef42ad9e 100644 --- a/app/data/pod-list.txt +++ b/app/data/pod-list.txt @@ -10,6 +10,7 @@ laconicd fixturenet-laconicd fixturenet-eth fixturenet-eth-metrics +watcher-ts watcher-mobymask watcher-erc20 watcher-erc721 diff --git a/app/data/stacks/mobymask-v2/README.md b/app/data/stacks/mobymask-v2/README.md index aaa4ac7f..32a58b08 100644 --- a/app/data/stacks/mobymask-v2/README.md +++ b/app/data/stacks/mobymask-v2/README.md @@ -73,13 +73,13 @@ Deploy the stack: Find the watcher container's id and export it for later use: ```bash -export CONTAINER_ID=$(docker ps -q --filter "name=mobymask-watcher-server") +export CONTAINER_ID=$(docker ps -q --filter "name=watcher-ts-peer") ``` Run the peer tests: ```bash -docker exec -w /app/packages/peer $CONTAINER_ID yarn test +docker exec $CONTAINER_ID yarn test ``` ## Web Apps diff --git a/app/data/stacks/mobymask-v2/stack.yml b/app/data/stacks/mobymask-v2/stack.yml index 248351b1..3ef84499 100644 --- a/app/data/stacks/mobymask-v2/stack.yml +++ b/app/data/stacks/mobymask-v2/stack.yml @@ -19,6 +19,7 @@ containers: - cerc/optimism-l2geth - cerc/optimism-op-batcher - cerc/optimism-op-node + - cerc/watcher-ts - cerc/watcher-mobymask-v2 - cerc/react-peer - cerc/mobymask-ui -- 2.45.2 From 940aec49b10690685b839f897ab86dc1baa18cbc Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 14 Apr 2023 12:28:09 +0530 Subject: [PATCH 3/5] Run separate containers for peer ids generation and tests --- .../docker-compose-watcher-mobymask-v2.yml | 46 +++++++++++-------- .../watcher-mobymask-v2/generate-peer-ids.sh | 20 ++++++++ .../watcher-mobymask-v2/set-tests-env.sh | 10 ++++ .../start-watcher-ts-peer.sh | 25 ---------- 4 files changed, 58 insertions(+), 43 deletions(-) create mode 100755 app/data/config/watcher-mobymask-v2/generate-peer-ids.sh create mode 100755 app/data/config/watcher-mobymask-v2/set-tests-env.sh delete mode 100755 app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh diff --git a/app/data/compose/docker-compose-watcher-mobymask-v2.yml b/app/data/compose/docker-compose-watcher-mobymask-v2.yml index d86f1a51..fa68d017 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v2.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v2.yml @@ -55,28 +55,16 @@ services: - "host.docker.internal:host-gateway" # Creates peer-id files if they don't exist - # Container keeps running so that peer tests can be run - watcher-ts-peer: + peer-ids-gen: image: cerc/watcher-ts:local restart: on-failure environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} working_dir: /app/packages/peer - command: - - sh - - -c - - | - ./start-watcher-ts-peer.sh && \ - tail -f /dev/null + command: ["sh", "generate-peer-ids.sh"] volumes: - - ../config/watcher-mobymask-v2/start-watcher-ts-peer.sh:/app/packages/peer/start-watcher-ts-peer.sh - - peers_ids:/app/packages/peer - healthcheck: - test: ["CMD", "ls", /app/packages/peer/peer-id.json] - interval: 20s - timeout: 5s - retries: 15 - start_period: 5s + - ../config/watcher-mobymask-v2/generate-peer-ids.sh:/app/packages/peer/generate-peer-ids.sh + - peers_ids:/peer-ids # Starts the mobymask-v2-watcher server mobymask-watcher-server: @@ -85,8 +73,8 @@ services: depends_on: mobymask-watcher-db: condition: service_healthy - watcher-ts-peer: - condition: service_healthy + peer-ids-gen: + condition: service_completed_successfully mobymask: condition: service_completed_successfully env_file: @@ -121,6 +109,28 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + # Container to run peer tests + peer-tests: + image: cerc/watcher-ts:local + restart: on-failure + depends_on: + mobymask-watcher-server: + condition: service_healthy + peer-ids-gen: + condition: service_completed_successfully + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + working_dir: /app/packages/peer + command: + - sh + - -c + - | + ./set-tests-env.sh && \ + tail -f /dev/null + volumes: + - ../config/watcher-mobymask-v2/set-tests-env.sh:/app/packages/peer/set-tests-env.sh + - peers_ids:/peer-ids + volumes: mobymask_watcher_db_data: peers_ids: diff --git a/app/data/config/watcher-mobymask-v2/generate-peer-ids.sh b/app/data/config/watcher-mobymask-v2/generate-peer-ids.sh new file mode 100755 index 00000000..5c97c45d --- /dev/null +++ b/app/data/config/watcher-mobymask-v2/generate-peer-ids.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +# Check for peer ids in ./peers folder, create if not present +if [ -f /peer-ids/relay-id.json ]; then + echo "Using peer id for relay node from the mounted volume" +else + echo "Creating a new peer id for relay node" + yarn create-peer -f /peer-ids/relay-id.json +fi + +if [ -f /peer-ids/peer-id.json ]; then + echo "Using peer id for peer node from the mounted volume" +else + echo "Creating a new peer id for peer node" + yarn create-peer -f /peer-ids/peer-id.json +fi diff --git a/app/data/config/watcher-mobymask-v2/set-tests-env.sh b/app/data/config/watcher-mobymask-v2/set-tests-env.sh new file mode 100755 index 00000000..5e31b763 --- /dev/null +++ b/app/data/config/watcher-mobymask-v2/set-tests-env.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /peer-ids/relay-id.json)" + +# Write the relay node's multiaddr to /app/packages/peer/.env for running tests +echo "RELAY=\"$CERC_RELAY_MULTIADDR\"" > ./.env diff --git a/app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh b/app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh deleted file mode 100755 index b288875b..00000000 --- a/app/data/config/watcher-mobymask-v2/start-watcher-ts-peer.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -e -if [ -n "$CERC_SCRIPT_DEBUG" ]; then - set -x -fi - -# Check for peer ids in ./peers folder, create if not present -if [ -f ./relay-id.json ]; then - echo "Using peer id for relay node from the mounted volume" -else - echo "Creating a new peer id for relay node" - yarn create-peer -f relay-id.json -fi - -if [ -f ./peer-id.json ]; then - echo "Using peer id for peer node from the mounted volume" -else - echo "Creating a new peer id for peer node" - yarn create-peer -f peer-id.json -fi - -CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' ./relay-id.json)" - -# Write the relay node's multiaddr to /app/packages/peer/.env for running tests -echo "RELAY=\"$CERC_RELAY_MULTIADDR\"" > ./.env -- 2.45.2 From 1a3e09809170b710ad74403d6a1fc2298b7da88d Mon Sep 17 00:00:00 2001 From: nabarun Date: Mon, 17 Apr 2023 17:23:59 +0530 Subject: [PATCH 4/5] Wait for watcher to be up before starting peer-test-app --- app/data/compose/docker-compose-peer-test-app.yml | 9 +++++++-- app/data/repository-list.txt | 1 + app/data/stacks/mobymask-v2/README.md | 4 ++-- app/data/stacks/mobymask-v2/stack.yml | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/data/compose/docker-compose-peer-test-app.yml b/app/data/compose/docker-compose-peer-test-app.yml index 0a8d1c65..18968bd1 100644 --- a/app/data/compose/docker-compose-peer-test-app.yml +++ b/app/data/compose/docker-compose-peer-test-app.yml @@ -10,9 +10,14 @@ services: environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_RELAY_NODES: ${CERC_RELAY_NODES} - command: ["sh", "./test-app-start.sh"] + command: + - sh + - -c + - ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./test-app-start.sh volumes: - - ../config/watcher-mobymask-v2/test-app-start.sh:/scripts/test-app-start.sh + - ../config/wait-for-it.sh:/app/packages/test-app/wait-for-it.sh + - ../config/watcher-mobymask-v2/test-app-config.json:/app/packages/test-app/src/test-app-config.json + - ../config/watcher-mobymask-v2/test-app-start.sh:/app/packages/test-app/test-app-start.sh - peers_ids:/peers ports: - "0.0.0.0:3003:80" diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 3f8c84bf..bfb6085c 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -12,6 +12,7 @@ cerc-io/laconic-registry-cli cerc-io/laconic-console cerc-io/mobymask-watcher cerc-io/watcher-ts +cerc-io/mobymask-v2-watcher-ts cerc-io/react-peer cerc-io/mobymask-ui cerc-io/MobyMask diff --git a/app/data/stacks/mobymask-v2/README.md b/app/data/stacks/mobymask-v2/README.md index 32a58b08..30f15f36 100644 --- a/app/data/stacks/mobymask-v2/README.md +++ b/app/data/stacks/mobymask-v2/README.md @@ -23,7 +23,7 @@ Checkout to the required versions and branches in repos ```bash # watcher-ts cd ~/cerc/watcher-ts -git checkout v0.2.35 +git checkout v0.2.39 # react-peer cd ~/cerc/react-peer @@ -73,7 +73,7 @@ Deploy the stack: Find the watcher container's id and export it for later use: ```bash -export CONTAINER_ID=$(docker ps -q --filter "name=watcher-ts-peer") +export CONTAINER_ID=$(docker ps -q --filter "name=peer-tests") ``` Run the peer tests: diff --git a/app/data/stacks/mobymask-v2/stack.yml b/app/data/stacks/mobymask-v2/stack.yml index 3ef84499..7e5b83f7 100644 --- a/app/data/stacks/mobymask-v2/stack.yml +++ b/app/data/stacks/mobymask-v2/stack.yml @@ -6,6 +6,7 @@ repos: - ethereum-optimism/optimism - ethereum-optimism/op-geth - cerc-io/watcher-ts + - cerc-io/mobymask-v2-watcher-ts - cerc-io/react-peer - cerc-io/mobymask-ui - cerc-io/MobyMask -- 2.45.2 From 91971e97a5ffdfab1d25db7baabf7b6a73cb0679 Mon Sep 17 00:00:00 2001 From: nabarun Date: Wed, 19 Apr 2023 13:26:36 +0530 Subject: [PATCH 5/5] Resolve peer-test-app compose file and remove setup-repositories for web-apps --- .../compose/docker-compose-peer-test-app.yml | 5 ++--- app/data/stacks/mobymask-v2/README.md | 8 -------- app/data/stacks/mobymask-v2/demo.md | 2 +- app/data/stacks/mobymask-v2/stack.yml | 2 -- app/data/stacks/mobymask-v2/web-apps.md | 20 ------------------- 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/app/data/compose/docker-compose-peer-test-app.yml b/app/data/compose/docker-compose-peer-test-app.yml index 18968bd1..927f92f7 100644 --- a/app/data/compose/docker-compose-peer-test-app.yml +++ b/app/data/compose/docker-compose-peer-test-app.yml @@ -15,9 +15,8 @@ services: - -c - ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./test-app-start.sh volumes: - - ../config/wait-for-it.sh:/app/packages/test-app/wait-for-it.sh - - ../config/watcher-mobymask-v2/test-app-config.json:/app/packages/test-app/src/test-app-config.json - - ../config/watcher-mobymask-v2/test-app-start.sh:/app/packages/test-app/test-app-start.sh + - ../config/wait-for-it.sh:/scripts/wait-for-it.sh + - ../config/watcher-mobymask-v2/test-app-start.sh:/scripts/test-app-start.sh - peers_ids:/peers ports: - "0.0.0.0:3003:80" diff --git a/app/data/stacks/mobymask-v2/README.md b/app/data/stacks/mobymask-v2/README.md index 30f15f36..fb4aebcd 100644 --- a/app/data/stacks/mobymask-v2/README.md +++ b/app/data/stacks/mobymask-v2/README.md @@ -25,14 +25,6 @@ Checkout to the required versions and branches in repos cd ~/cerc/watcher-ts git checkout v0.2.39 -# react-peer -cd ~/cerc/react-peer -git checkout v0.2.32 - -# mobymask-ui -cd ~/cerc/mobymask-ui -git checkout v0.1.2 - # MobyMask cd ~/cerc/MobyMask git checkout v0.1.2 diff --git a/app/data/stacks/mobymask-v2/demo.md b/app/data/stacks/mobymask-v2/demo.md index 329b554d..953390cf 100644 --- a/app/data/stacks/mobymask-v2/demo.md +++ b/app/data/stacks/mobymask-v2/demo.md @@ -66,7 +66,7 @@ * Get the deployed contract address: ```bash - docker exec -it $(docker ps -aq --filter name="mobymask-app") cat src/config.json + docker exec -it $(docker ps -aq --filter name="mobymask-app") cat /config/config.yml ``` The value of `address` field is the deployed contract address diff --git a/app/data/stacks/mobymask-v2/stack.yml b/app/data/stacks/mobymask-v2/stack.yml index 7e5b83f7..b91e4461 100644 --- a/app/data/stacks/mobymask-v2/stack.yml +++ b/app/data/stacks/mobymask-v2/stack.yml @@ -7,8 +7,6 @@ repos: - ethereum-optimism/op-geth - cerc-io/watcher-ts - cerc-io/mobymask-v2-watcher-ts - - cerc-io/react-peer - - cerc-io/mobymask-ui - cerc-io/MobyMask containers: - cerc/go-ethereum diff --git a/app/data/stacks/mobymask-v2/web-apps.md b/app/data/stacks/mobymask-v2/web-apps.md index 866f22f0..76293f1f 100644 --- a/app/data/stacks/mobymask-v2/web-apps.md +++ b/app/data/stacks/mobymask-v2/web-apps.md @@ -6,26 +6,6 @@ Instructions to setup and deploy MobyMask and Peer Test web apps Prerequisite: Watcher with GQL and relay node endpoints -Clone required repositories: - -```bash -laconic-so --stack mobymask-v2 setup-repositories --include cerc-io/react-peer,cerc-io/mobymask-ui - -# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned below and re-run the command -``` - -Checkout to the required versions and branches in repos: - -```bash -# react-peer -cd ~/cerc/react-peer -git checkout v0.2.32 - -# mobymask-ui -cd ~/cerc/mobymask-ui -git checkout v0.1.2 -``` - Build the container images: ```bash -- 2.45.2