stack-orchestrator/app/data/stacks/mobymask-v2/mobymask-only.md
Nabarun Gogoi 63fbaa7ae3 Add ability to run mobymask-v2 stack with external optimism endpoint (#279)
* Set optimism geth endpoint from env file

* Set L1 account private keys from env

* Only deploy contract and generate invite in mobymask container

* Add readme for running mobymask v2 stack independently

* Modify mobymask container to stop running server and update readmes

* Check deployer account balance before deploying contract

* Fix for checking account balance before deploying

* Update readme description

* Update MobyMask repo tag in readme

Former-commit-id: 94e38ceaba
2023-04-05 17:26:38 +05:30

2.1 KiB

MobyMask v2 watcher

Instructions to setup and deploy MobyMask v2 watcher independently

Setup

Prerequisite: An L2 Optimism RPC endpoint

Clone required repositories:

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

Checkout to the required versions and branches in repos:

```bash
# 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.2

Build the container images:

laconic-so --stack mobymask-v2 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

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 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>

See Tests and Demo to interact with stack

Clean up

Stop all services running in the background:

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

Clear volumes created by this stack:

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