Archived
Rename app -> stack_orchestrator (#625)
This commit was merged in pull request #625.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# MobyMask v3
|
||||
|
||||
Instructions to setup and deploy MobyMask v3 stack (watcher + web-app) using [laconic-stack-orchestrator](/README.md#install)
|
||||
|
||||
* Follow [watcher.md](./watcher.md) for deploying the watcher
|
||||
* Follow [web-app.md](./web-app.md) for deploying the app
|
||||
@@ -0,0 +1,19 @@
|
||||
version: "1.0"
|
||||
description: "MobyMask v3 stack"
|
||||
name: mobymask-v3
|
||||
repos:
|
||||
- github.com/cerc-io/ts-nitro@v0.1.13
|
||||
- github.com/cerc-io/watcher-ts@v0.2.63
|
||||
- github.com/cerc-io/mobymask-v2-watcher-ts@v0.2.2
|
||||
- github.com/cerc-io/MobyMask@v0.1.3
|
||||
- github.com/cerc-io/mobymask-ui@v0.2.1
|
||||
containers:
|
||||
- cerc/nitro-contracts
|
||||
- cerc/watcher-ts
|
||||
- cerc/watcher-mobymask-v3
|
||||
- cerc/mobymask
|
||||
- cerc/mobymask-ui
|
||||
pods:
|
||||
- nitro-contracts
|
||||
- watcher-mobymask-v3
|
||||
- mobymask-app-v3
|
||||
@@ -0,0 +1,136 @@
|
||||
# MobyMask v3 Watcher
|
||||
|
||||
## Setup
|
||||
|
||||
Prerequisite: L2 Optimism Geth RPC endpoint
|
||||
|
||||
Clone required repositories:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 setup-repositories --pull --exclude github.com/cerc-io/mobymask-ui
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 build-containers --exclude cerc/mobymask-ui
|
||||
```
|
||||
|
||||
## Deploy
|
||||
|
||||
### Configuration
|
||||
|
||||
Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v3/mobymask-params.env)):
|
||||
|
||||
```bash
|
||||
# External ETH RPC endpoint for contract(s) deployment
|
||||
CERC_ETH_RPC_ENDPOINT=
|
||||
|
||||
# External ETH RPC endpoint used for queries in the watcher
|
||||
CERC_ETH_RPC_QUERY_ENDPOINT=
|
||||
|
||||
# External ETH RPC endpoint used for mutations in the watcher
|
||||
CERC_ETH_RPC_MUTATION_ENDPOINT=
|
||||
|
||||
# External ETH endpoint used by watcher's Nitro node
|
||||
CERC_NITRO_CHAIN_URL=
|
||||
|
||||
# Specify the an account PK for contract deployment
|
||||
CERC_PRIVATE_KEY_DEPLOYER=
|
||||
|
||||
# Base URI for mobymask-app
|
||||
# (used for generating a root invite link after deploying the contract)
|
||||
CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3004/#"
|
||||
|
||||
# (Optional) Domain to be used in the relay node's announce address
|
||||
CERC_RELAY_ANNOUNCE_DOMAIN=
|
||||
|
||||
# (Optional) Set of relay peers to connect to from the relay node
|
||||
CERC_RELAY_PEERS=[]
|
||||
|
||||
# (Optional) Set of multiaddrs to be avoided while dialling
|
||||
CERC_DENY_MULTIADDRS=[]
|
||||
|
||||
# (Optional) Type of pubsub to be used
|
||||
CERC_PUBSUB=""
|
||||
|
||||
# Set to false for disabling watcher peer to send txs to L2
|
||||
CERC_ENABLE_PEER_L2_TXS=true
|
||||
|
||||
# (Optional) Set already deployed MobyMask contract address to avoid deploying contract in the stack
|
||||
CERC_DEPLOYED_CONTRACT=
|
||||
|
||||
# (Optional) Set already deployed Nitro addresses to avoid deploying them in the stack
|
||||
CERC_NA_ADDRESS=
|
||||
CERC_VPA_ADDRESS=
|
||||
CERC_CA_ADDRESS=
|
||||
|
||||
# Specify private key of a funded account for sending txs to L2
|
||||
CERC_PRIVATE_KEY_PEER=
|
||||
|
||||
# Specify private key for the Nitro account
|
||||
CERC_WATCHER_NITRO_PK=
|
||||
|
||||
# (Optional) Set a pre-existing peer id to be used (enables consensus)
|
||||
# Uses a generated peer id if not set (disables consensus)
|
||||
CERC_PEER_ID=
|
||||
|
||||
# Disable payments to upstream ETH server
|
||||
CERC_ENABLE_UPSTREAM_PAYMENTS=false
|
||||
```
|
||||
|
||||
* NOTE: If Optimism is running on the host machine, use `host.docker.internal` as the hostname to access the host port
|
||||
|
||||
### Deploy the stack
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --exclude mobymask-app-v3 --env-file <PATH_TO_ENV_FILE> up
|
||||
```
|
||||
|
||||
* To list down and monitor the running containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --exclude mobymask-app-v3 ps
|
||||
|
||||
# With status
|
||||
docker ps -a
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
```
|
||||
|
||||
* The watcher endpoint is exposed on host port `3001` and the relay node endpoint is exposed on host port `9090`
|
||||
|
||||
* Check the logs of the MobyMask contract deployment container to get the deployed contract's address and generated root invite link:
|
||||
|
||||
```bash
|
||||
docker logs -f $(docker ps -aq --filter name="mobymask-1")
|
||||
```
|
||||
|
||||
* Check logs of the Nitro contracts container to get the deployed Nitro contracts' addresses:
|
||||
|
||||
```bash
|
||||
docker exec -it $(docker ps -q --filter name="nitro-contracts") bash -c "cat /app/deployment/nitro-addresses.json"
|
||||
```
|
||||
|
||||
## Clean up
|
||||
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --exclude mobymask-app-v3 down
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter "name=mobymask_v3"
|
||||
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter "name=mobymask_v3")
|
||||
|
||||
# WARNING: To avoid changing peer ids for the watcher, `peers_ids` volume can be persisted
|
||||
# To delete all volumes except for `peers_ids`
|
||||
docker volume rm $(docker volume ls -q --filter "name=mobymask_v3" | grep -v "peers_ids$")
|
||||
```
|
||||
@@ -0,0 +1,89 @@
|
||||
# MobyMask v3 App
|
||||
|
||||
## Setup
|
||||
|
||||
Prerequisite: Watcher with GQL and relay node endpoints
|
||||
|
||||
Clone required repositories:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 setup-repositories --pull --include github.com/cerc-io/mobymask-ui
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 build-containers --include cerc/mobymask-ui
|
||||
```
|
||||
|
||||
## Deploy
|
||||
|
||||
### Configuration
|
||||
|
||||
Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v3/mobymask-params.env)):
|
||||
|
||||
```bash
|
||||
# Set of relay nodes to be used by the web-app
|
||||
# (use double quotes " for strings, avoid space after commas)
|
||||
# Eg. CERC_RELAY_NODES=["/dns4/example.com/tcp/443/wss/p2p/12D3KooWGHmDDCc93XUWL16FMcTPCGu2zFaMkf67k8HZ4gdQbRDr"]
|
||||
CERC_RELAY_NODES=[]
|
||||
|
||||
# Set of multiaddrs to be avoided while dialling
|
||||
CERC_DENY_MULTIADDRS=[]
|
||||
|
||||
# Also add if running MobyMask app:
|
||||
|
||||
# Watcher endpoint used by the app for GQL queries
|
||||
CERC_APP_WATCHER_URL="http://127.0.0.1:3001"
|
||||
|
||||
# Set deployed MobyMask contract address to be used in MobyMask app's config
|
||||
CERC_DEPLOYED_CONTRACT=
|
||||
|
||||
# L2 Chain ID used by mobymask web-app for L2 txs
|
||||
CERC_CHAIN_ID=42069
|
||||
|
||||
# (Optional) Type of pubsub to be used ("floodsub" | "gossipsub")
|
||||
CERC_PUBSUB=""
|
||||
|
||||
# (Optional) Set of direct peers to be used when pubsub is set to gossipsub
|
||||
CERC_GOSSIPSUB_DIRECT_PEERS=[]
|
||||
|
||||
# Set Nitro addresses
|
||||
CERC_NA_ADDRESS=
|
||||
CERC_VPA_ADDRESS=
|
||||
CERC_CA_ADDRESS=
|
||||
|
||||
# Nitro account address to make the query and mutation payments to
|
||||
CERC_PAYMENT_NITRO_ADDRESS=
|
||||
|
||||
# (Optional) Endpoint for Mobymask snap installation
|
||||
CERC_SNAP_URL=
|
||||
```
|
||||
|
||||
### Deploy the stack
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --include mobymask-app-v3 --env-file <PATH_TO_ENV_FILE> up
|
||||
|
||||
# Runs the MobyMask v3 app on host port 3004
|
||||
```
|
||||
|
||||
To list down and monitor the running containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --include mobymask-app-v3 ps
|
||||
|
||||
# With status
|
||||
docker ps -a
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
```
|
||||
|
||||
## Clean up
|
||||
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --include mobymask-app-v3 down
|
||||
```
|
||||
Reference in New Issue
Block a user