Update MobyMask v1 and v2 watcher stack with new deployed contract (#512)

* Update mobymask v1 watcher with new contract

* Update mobymask v1 stack with deployment commands

* Use release tag for mobymask-watcher-ts repo

* Upgrade MobyMask version in v2 stack to use latest contract
This commit is contained in:
2023-08-30 16:15:43 +05:30
committed by GitHub
parent 53ed18b3dc
commit b5988fba8f
10 changed files with 274 additions and 354 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ Create and update an env file to be used in the next step ([defaults](../../conf
CERC_L2_NODE_HOST=
CERC_L2_NODE_PORT=
# URL to get CSV with credentials for accounts on L1 to perform txs on L2
# URL (fixturenet-eth-bootnode-lighthouse) to get CSV with credentials for accounts on L1 to perform txs on L2
CERC_L1_ACCOUNTS_CSV_URL=
# OR
+3 -2
View File
@@ -6,14 +6,15 @@ repos:
- github.com/dboreham/foundry
- github.com/ethereum-optimism/optimism@v1.0.4
- github.com/ethereum-optimism/op-geth@v1.101105.2
- github.com/cerc-io/watcher-ts@v0.2.43
- github.com/cerc-io/watcher-ts@v0.2.55
- github.com/cerc-io/mobymask-v2-watcher-ts@v0.1.2
- github.com/cerc-io/MobyMask@v0.1.2
- github.com/cerc-io/MobyMask@v0.1.3
- github.com/cerc-io/mobymask-ui
containers:
- cerc/go-ethereum
- cerc/lighthouse
- cerc/lighthouse-cli
- cerc/fixturenet-eth-genesis
- cerc/fixturenet-eth-geth
- cerc/fixturenet-eth-lighthouse
- cerc/foundry
+47 -15
View File
@@ -1,45 +1,56 @@
# MobyMask
The MobyMask watcher is a Laconic Network component that provides efficient access to MobyMask contract data from Ethereum, along with evidence allowing users to verify the correctness of that data. The watcher source code is available in [this repository](https://github.com/cerc-io/watcher-ts/tree/main/packages/mobymask-watcher) and a developer-oriented Docker Compose setup for the watcher can be found [here](https://github.com/cerc-io/mobymask-watcher). The watcher can be deployed automatically using the Laconic Stack Orchestrator tool as detailed below:
The MobyMask watcher is a Laconic Network component that provides efficient access to MobyMask contract data from Ethereum, along with evidence allowing users to verify the correctness of that data. The watcher source code is available in [this repository](https://github.com/cerc-io/mobymask-watcher-ts) and a developer-oriented Docker Compose setup for the watcher can be found [here](https://github.com/cerc-io/mobymask-watcher). The watcher can be deployed automatically using the Laconic Stack Orchestrator tool as detailed below:
## Deploy the MobyMask Watcher
The instructions below show how to deploy a MobyMask watcher using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#user-mode)).
The instructions below show how to deploy a MobyMask watcher using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#install)).
This deployment expects that ipld-eth-server's endpoints are available on the local machine at http://ipld-eth-server.example.com:8083/graphql and http://ipld-eth-server.example.com:8082. More advanced configurations are supported by modifying the watcher's [config file](../../config/watcher-mobymask/mobymask-watcher.toml).
## Clone required repositories
```
$ laconic-so setup-repositories --include github.com/cerc-io/watcher-ts
```bash
$ laconic-so --stack mobymask setup-repositories
```
## Build the watcher container
```
$ laconic-so build-containers --include cerc/watcher-mobymask
```bash
$ laconic-so --stack mobymask build-containers
```
This should create a container with tag `cerc/watcher-mobymask` in the local image registry.
## Deploy the stack
## Create a deployment
```bash
$ laconic-so --stack mobymask deploy init --output mobymask-spec.yml
$ laconic-so deploy create --spec-file mobymask-spec.yml --deployment-dir mobymask-deployment
```
External `ipld-eth-server` endpoint can be set in watcher config file in the deployment directory:
```
mobymask-deployment/config/watcher-mobymask/mobymask-watcher.toml
```
## Start the stack
First the watcher database has to be initialized. Start only the mobymask-watcher-db service:
```
$ laconic-so deploy-system --include watcher-mobymask up mobymask-watcher-db
```bash
$ laconic-so deployment --dir mobymask-deployment start mobymask-watcher-db
```
Next find the container's id using `docker ps` then run the following command to initialize the database:
```
$ docker exec -i <mobymask-watcher-db-container> psql -U vdbm mobymask-watcher < config/watcher-mobymask/mobymask-watcher-db.sql
```bash
$ docker exec -i <mobymask-watcher-db-container> psql -U vdbm mobymask-watcher < mobymask-deployment/config/watcher-mobymask/mobymask-watcher-db.sql
```
Finally start the remaining containers:
```
$ laconic-so deploy-system --include watcher-mobymask up
```bash
$ laconic-so deployment --dir mobymask-deployment start
```
Correct operation should be verified by following the instructions [here](https://github.com/cerc-io/mobymask-watcher/tree/main/mainnet-watcher-only#run), checking GraphQL queries return valid results in the watcher's [playground](http://127.0.0.1:3001/graphql).
@@ -49,5 +60,26 @@ Correct operation should be verified by following the instructions [here](https:
Stop all the services running in background:
```bash
$ laconic-so deploy-system --include watcher-mobymask down
$ laconic-so deployment --dir mobymask-deployment stop
```
## Data volumes
Container data volumes are bind-mounted to specified paths in the host filesystem.
The default setup (generated by `laconic-so deploy init`) places the volumes in the `./data` subdirectory of the deployment directory:
```
$ cat mobymask-spec.yml
stack: mobymask
ports:
mobymask-watcher-db:
- 0.0.0.0:15432:5432
mobymask-watcher-job-runner:
- 0.0.0.0:9000:9000
mobymask-watcher-server:
- 0.0.0.0:3001:3001
- 0.0.0.0:9001:9001
volumes:
mobymask_watcher_db_data: ./data/mobymask_watcher_db_data
```
The directory can be changed before `laconic-so deploy create`
+1 -1
View File
@@ -1,7 +1,7 @@
version: "1.0"
name: mobymask-watcher
repos:
- github.com/cerc-io/watcher-ts/v0.2.19
- github.com/cerc-io/mobymask-watcher-ts@v0.1.0
containers:
- cerc/watcher-mobymask
pods: