1
0

Upgrade dependencies and start inline watcher peer in mobymask-v2 stack (#256)

* Upgrade dependencies in mobymask-v2 stack

* Run inline watcher peer in mobymask v2 stack

---------

Co-authored-by: nabarun <nabarun@deepstacksoft.com>
Former-commit-id: 71aaa41069196836f2186e83583c91b6c6cae161
This commit is contained in:
prathamesh0 2023-03-30 09:44:15 +05:30 committed by GitHub
parent 75ca36e5f7
commit 79ad4fb15a
6 changed files with 31 additions and 34 deletions

View File

@ -23,9 +23,6 @@ services:
mobymask:
restart: unless-stopped
depends_on:
mobymask-watcher-db:
condition: service_healthy
image: cerc/mobymask:local
working_dir: /app/packages/server
environment:
@ -46,12 +43,17 @@ services:
depends_on:
mobymask-watcher-db:
condition: service_healthy
mobymask:
condition: service_healthy
image: cerc/watcher-mobymask-v2:local
command: ["sh", "-c", "yarn server"]
command: ["sh", "server-start.sh"]
volumes:
- ../config/watcher-mobymask-v2/watcher.toml:/app/packages/mobymask-v2-watcher/environments/local.toml
- ../config/watcher-mobymask-v2/watcher-config-template.toml:/app/packages/mobymask-v2-watcher/environments/watcher-config-template.toml
- ../config/watcher-mobymask-v2/peer.env:/app/packages/peer/.env
- ../config/watcher-mobymask-v2/relay-id.json:/app/packages/mobymask-v2-watcher/relay-id.json
- ../config/watcher-mobymask-v2/peer-id.json:/app/packages/mobymask-v2-watcher/peer-id.json
- ../config/watcher-mobymask-v2/server-start.sh:/app/packages/mobymask-v2-watcher/server-start.sh
- moby_data_server:/server
ports:
- "0.0.0.0:3001:3001"
- "0.0.0.0:9001:9001"
@ -63,19 +65,6 @@ services:
retries: 15
start_period: 5s
mobymask-watcher-peer:
restart: unless-stopped
depends_on:
mobymask:
condition: service_healthy
image: cerc/watcher-mobymask-v2:local
command: ["sh", "peer-start.sh"]
volumes:
- ../config/watcher-mobymask-v2/watcher.toml:/app/packages/mobymask-v2-watcher/environments/local.toml
- ../config/watcher-mobymask-v2/peer-id.json:/app/packages/mobymask-v2-watcher/peer-id.json
- ../config/watcher-mobymask-v2/peer-start.sh:/app/packages/mobymask-v2-watcher/peer-start.sh
- moby_data_server:/server
mobymask-app:
depends_on:
mobymask-watcher-server:

View File

@ -1,10 +0,0 @@
#!/bin/sh
# Private key of account with balance
PRIVATE_KEY=
# Assign deployed contract address from server config
CONTRACT_ADDRESS=`jq '.address' /server/config.json`
echo 'yarn peer-listener --contract-address <CONTRACT_ADDRESS> --private-key <PRIVATE_KEY>'
yarn peer-listener --contract-address $CONTRACT_ADDRESS --private-key $PRIVATE_KEY

View File

@ -0,0 +1,9 @@
#!/bin/sh
# Assign deployed contract address from server config
CONTRACT_ADDRESS=`jq '.address' /server/config.json`
sed "s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/" environments/watcher-config-template.toml > environments/local.toml
echo 'yarn server'
yarn server

View File

@ -21,7 +21,7 @@
[server.p2p]
enableRelay = true
enablePeer = false
enablePeer = true
[server.p2p.relay]
host = "0.0.0.0"
@ -36,6 +36,10 @@
peerIdFile = './peer-id.json'
enableDebugInfo = true
[server.p2p.peer.l2TxConfig]
privateKey = ''
contractAddress = REPLACE_WITH_CONTRACT_ADDRESS
[metrics]
host = "0.0.0.0"
port = 9000

View File

@ -18,11 +18,11 @@ Checkout to the required versions and branches in repos
```bash
# watcher-ts
cd ~/cerc/watcher-ts
git checkout v0.2.31
git checkout v0.2.34
# react-peer
cd ~/cerc/react-peer
git checkout v0.2.29
git checkout v0.2.31
# mobymask-ui
cd ~/cerc/mobymask-ui
@ -67,7 +67,7 @@ Deploy the stack:
* Set the private key in [secrets.json](../../config/watcher-mobymask-v2/secrets.json) file that will be used by mobymask container to deploy contract
* Create a new account
* Create a new account named `alice`
```bash
laconic-so --stack mobymask-v2 deploy-system --include mobymask-laconicd exec laconicd "laconicd keys add alice"
@ -85,7 +85,12 @@ Deploy the stack:
laconic-so --stack mobymask-v2 deploy-system --include mobymask-laconicd exec laconicd "echo y | laconicd keys export alice --unarmored-hex --unsafe"
```
* Set the private key (`PRIVATE_KEY`) in [peer-start.sh](../../config/watcher-mobymask-v2/peer-start.sh) file that will be used to start the peer that sends txs to L2 chain
* Set the private key (`server.p2p.peer.l2TxConfig.privateKey`) in [watcher.toml](../../config/watcher-mobymask-v2/watcher.toml) file that will be used to start the peer that sends txs to L2 chain
```toml
[server.p2p.peer.l2TxConfig]
privateKey = 'ALICE_PRIVATE_KEY'
```
* Deploy the other containers

View File

@ -34,7 +34,7 @@
* Get the container id
```bash
laconic-so --stack mobymask-v2 deploy-system --include watcher-mobymask-v2 ps | grep mobymask-watcher-peer
laconic-so --stack mobymask-v2 deploy-system --include watcher-mobymask-v2 ps | grep mobymask-watcher-server
```
* Check logs