stack-orchestrator/app/data/stacks/mobymask-v2
2023-04-05 10:55:43 +05:30
..
demo.md Add ability to run Optimism fixturenet with external L1 endpoint (#273) 2023-04-04 14:53:28 +05:30
README.md Set optimism geth endpoint from env file 2023-04-05 10:55:43 +05:30
stack.yml Replace laconicd with optimism in mobymask-v2 stack (#272) 2023-04-03 18:13:29 +05:30

MobyMask v2 watcher

Instructions to deploy MobyMask v2 watcher stack using laconic-stack-orchestrator

Setup

Clone required repositories:

laconic-so --stack mobymask-v2 setup-repositories

# Include repositories required for MobyMask if running optimism separately
laconic-so --stack fixturenet-optimism setup-repositories --include cerc-io/MobyMask,cerc-io/watcher-ts,cerc-io/react-peer,cerc-io/mobymask-ui

NOTE: If repositories already exist and are checked out to different versions, setup-repositories command will throw an error. For getting around this, the repositories mentioned below can be removed and then run the command.

Checkout to the required versions and branches in repos

# watcher-ts
cd ~/cerc/watcher-ts
git checkout v0.2.34

# react-peer
cd ~/cerc/react-peer
git checkout v0.2.31

# mobymask-ui
cd ~/cerc/mobymask-ui
git checkout laconic

# MobyMask
cd ~/cerc/MobyMask
git checkout v0.1.1

# Optimism
cd ~/cerc/optimism
git checkout @eth-optimism/sdk@0.0.0-20230329025055

Build the container images:

laconic-so --stack mobymask-v2 build-containers

# Only build containers required for MobyMask if running optimism separately
laconic-so --stack fixturenet-optimism build-containers --include cerc/watcher-mobymask-v2,cerc/react-peer,cerc/mobymask-ui,cerc/mobymask

This should create the required docker images in the local image registry.

Deploy the stack:

  • (Optional) Update the optimism-params.env file with optimism endpoints and other params if running optimism separately

    NOTE:

    • Stack Orchestrator needs to be run in dev mode to be able to edit the env file
    • If optimism is running on the host machine, use host.docker.internal as the hostname to access the host port
  • Deploy the containers:

    laconic-so --stack mobymask-v2 deploy-system up
    
    # Only start watcher-mobymask-v2 pod if running optimism separately
    laconic-so --stack mobymask-v2 deploy up --include watcher-mobymask-v2
    
  • List and check the health status of all the containers using docker ps and wait for them to be healthy

    NOTE: The mobymask-app container might not start; if the app is not running at http://localhost:3002, restart the container using it's id:

    docker ps -a | grep "mobymask-app"
    
    docker restart <CONTAINER_ID>
    

Tests

Find the watcher container's id and export it for later use:

laconic-so --stack mobymask-v2 deploy-system ps | grep "mobymask-watcher-server"

export CONTAINER_ID=<CONTAINER_ID>

Example output:

id: 5d3aae4b22039fcd1c9b18feeb91318ede1100581e75bb5ac54f9e436066b02c, name: laconic-bfb01caf98b1b8f7c8db4d33f11b905a-mobymask-watcher-server-1, ports: 0.0.0.0:3001->3001/tcp, 0.0.0.0:9001->9001/tcp, 0.0.0.0:9090->9090/tcp

In above output the container ID is 5d3aae4b22039fcd1c9b18feeb91318ede1100581e75bb5ac54f9e436066b02c

Run the peer tests:

docker exec -w /app/packages/peer $CONTAINER_ID yarn test

Web Apps

Check that the web-app containers are healthy:

docker ps | grep -E 'mobymask-app|peer-test-app'

mobymask-app

The mobymask-app should be running at http://localhost:3002

peer-test-app

The peer-test-app should be running at http://localhost:3003

Details

Demo

Follow the demo to try out the MobyMask app with L2 chain

Clean up

Stop all the services running in background run:

laconic-so --stack mobymask-v2 deploy-system down

Clear volumes:

  • List all relevant volumes:

    docker volume ls -q --filter name=laconic*
    
  • Remove all the listed volumes:

    docker volume rm $(docker volume ls -q --filter name=laconic*)