diff --git a/app/data/compose/docker-compose-mobymask-app.yml b/app/data/compose/docker-compose-mobymask-app.yml index 3dc142f1..a228b854 100644 --- a/app/data/compose/docker-compose-mobymask-app.yml +++ b/app/data/compose/docker-compose-mobymask-app.yml @@ -31,6 +31,8 @@ services: retries: 15 start_period: 10s shm_size: '1GB' + extra_hosts: + - "host.docker.internal:host-gateway" volumes: mobymask_deployment: diff --git a/app/data/compose/docker-compose-peer-test-app.yml b/app/data/compose/docker-compose-peer-test-app.yml index a795473e..2120c269 100644 --- a/app/data/compose/docker-compose-peer-test-app.yml +++ b/app/data/compose/docker-compose-peer-test-app.yml @@ -22,3 +22,5 @@ services: timeout: 5s retries: 15 start_period: 10s + extra_hosts: + - "host.docker.internal:host-gateway" diff --git a/app/data/stacks/fixturenet-optimism/README.md b/app/data/stacks/fixturenet-optimism/README.md index 61ca97b3..1b3300a6 100644 --- a/app/data/stacks/fixturenet-optimism/README.md +++ b/app/data/stacks/fixturenet-optimism/README.md @@ -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: diff --git a/app/data/stacks/fixturenet-optimism/l2-only.md b/app/data/stacks/fixturenet-optimism/l2-only.md index bdd7920c..6a321027 100644 --- a/app/data/stacks/fixturenet-optimism/l2-only.md +++ b/app/data/stacks/fixturenet-optimism/l2-only.md @@ -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 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: diff --git a/app/data/stacks/mobymask-v2/README.md b/app/data/stacks/mobymask-v2/README.md index 54f66239..ab36f302 100644 --- a/app/data/stacks/mobymask-v2/README.md +++ b/app/data/stacks/mobymask-v2/README.md @@ -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: diff --git a/app/data/stacks/mobymask-v2/mobymask-only.md b/app/data/stacks/mobymask-v2/mobymask-only.md index 26fb5d9e..9dce04b3 100644 --- a/app/data/stacks/mobymask-v2/mobymask-only.md +++ b/app/data/stacks/mobymask-v2/mobymask-only.md @@ -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 ``` +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: diff --git a/app/data/stacks/mobymask-v2/web-apps.md b/app/data/stacks/mobymask-v2/web-apps.md index 4a462024..a4a1cfeb 100644 --- a/app/data/stacks/mobymask-v2/web-apps.md +++ b/app/data/stacks/mobymask-v2/web-apps.md @@ -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 up + +# Runs on host port 3002 ``` For running peer-test-app ```bash laconic-so --stack mobymask-v2 deploy --include peer-test-app --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 ``` +## Demo + +Follow the [demo](./demo.md) to try out the MobyMask app with L2 chain + ## Clean up Stop all services running in the background: