forked from cerc-io/stack-orchestrator
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e9a68dec3 |
@@ -16,7 +16,6 @@
|
||||
import os
|
||||
from abc import ABC, abstractmethod
|
||||
from .deploy_system import get_stack_status
|
||||
from decouple import config
|
||||
|
||||
|
||||
def get_stack(config, stack):
|
||||
@@ -70,10 +69,3 @@ class package_registry_stack(base_stack):
|
||||
|
||||
def get_url(self):
|
||||
return self.url
|
||||
|
||||
|
||||
def get_npm_registry_url():
|
||||
# If an auth token is not defined, we assume the default should be the cerc registry
|
||||
# If an auth token is defined, we assume the local gitea should be used.
|
||||
default_npm_registry_url = "http://gitea.local:3000/api/packages/cerc-io/npm/" if config("CERC_NPM_AUTH_TOKEN", default=None) else "https://git.vdb.to/api/packages/cerc-io/npm/"
|
||||
return config("CERC_NPM_REGISTRY_URL", default=default_npm_registry_url)
|
||||
|
||||
@@ -28,7 +28,6 @@ import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
from .base import get_npm_registry_url
|
||||
|
||||
# TODO: find a place for this
|
||||
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
|
||||
@@ -85,7 +84,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
||||
|
||||
# TODO: make this configurable
|
||||
container_build_env = {
|
||||
"CERC_NPM_REGISTRY_URL": get_npm_registry_url(),
|
||||
"CERC_NPM_REGISTRY_URL": config("CERC_NPM_REGISTRY_URL", default="http://gitea.local:3000/api/packages/cerc-io/npm/"),
|
||||
"CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default=""),
|
||||
"CERC_REPO_BASE_DIR": dev_root_path,
|
||||
"CERC_CONTAINER_BASE_DIR": container_build_dir,
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
version: "3.2"
|
||||
|
||||
services:
|
||||
lasso:
|
||||
image: cerc/lasso:local
|
||||
restart: always
|
||||
ports:
|
||||
- "0.0.0.0:3000:3000"
|
||||
@@ -1,17 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
go-opera:
|
||||
restart: unless-stopped
|
||||
image: cerc/go-opera:local
|
||||
entrypoint: ["sh", "/docker-entrypoint-scripts.d/start-node.sh"]
|
||||
volumes:
|
||||
- ../config/mainnet-go-opera/start-node.sh:/docker-entrypoint-scripts.d/start-node.sh
|
||||
# TODO: ports taken from dockerfile, determine which are needed
|
||||
ports:
|
||||
- "5050:5050" # p2p port, needed
|
||||
- "5050:5050/udp"
|
||||
- "18545:18545" # http rpc port
|
||||
- "18546:18546" # websockets rpc port
|
||||
#- "18547" # unknown
|
||||
#- "19090" # unknown
|
||||
@@ -1,9 +1,8 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
# Builds and serves the peer-test react-app
|
||||
peer-test-app:
|
||||
restart: unless-stopped
|
||||
# Builds and serves the peer-test react-app
|
||||
image: cerc/react-peer:local
|
||||
working_dir: /scripts
|
||||
env_file:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# download genesis file
|
||||
wget https://download.fantom.network/mainnet-109331-no-history.g
|
||||
|
||||
./opera --genesis=mainnet-109331-no-history.g --db.preset ldb-1 --syncmode snap --http --http.addr="0.0.0.0" --http.corsdomain="*" --http.api=eth,web3,net,txpool,ftm --ws --ws.addr="0.0.0.0" --ws.origins="*" --ws.api=eth,web3,net,txpool,ftm --cache 8192
|
||||
#tail -f /dev/null
|
||||
@@ -10,7 +10,7 @@ DEFAULT_CERC_RELAY_PEERS=[]
|
||||
DEFAULT_CERC_RELAY_ANNOUNCE_DOMAIN=
|
||||
|
||||
# Base URI for mobymask-app (used for generating invite)
|
||||
DEFAULT_CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3004/#"
|
||||
DEFAULT_CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3002/#"
|
||||
|
||||
# Set to false for disabling watcher peer to send txs to L2
|
||||
DEFAULT_CERC_ENABLE_PEER_L2_TXS=true
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/go-opera
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
# Checkout appropriate release; refer to https://docs.fantom.foundation/
|
||||
OPERA_TAG=${OPERA_TAG:-release/1.1.2-rc.5}
|
||||
git -C ${CERC_REPO_BASE_DIR}/go-opera checkout ${OPERA_TAG}
|
||||
|
||||
# Repo's dockerfile gives build error because it's hardcoded for go 1.17; go 1.19 is required
|
||||
sed -i 's/FROM golang:1\.[0-9]*-alpine as builder/FROM golang:1.19-alpine as builder/' ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera
|
||||
|
||||
docker build -f ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera -t cerc/go-opera:local ${build_command_args} ${CERC_REPO_BASE_DIR}/go-opera
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the lasso image
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
docker build -t cerc/lasso:local -f ${CERC_REPO_BASE_DIR}/lasso/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/lasso
|
||||
@@ -41,5 +41,3 @@ cerc/watcher-azimuth
|
||||
cerc/ipld-eth-state-snapshot
|
||||
cerc/watcher-gelato
|
||||
cerc/lotus
|
||||
cerc/go-opera
|
||||
cerc/lasso
|
||||
|
||||
@@ -28,5 +28,3 @@ fixturenet-pocket
|
||||
watcher-azimuth
|
||||
watcher-gelato
|
||||
fixturenet-lotus
|
||||
mainnet-go-opera
|
||||
lasso
|
||||
|
||||
@@ -34,5 +34,3 @@ github.com/cerc-io/ipld-eth-state-snapshot
|
||||
github.com/cerc-io/gelato-watcher-ts
|
||||
github.com/filecoin-project/lotus
|
||||
git.vdb.to/cerc-io/test-project
|
||||
github.com/Fantom-foundation/go-opera
|
||||
github.com/cerc-io/lasso
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# fixturenet-eth-system-tests
|
||||
|
||||
A version of fixturenet-eth for use with https://git.vdb.to/cerc-io/system-tests
|
||||
@@ -0,0 +1,20 @@
|
||||
version: "1.0"
|
||||
name: fixturenet-eth-system-tests
|
||||
decription: "fixturenet-eth-system-tests"
|
||||
repos:
|
||||
- github.com/cerc-io/go-ethereum
|
||||
- github.com/cerc-io/ipld-eth-server
|
||||
- github.com/cerc-io/ipld-eth-db
|
||||
- github.com/cerc-io/lighthouse
|
||||
containers:
|
||||
- cerc/go-ethereum
|
||||
- cerc/lighthouse
|
||||
- cerc/lighthouse-cli
|
||||
- cerc/fixturenet-eth-geth
|
||||
- cerc/fixturenet-eth-lighthouse
|
||||
- cerc/ipld-eth-server
|
||||
- cerc/ipld-eth-db
|
||||
pods:
|
||||
- fixturenet-eth
|
||||
- ipld-eth-server
|
||||
- ipld-eth-db
|
||||
@@ -14,6 +14,14 @@ 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:
|
||||
|
||||
```bash
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
@@ -42,11 +50,12 @@ Deploy the stack:
|
||||
laconic-so --stack fixturenet-optimism deploy up
|
||||
```
|
||||
|
||||
If you get the error `service "fixturenet-optimism-contracts" didn't complete successfully: exit 1` with ~25 lines of Traceback, wait 15-20 mins then re-run the command.
|
||||
|
||||
The `fixturenet-optimism-contracts` service takes a while to complete running as it:
|
||||
1. waits for the 'Merge' to happen on L1
|
||||
2. waits for a finalized block to exist on L1 (so that it can be taken as a starting block for roll ups)
|
||||
3. deploys the L1 contracts
|
||||
It may restart a few times after running into errors.
|
||||
|
||||
To list and monitor the running containers:
|
||||
|
||||
@@ -114,5 +123,6 @@ docker volume rm $(docker volume ls -q --filter "name=.*l1_deployment|.*l2_accou
|
||||
|
||||
## Known Issues
|
||||
|
||||
* `fixturenet-eth` currently starts fresh on a restart
|
||||
* Resource requirements (memory + time) for building the `cerc/foundry` image are on the higher side
|
||||
* `cerc/optimism-contracts` image is currently based on `cerc/foundry` (Optimism requires foundry installation)
|
||||
|
||||
@@ -14,6 +14,14 @@ laconic-so --stack fixturenet-optimism setup-repositories --exclude github.com/c
|
||||
# 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:
|
||||
|
||||
```bash
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -3,14 +3,12 @@ name: fixturenet-optimism
|
||||
decription: "Optimism Fixturenet"
|
||||
repos:
|
||||
- github.com/cerc-io/go-ethereum
|
||||
- github.com/cerc-io/lighthouse
|
||||
- github.com/dboreham/foundry
|
||||
- github.com/ethereum-optimism/optimism@v1.0.4
|
||||
- github.com/ethereum-optimism/op-geth@v1.101105.2
|
||||
- github.com/ethereum-optimism/optimism
|
||||
- github.com/ethereum-optimism/op-geth
|
||||
containers:
|
||||
- cerc/go-ethereum
|
||||
- cerc/lighthouse
|
||||
- cerc/lighthouse-cli
|
||||
- cerc/fixturenet-eth-geth
|
||||
- cerc/fixturenet-eth-lighthouse
|
||||
- cerc/foundry
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# lasso
|
||||
|
||||
```
|
||||
laconic-so --stack lasso setup-repositories
|
||||
laconic-so --stack lasso build-containers
|
||||
laconic-so --stack lasso deploy up
|
||||
```
|
||||
@@ -1,8 +0,0 @@
|
||||
version: "0.1"
|
||||
name: lasso
|
||||
repos:
|
||||
- github.com/cerc-io/lasso
|
||||
containers:
|
||||
- cerc/lasso
|
||||
pods:
|
||||
- lasso
|
||||
@@ -1,88 +0,0 @@
|
||||
# Opera (Fantom)
|
||||
|
||||
Deploy a Fantom API node.
|
||||
|
||||
## Clone required repositories
|
||||
|
||||
```
|
||||
$ laconic-so --stack mainnet-go-opera setup-repositories
|
||||
```
|
||||
|
||||
## Build the fixturenet-eth containers
|
||||
|
||||
```
|
||||
$ laconic-so --stack mainnet-go-opera build-containers
|
||||
```
|
||||
|
||||
## Deploy the stack
|
||||
|
||||
```
|
||||
$ laconic-so --stack mainnet-go-opera deploy up
|
||||
```
|
||||
|
||||
## Check logs
|
||||
|
||||
```
|
||||
$ laconic-so --stack mainnet-go-opera deploy logs
|
||||
```
|
||||
|
||||
You'll see something like:
|
||||
|
||||
```
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | Connecting to download.fantom.network (65.108.45.88:443)
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | saving to 'mainnet-109331-no-history.g'
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | mainnet-109331-no-hi 100% |********************************| 16326 0:00:00 ETA
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | 'mainnet-109331-no-history.g' saved
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Maximum peer count total=50
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Genesis file is a known preset name="Mainnet-109331 without history"
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.052] Applying genesis state
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.052] - Reading epochs unit 0
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.054] - Reading blocks unit 0
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.530] Applied genesis state name=main id=250 genesis=0x4a53c5445584b3bfc20dbfb2ec18ae20037c716f3ba2d9e1da768a9deca17cb4
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.531] Regenerated local transaction journal transactions=0 accounts=0
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.532] Starting peer-to-peer node instance=go-opera/v1.1.2-rc.5-50cd051d-1677276206/linux-amd64/go1.19.10
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.536] New local node record seq=1 id=5e40f984908317cd ip=127.0.0.1 udp=5050 tcp=5050
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.537] Started P2P networking self=enode://3ffb15988ca5a79b63dbe48be89d9d8b48dc4845d318fe08231a0ab49d3b23476e2561044311dc257405f882f7c52ff7b128c8bd1b6d85cf7205a6fed6555443@127.0.0.1:5050
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.537] IPC endpoint opened url=/root/.opera/opera.ipc
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] HTTP server started endpoint=[::]:18545 prefix= cors=* vhosts=localhost
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] WebSocket enabled url=ws://[::]:18546
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Rebuilding state snapshot
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] EVM snapshot module=gossip-store at=000000..000000 generating=true
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Resuming state snapshot generation accounts=0 slots=0 storage=0.00B elapsed="189.74µs"
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Generated state snapshot accounts=0 slots=0 storage=0.00B elapsed="265.061µs"
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:34.788] New LLR summary last_epoch=0 last_block=37676611 new_evs=0 new_ers=0 new_bvs=64 new_brs=0 age=none
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:35.040] New local node record seq=2 id=5e40f984908317cd ip=186.233.184.56 udp=5050 tcp=5050
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:42.788] New LLR summary last_epoch=114604 last_block=37753891 new_evs=24581 new_ers=5272 new_bvs=233257 new_brs=780 age=1y1mo5d
|
||||
laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:50.827] New LLR summary last_epoch=115574 last_block=38118749 new_evs=4907 new_ers=971 new_bvs=1098760 new_brs=3768 age=1y1mo2d
|
||||
```
|
||||
|
||||
Consecutive lines of "New LLR summary" shows that your node is sync'ing.
|
||||
|
||||
## Use the opera admin console
|
||||
|
||||
```
|
||||
$ docker exec -it $(docker ps -q --filter "name=go-opera") /bin/sh
|
||||
```
|
||||
|
||||
then:
|
||||
|
||||
```
|
||||
$ ./opera attach
|
||||
```
|
||||
|
||||
and check the node info:
|
||||
|
||||
```
|
||||
> admin.nodeInfo
|
||||
```
|
||||
|
||||
Run `exit` twice to return to your terminal.
|
||||
|
||||
## Clean up
|
||||
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
$ laconic-so --stack mainnet-go-opera deploy down
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
version: "1.1"
|
||||
name: mainnet-opera
|
||||
decription: "Fantom mainnet node"
|
||||
repos:
|
||||
- github.com/Fantom-foundation/go-opera
|
||||
containers:
|
||||
- cerc/go-opera
|
||||
pods:
|
||||
- mainnet-go-opera
|
||||
@@ -18,6 +18,26 @@ laconic-so --stack mobymask-v2 setup-repositories
|
||||
NOTE: If repositories already exist and are checked out to different versions, `setup-repositories` command will throw an error.
|
||||
For getting around this, the repositories mentioned below can be removed and then run the command.
|
||||
|
||||
Checkout to the required versions and branches in repos
|
||||
|
||||
```bash
|
||||
# watcher-ts
|
||||
cd ~/cerc/watcher-ts
|
||||
git checkout v0.2.41
|
||||
|
||||
# mobymask-v2-watcher-ts
|
||||
cd ~/cerc/mobymask-v2-watcher-ts
|
||||
git checkout v0.1.1
|
||||
|
||||
# MobyMask
|
||||
cd ~/cerc/MobyMask
|
||||
git checkout v0.1.2
|
||||
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
@@ -31,21 +51,17 @@ Deploy the stack:
|
||||
* Deploy the containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 up
|
||||
laconic-so --stack mobymask-v2 deploy-system up
|
||||
```
|
||||
|
||||
NOTE: The `fixturenet-optimism-contracts` service takes a while to run to completion and it may restart a few times after running into errors.
|
||||
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
||||
|
||||
* To list down and monitor the running containers:
|
||||
NOTE: The `mobymask-app` container might not start; if the app is not running at http://localhost:3002, restart the container using it's id:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 ps
|
||||
docker ps -a | grep "mobymask-app"
|
||||
|
||||
# With status
|
||||
docker ps -a
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
docker restart <CONTAINER_ID>
|
||||
```
|
||||
|
||||
## Tests
|
||||
@@ -72,12 +88,11 @@ docker ps | grep -E 'mobymask-app|peer-test-app'
|
||||
|
||||
### mobymask-app
|
||||
|
||||
* The mobymask-app should be running at http://localhost:3002
|
||||
* The lxdao-mobymask-app should be running at http://localhost:3004
|
||||
The mobymask-app should be running at http://localhost:3002
|
||||
|
||||
### peer-test-app
|
||||
|
||||
* The peer-test-app should be running at http://localhost:3003
|
||||
The peer-test-app should be running at http://localhost:3003
|
||||
|
||||
## Details
|
||||
|
||||
@@ -96,15 +111,15 @@ Follow the [demo](./demo.md) to try out the MobyMask app with L2 chain
|
||||
Stop all the services running in background run:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 down 30
|
||||
laconic-so --stack mobymask-v2 deploy-system down 30
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter "name=mobymask_v2"
|
||||
docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*peers_ids|.*mobymask_deployment|.*l1_deployment|.*l2_accounts|.*l2_config|.*l2_geth_data"
|
||||
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter "name=mobymask_v2")
|
||||
docker volume rm $(docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*peers_ids|.*mobymask_deployment|.*l1_deployment|.*l2_accounts|.*l2_config|.*l2_geth_data")
|
||||
```
|
||||
|
||||
@@ -9,23 +9,23 @@
|
||||
The invite link is seen at the end of the logs. Example log:
|
||||
|
||||
```bash
|
||||
http://127.0.0.1:3004/#/members?invitation=%7B%22v%22%3A1%2C%22signedDelegations%22%3A%5B%7B%22signature%22%3A%220x7559bd412f02677d60820e38243acf61547f79339395a34f7d4e1630e645aeb30535fc219f79b6fbd3af0ce3bd05132ad46d2b274a9fbc4c36bc71edd09850891b%22%2C%22delegation%22%3A%7B%22delegate%22%3A%220xc0838c92B2b71756E0eAD5B3C1e1F186baeEAAac%22%2C%22authority%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%2C%22caveats%22%3A%5B%7B%22enforcer%22%3A%220x558024C7d593B840E1BfD83E9B287a5CDad4db15%22%2C%22terms%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%7D%5D%7D%7D%5D%2C%22key%22%3A%220x98da9805821f1802196443e578fd32af567bababa0a249c07c82df01ecaa7d8d%22%7D
|
||||
laconic-bfb01caf98b1b8f7c8db4d33f11b905a-mobymask-1 | http://127.0.0.1:3002/#/members?invitation=%7B%22v%22%3A1%2C%22signedDelegations%22%3A%5B%7B%22signature%22%3A%220x7559bd412f02677d60820e38243acf61547f79339395a34f7d4e1630e645aeb30535fc219f79b6fbd3af0ce3bd05132ad46d2b274a9fbc4c36bc71edd09850891b%22%2C%22delegation%22%3A%7B%22delegate%22%3A%220xc0838c92B2b71756E0eAD5B3C1e1F186baeEAAac%22%2C%22authority%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%2C%22caveats%22%3A%5B%7B%22enforcer%22%3A%220x558024C7d593B840E1BfD83E9B287a5CDad4db15%22%2C%22terms%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%7D%5D%7D%7D%5D%2C%22key%22%3A%220x98da9805821f1802196443e578fd32af567bababa0a249c07c82df01ecaa7d8d%22%7D
|
||||
```
|
||||
|
||||
* Open the invite link in a browser to use the mobymask-app.
|
||||
|
||||
NOTE: Before opening the invite link, clear the browser cache (local storage) for http://127.0.0.1:3004 to remove old invitations
|
||||
NOTE: Before opening the invite link, clear the browser cache (local storage) for http://127.0.0.1:3002 to remove old invitations
|
||||
|
||||
* In the debug panel, check if it is connected to the p2p network (it should be connected to at least one other peer for pubsub to work).
|
||||
|
||||
* Create an invite link in the app by clicking on `Create new invite link` button in the `My invitees` section.
|
||||
* Create an invite link in the app by clicking on `Create new invite link` button.
|
||||
|
||||
* Switch to the `MESSAGES` tab in debug panel for viewing incoming messages later.
|
||||
|
||||
* Open the invite link in a new browser with different profile (to simulate remote browser)
|
||||
* Check that it is connected to a peer in the network.
|
||||
* Check that it is connected to any other peer in the network.
|
||||
|
||||
* In the `Pending reports` section, enter multiple phisher records and click on the `Submit batch to p2p network` button. This broadcasts signed invocations to the connected peers.
|
||||
* In `Report a phishing attempt` section, report multiple phishers using the `Submit` button. Click on the `Submit batch to p2p network` button. This broadcasts signed invocations to the connected peers.
|
||||
|
||||
* In the `MESSAGES` tab of other browsers, a message can be seen with the signed invocations.
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
* Get the deployed contract address:
|
||||
|
||||
```bash
|
||||
docker exec -it $(docker ps -aq --filter name="lxdao-mobymask-app") cat /config/config.yml
|
||||
docker exec -it $(docker ps -aq --filter name="mobymask-app") cat /config/config.yml
|
||||
```
|
||||
|
||||
The value of `address` field is the deployed contract address
|
||||
@@ -91,14 +91,15 @@
|
||||
* Watcher internally is using L2 chain `eth_getStorageAt` method.
|
||||
|
||||
* Check the phisher name in mobymask app in `Check Phisher Status` section.
|
||||
* Watcher GQL API is used for checking phisher.
|
||||
* Watcher GQL API is used for checking phisher.
|
||||
|
||||
* Manage invitations in the `Outstanding invitations (p2p network)` tab in `My Invitations` section.
|
||||
* Revoke the created invitation by clicking on the `Revoke` button.
|
||||
* Manage the invitations by clicking on the `Outstanding Invitations in p2p network`.
|
||||
|
||||
* Revoke the created invitation by clicking on `Revoke (p2p network)`
|
||||
|
||||
* Revocation messages can be seen in the debug panel `MESSAGES` tab of other browsers.
|
||||
|
||||
* Also, check the watcher peer logs. It should receive a message and log the transaction receipt for a `revoke` message.
|
||||
* Check the watcher peer logs. It should receive a message and log the transaction receipt for a `revoke` message.
|
||||
|
||||
* Try reporting a phisher from the revoked invitee's browser.
|
||||
|
||||
|
||||
@@ -14,6 +14,22 @@ laconic-so --stack mobymask-v2 setup-repositories --include github.com/cerc-io/M
|
||||
# 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:
|
||||
|
||||
```bash
|
||||
# watcher-ts
|
||||
cd ~/cerc/watcher-ts
|
||||
git checkout v0.2.41
|
||||
|
||||
# mobymask-v2-watcher-ts
|
||||
cd ~/cerc/mobymask-v2-watcher-ts
|
||||
git checkout v0.1.1
|
||||
|
||||
# MobyMask
|
||||
cd ~/cerc/MobyMask
|
||||
git checkout v0.1.2
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
@@ -49,7 +65,7 @@ Create and update an env file to be used in the next step ([defaults](../../conf
|
||||
|
||||
# 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/#"
|
||||
CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3002/#"
|
||||
|
||||
# (Optional) Domain to be used in the relay node's announce address
|
||||
CERC_RELAY_ANNOUNCE_DOMAIN=
|
||||
@@ -72,16 +88,16 @@ Create and update an env file to be used in the next step ([defaults](../../conf
|
||||
### Deploy the stack
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include watcher-mobymask-v2 --env-file <PATH_TO_ENV_FILE> up
|
||||
laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 --env-file <PATH_TO_ENV_FILE> up
|
||||
```
|
||||
|
||||
To list down and monitor the running containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include watcher-mobymask-v2 ps
|
||||
laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 ps
|
||||
|
||||
# With status
|
||||
docker ps -a
|
||||
docker ps
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
@@ -108,15 +124,15 @@ For deploying the web-app(s) separately after deploying the watcher, follow [web
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include watcher-mobymask-v2 down
|
||||
laconic-so --stack mobymask-v2 deploy --include watcher-mobymask-v2 down
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter "name=mobymask_v2"
|
||||
docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*peers_ids|.*mobymask_deployment"
|
||||
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter "name=mobymask_v2")
|
||||
docker volume rm $(docker volume ls -q --filter "name=.*mobymask_watcher_db_data|.*peers_ids|.*mobymask_deployment")
|
||||
```
|
||||
|
||||
@@ -2,24 +2,21 @@ version: "1.0"
|
||||
name: mobymask-v2
|
||||
repos:
|
||||
- github.com/cerc-io/go-ethereum
|
||||
- github.com/cerc-io/lighthouse
|
||||
- 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/mobymask-v2-watcher-ts@v0.1.1
|
||||
- github.com/cerc-io/MobyMask@v0.1.2
|
||||
- github.com/ethereum-optimism/optimism
|
||||
- github.com/ethereum-optimism/op-geth
|
||||
- github.com/cerc-io/watcher-ts
|
||||
- github.com/cerc-io/mobymask-v2-watcher-ts
|
||||
- github.com/cerc-io/MobyMask
|
||||
containers:
|
||||
- cerc/go-ethereum
|
||||
- cerc/lighthouse
|
||||
- cerc/lighthouse-cli
|
||||
- cerc/fixturenet-eth-geth
|
||||
- cerc/fixturenet-eth-lighthouse
|
||||
- cerc/foundry
|
||||
- cerc/optimism-contracts
|
||||
- cerc/optimism-l2geth
|
||||
- cerc/optimism-op-batcher
|
||||
- cerc/optimism-op-proposer
|
||||
- cerc/optimism-op-node
|
||||
- cerc/watcher-ts
|
||||
- cerc/watcher-mobymask-v2
|
||||
|
||||
@@ -30,6 +30,22 @@ Clone required repositories:
|
||||
# 100%|##############################################################################################################################################| 1.41k/1.41k [00:18<00:00, 76.4B/s]
|
||||
```
|
||||
|
||||
Checkout to the required versions and branches in repos:
|
||||
|
||||
```bash
|
||||
# watcher-ts
|
||||
cd ~/cerc/watcher-ts
|
||||
git checkout v0.2.41
|
||||
|
||||
# mobymask-v2-watcher-ts
|
||||
cd ~/cerc/mobymask-v2-watcher-ts
|
||||
git checkout v0.1.1
|
||||
|
||||
# MobyMask
|
||||
cd ~/cerc/MobyMask
|
||||
git checkout v0.1.2
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -47,14 +47,14 @@ Create and update an env file to be used in the next step ([defaults](../../conf
|
||||
|
||||
For running mobymask-app
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include mobymask-app --env-file <PATH_TO_ENV_FILE> up
|
||||
laconic-so --stack mobymask-v2 deploy --include mobymask-app --env-file <PATH_TO_ENV_FILE> up
|
||||
|
||||
# Runs mobymask-app on host port 3002 and lxdao-mobymask-app on host port 3004
|
||||
```
|
||||
|
||||
For running peer-test-app
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include peer-test-app --env-file <PATH_TO_ENV_FILE> up
|
||||
laconic-so --stack mobymask-v2 deploy --include peer-test-app --env-file <PATH_TO_ENV_FILE> up
|
||||
|
||||
# Runs on host port 3003
|
||||
```
|
||||
@@ -62,10 +62,9 @@ laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include peer-test-
|
||||
To list down and monitor the running containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include [mobymask-app | peer-test-app] ps
|
||||
laconic-so --stack mobymask-v2 deploy --include [mobymask-app | peer-test-app] ps
|
||||
|
||||
# With status
|
||||
docker ps -a
|
||||
docker ps
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
@@ -81,20 +80,20 @@ Stop all services running in the background:
|
||||
|
||||
For mobymask-app
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include mobymask-app down
|
||||
laconic-so --stack mobymask-v2 deploy --include mobymask-app down
|
||||
```
|
||||
|
||||
For peer-test-app
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include peer-test-app down
|
||||
laconic-so --stack mobymask-v2 deploy --include peer-test-app down
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter "name=mobymask_v2"
|
||||
docker volume ls -q --filter "name=.*mobymask_deployment|.*peers_ids"
|
||||
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter "name=mobymask_v2")
|
||||
docker volume rm $(docker volume ls -q --filter "name=.*mobymask_deployment|.*peers_ids")
|
||||
```
|
||||
|
||||
@@ -69,26 +69,8 @@ def host_and_path_for_repo(fully_qualified_repo):
|
||||
return repo_host_split[0], "/".join(repo_host_split[1:]), repo_branch
|
||||
|
||||
|
||||
# See: https://stackoverflow.com/questions/18659425/get-git-current-branch-tag-name
|
||||
def _get_repo_current_branch_or_tag(full_filesystem_repo_path):
|
||||
current_repo_branch_or_tag = "***UNDETERMINED***"
|
||||
is_branch = False
|
||||
try:
|
||||
current_repo_branch_or_tag = git.Repo(full_filesystem_repo_path).active_branch.name
|
||||
is_branch = True
|
||||
except TypeError as error:
|
||||
# This means that the current ref is not a branch, so possibly a tag
|
||||
# Let's try to get the tag
|
||||
current_repo_branch_or_tag = git.Repo(full_filesystem_repo_path).git.describe("--tags", "--exact-match")
|
||||
# Note that git is assymetric -- the tag you told it to check out may not be the one
|
||||
# you get back here (if there are multiple tags associated with the same commit)
|
||||
return current_repo_branch_or_tag, is_branch
|
||||
|
||||
|
||||
# TODO: fix the messy arg list here
|
||||
def process_repo(verbose, quiet, dry_run, pull, check_only, git_ssh, dev_root_path, branches_array, fully_qualified_repo):
|
||||
if verbose:
|
||||
print(f"Processing repo: {fully_qualified_repo}")
|
||||
repo_host, repo_path, repo_branch = host_and_path_for_repo(fully_qualified_repo)
|
||||
git_ssh_prefix = f"git@{repo_host}:"
|
||||
git_http_prefix = f"https://{repo_host}/"
|
||||
@@ -96,9 +78,9 @@ def process_repo(verbose, quiet, dry_run, pull, check_only, git_ssh, dev_root_pa
|
||||
repoName = repo_path.split("/")[-1]
|
||||
full_filesystem_repo_path = os.path.join(dev_root_path, repoName)
|
||||
is_present = os.path.isdir(full_filesystem_repo_path)
|
||||
(current_repo_branch_or_tag, is_branch) = _get_repo_current_branch_or_tag(full_filesystem_repo_path) if is_present else (None, None)
|
||||
current_repo_branch = git.Repo(full_filesystem_repo_path).active_branch.name if is_present else None
|
||||
if not quiet:
|
||||
present_text = f"already exists active {'branch' if is_branch else 'tag'}: {current_repo_branch_or_tag}" if is_present \
|
||||
present_text = f"already exists active branch: {current_repo_branch}" if is_present \
|
||||
else 'Needs to be fetched'
|
||||
print(f"Checking: {full_filesystem_repo_path}: {present_text}")
|
||||
# Quick check that it's actually a repo
|
||||
@@ -111,12 +93,9 @@ def process_repo(verbose, quiet, dry_run, pull, check_only, git_ssh, dev_root_pa
|
||||
if verbose:
|
||||
print(f"Running git pull for {full_filesystem_repo_path}")
|
||||
if not check_only:
|
||||
if is_branch:
|
||||
git_repo = git.Repo(full_filesystem_repo_path)
|
||||
origin = git_repo.remotes.origin
|
||||
origin.pull(progress=None if quiet else GitProgress())
|
||||
else:
|
||||
print(f"skipping pull because this repo checked out a tag")
|
||||
git_repo = git.Repo(full_filesystem_repo_path)
|
||||
origin = git_repo.remotes.origin
|
||||
origin.pull(progress=None if quiet else GitProgress())
|
||||
else:
|
||||
print("(git pull skipped)")
|
||||
if not is_present:
|
||||
@@ -143,15 +122,14 @@ def process_repo(verbose, quiet, dry_run, pull, check_only, git_ssh, dev_root_pa
|
||||
branch_to_checkout = repo_branch
|
||||
|
||||
if branch_to_checkout:
|
||||
if current_repo_branch_or_tag is None or (current_repo_branch_or_tag and (current_repo_branch_or_tag != branch_to_checkout)):
|
||||
if current_repo_branch is None or (current_repo_branch and (current_repo_branch != branch_to_checkout)):
|
||||
if not quiet:
|
||||
print(f"switching to branch {branch_to_checkout} in repo {repo_path}")
|
||||
git_repo = git.Repo(full_filesystem_repo_path)
|
||||
# git checkout works for both branches and tags
|
||||
git_repo.git.checkout(branch_to_checkout)
|
||||
else:
|
||||
if verbose:
|
||||
print(f"repo {repo_path} is already on branch/tag {branch_to_checkout}")
|
||||
print(f"repo {repo_path} is already switched to branch {branch_to_checkout}")
|
||||
|
||||
|
||||
def parse_branches(branches_string):
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
# Used for easily testing stacks-in-development on cloud platforms
|
||||
# Assumes Ubuntu, edit the last line if targeting a different OS
|
||||
|
||||
# Once SSH'd into the server, run:
|
||||
# `$ cd stack-orchestrator`
|
||||
# `$ git checkout <branch>
|
||||
# `$ ./scripts/developer-mode-setup.sh`
|
||||
# `$ source ./venv/bin/activate`
|
||||
|
||||
# Followed by the stack instructions.
|
||||
|
||||
package_update: true
|
||||
package_upgrade: true
|
||||
|
||||
groups:
|
||||
- docker
|
||||
|
||||
system_info:
|
||||
default_user:
|
||||
groups: [ docker ]
|
||||
|
||||
packages:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- jq
|
||||
- git
|
||||
- gnupg
|
||||
- lsb-release
|
||||
- unattended-upgrades
|
||||
- python3.10-venv
|
||||
- pip
|
||||
|
||||
runcmd:
|
||||
- mkdir -p /etc/apt/keyrings
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
- apt-get update
|
||||
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
- systemctl enable docker
|
||||
- systemctl start docker
|
||||
- git clone https://github.com/cerc-io/stack-orchestrator.git /home/ubuntu/stack-orchestrator
|
||||
@@ -1,35 +0,0 @@
|
||||
#cloud-config
|
||||
|
||||
# Used for installing Stack Orchestrator on platforms that support `cloud-init`
|
||||
# Tested on Ubuntu
|
||||
|
||||
package_update: true
|
||||
package_upgrade: true
|
||||
|
||||
groups:
|
||||
- docker
|
||||
|
||||
system_info:
|
||||
default_user:
|
||||
groups: [ docker ]
|
||||
|
||||
packages:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- jq
|
||||
- git
|
||||
- gnupg
|
||||
- lsb-release
|
||||
- unattended-upgrades
|
||||
|
||||
runcmd:
|
||||
- mkdir -p /etc/apt/keyrings
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
- apt-get update
|
||||
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
- systemctl enable docker
|
||||
- systemctl start docker
|
||||
- curl -L -o /usr/local/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
|
||||
- chmod +x /usr/local/bin/laconic-so
|
||||
Reference in New Issue
Block a user