Add extra hosts in app compose files and update instructions

This commit is contained in:
Prathamesh Musale 2023-04-11 12:19:12 +05:30
parent e894901b02
commit 3da83102d2
7 changed files with 48 additions and 10 deletions

View File

@ -31,6 +31,8 @@ services:
retries: 15
start_period: 10s
shm_size: '1GB'
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
mobymask_deployment:

View File

@ -22,3 +22,5 @@ services:
timeout: 5s
retries: 15
start_period: 10s
extra_hosts:
- "host.docker.internal:host-gateway"

View File

@ -10,6 +10,8 @@ Clone required repositories:
```bash
laconic-so --stack fixturenet-optimism setup-repositories
# 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:

View File

@ -10,6 +10,8 @@ Clone required repositories:
```bash
laconic-so --stack fixturenet-optimism setup-repositories --exclude cerc-io/go-ethereum
# 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:
@ -35,7 +37,7 @@ This should create the required docker images in the local image registry:
## Deploy
Create and update an env file to be used in the next step:
Create and update an env file to be used in the next step ([defaults](../../config/fixturenet-optimism/l1-params.env)):
```bash
# External L1 endpoint
@ -82,7 +84,7 @@ docker logs -f <CONTAINER_ID>
Stop all services running in the background:
```bash
laconic-so --stack fixturenet-optimism deploy down --include fixturenet-optimism
laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down
```
Clear volumes created by this stack:

View File

@ -1,10 +1,12 @@
# MobyMask v2 watcher
Instructions to setup and deploy an end-to-end MobyMask v2 stack ([L1](../fixturenet-eth/) + [L2](../fixturenet-optimism/) chains + watcher) using [laconic-stack-orchestrator](/README.md#install)
Instructions to setup and deploy an end-to-end MobyMask v2 stack ([L1](../fixturenet-eth/) + [L2](../fixturenet-optimism/) chains + watcher + web-app(s)) using [laconic-stack-orchestrator](/README.md#install)
We support running just the watcher part of stack, given an external L2 Optimism endpoint.
Follow [mobymask-only](./mobymask-only.md) for the same.
We also support running just the web-app(s), given external watcher GQL (for mobymask-app) and relay node endpoints. Follow [web-apps.md](./web-apps.md) for the same.
## Setup
Clone required repositories:

View File

@ -10,6 +10,8 @@ Clone required repositories:
```bash
laconic-so --stack mobymask-v2 setup-repositories --include cerc-io/MobyMask,cerc-io/watcher-ts
# 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:
@ -36,7 +38,7 @@ This should create the required docker images in the local image registry
### Configuration
Create an env file to be used in the next step:
Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v2/)):
```bash
# External L2 endpoints
@ -51,14 +53,14 @@ Create an env file to be used in the next step:
PRIVATE_KEY_DEPLOYER=
PRIVATE_KEY_PEER=
# Base URI for mobymask-app (used for generating invite)
# Base URI for mobymask-app
# (used for generating a root invite link after deploying the contract)
MOBYMASK_APP_BASE_URI="http://127.0.0.1:3002/#"
# Set to false for disabling watcher peer to send txs to L2
ENABLE_PEER_L2_TXS=true
# Set deployed MobyMask contract address to avoid deploying contract in the stack
# mobymask-app will use this contract address in config if run separately
# (Optional) Set already deployed MobyMask contract address to avoid deploying contract in the stack
DEPLOYED_CONTRACT=
```
@ -82,10 +84,22 @@ docker ps
docker logs -f <CONTAINER_ID>
```
The watcher endpoint is exposed on port `3001` and the relay node endpoint is exposed on port `9090`
Check the logs of the 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")
```
## Tests
See [Tests](./README.md#tests)
## Web Apps
For deploying the web-app(s) separately after deploying the watcher, follow [web-apps.md](./web-apps.md)
## Clean up
Stop all services running in the background:

View File

@ -10,6 +10,8 @@ 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:
@ -36,7 +38,7 @@ This should create the required docker images in the local image registry
### Configuration
Create an env file to be used in the next step:
Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v2/mobymask-params.env)):
```bash
# Set relay nodes to be used by the web-app
@ -44,10 +46,12 @@ Create an env file to be used in the next step:
# Also add if running MobyMask app:
# External watcher endpoint
# External watcher endpoint (to check if watcher is up)
WATCHER_HOST=
WATCHER_PORT=
APP_WATCHER_URL=
# Watcher endpoint used by the app for GQL queries
APP_WATCHER_URL="http://127.0.0.1:3001"
# Set deployed MobyMask contract address to be used in MobyMask app's config
DEPLOYED_CONTRACT=
@ -63,22 +67,32 @@ Create an env file to be used in the next step:
For running mobymask-app
```bash
laconic-so --stack mobymask-v2 deploy --include mobymask-app --env-file <PATH_TO_ENV_FILE> up
# Runs on host port 3002
```
For running peer-test-app
```bash
laconic-so --stack mobymask-v2 deploy --include peer-test-app --env-file <PATH_TO_ENV_FILE> up
# Runs on host port 3003
```
To list down and monitor the running containers:
```bash
laconic-so --stack mobymask-v2 deploy --include [mobymask-app | peer-test-app] ps
docker ps
# Check logs for a container
docker logs -f <CONTAINER_ID>
```
## Demo
Follow the [demo](./demo.md) to try out the MobyMask app with L2 chain
## Clean up
Stop all services running in the background: