stack-orchestrator/app/data/stacks/mobymask-v2/mobymask-only.md
Nabarun Gogoi 86f13e9c6b Separate out watcher and web-apps in mobymask-v2 stack (#287)
* Separate out watcher and web-apps in mobymask stack

* Take L2 RPC endpoint from the env file

* Changes to run watcher and mobymask web-app separately

* Support running watcher without contract deployment and L2 txs

* Remove duplicate mobymask params env

* Add code comments

* Add instructions for running web-apps separately

* Self review fixes

* Fix timeout for mobymask-app on watcher server

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
Former-commit-id: 6f781ae303
2023-04-06 15:17:00 +05:30

2.3 KiB

MobyMask v2 watcher

Instructions to setup and deploy MobyMask v2 watcher independently

Setup

Prerequisite: L2 Optimism Geth and Node RPC endpoints

Clone required repositories:

laconic-so --stack mobymask-v2 setup-repositories --include cerc-io/MobyMask,cerc-io/watcher-ts

Checkout to the required versions and branches in repos:

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

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

Build the container images:

laconic-so --stack mobymask-v2 build-containers --include cerc/watcher-mobymask-v2,cerc/mobymask

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

Deploy

Configuration

  • In mobymask-params.env file set DEPLOYED_CONTRACT to existing deployed mobymask contract address
    • Setting DEPLOYED_CONTRACT will skip contract deployment when running stack
  • Update the optimism-params.env file with Optimism endpoints and other params for the Optimism running separately
    • If PRIVATE_KEY_PEER is not set the inline watcher peer will not send txs to L2 on receiving P2P network messages
  • 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 stack

laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 up

To list down and monitor the running containers:

laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 ps

# With status
docker ps

# Check logs for a container
docker logs -f <CONTAINER_ID>

Tests

See Tests

Clean up

Stop all services running in the background:

laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 down

Clear volumes created by this stack:

# List all relevant volumes
docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*mobymask_deployment|.*fixturenet_geth_accounts"

# Remove all the listed volumes
docker volume rm $(docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*mobymask_deployment|.*fixturenet_geth_accounts")