forked from cerc-io/stack-orchestrator
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a4f189286 | ||
|
|
aa01feb98a | ||
|
|
c4e3aa54f1 | ||
|
|
364a71d694 | ||
|
|
d96a6def14 | ||
|
|
1a75a270f5 | ||
|
|
23fab04ec8 | ||
|
|
4420f45924 | ||
|
|
dac22b19b7 | ||
|
|
08ed69e4cd | ||
|
|
84bad13934 | ||
|
|
c537d787c2 | ||
|
|
538bccd19a | ||
|
|
d5f5ecceda | ||
|
|
39741b2e8f | ||
|
|
2ce04afd1e | ||
|
|
48a761875a | ||
|
|
6ee7c3bbba | ||
|
|
4d3042bfcc | ||
|
|
49092305e4 | ||
|
|
5c3384c7ae | ||
|
|
b47d303ba4 | ||
|
|
abdf561704 | ||
|
|
8d3bca602a | ||
|
|
75e5c1d7f1 | ||
|
|
5b79195f86 | ||
|
|
139626ef8e | ||
|
|
f096c014ce | ||
|
|
49b9983b3a | ||
|
|
4fd9e71c84 |
@@ -8,11 +8,10 @@ Stack Orchestrator allows building and deployment of a Laconic Stack on a single
|
|||||||
|
|
||||||
Ensure that the following are already installed:
|
Ensure that the following are already installed:
|
||||||
|
|
||||||
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.10.8`
|
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.8.10` (the Python3 shipped in Ubuntu 20+ is good to go)
|
||||||
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
||||||
- [Docker Compose](https://docs.docker.com/compose/install/): `docker-compose --version` >= `2.13.0`
|
|
||||||
|
|
||||||
Note: if installing docker-compose via package manager (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g., on Linux:
|
Note: if installing docker-compose via package manager on Linux (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g. :
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.docker/cli-plugins
|
mkdir -p ~/.docker/cli-plugins
|
||||||
@@ -20,39 +19,27 @@ curl -SL https://github.com/docker/compose/releases/download/v2.11.2/docker-comp
|
|||||||
chmod +x ~/.docker/cli-plugins/docker-compose
|
chmod +x ~/.docker/cli-plugins/docker-compose
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, download the latest release from [this page](https://github.com/cerc-io/stack-orchestrator/tags), into a suitable directory (e.g. `~/bin`):
|
Next decide on a directory where you would like to put the stack-orchestrator program. Typically this would be
|
||||||
|
a "user" binary directory such as `~/bin` or perhaps `/usr/local/laconic` or possibly just the current working directory.
|
||||||
|
|
||||||
|
Now, having selected that directory, download the latest release from [this page](https://github.com/cerc-io/stack-orchestrator/tags) into it (we're using `~/bin` below for concreteness but edit to suit if you selected a different directory). Also be sure that the destination directory exists and is writable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -L -o ~/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
|
curl -L -o ~/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
|
||||||
```
|
```
|
||||||
|
|
||||||
Give it permissions:
|
Give it execute permissions:
|
||||||
```bash
|
```bash
|
||||||
chmod +x ~/bin/laconic-so
|
chmod +x ~/bin/laconic-so
|
||||||
```
|
```
|
||||||
|
|
||||||
Ensure `laconic-so` is on the [`PATH`](https://unix.stackexchange.com/a/26059)
|
Ensure `laconic-so` is on the [`PATH`](https://unix.stackexchange.com/a/26059)
|
||||||
|
|
||||||
Verify operation:
|
Verify operation (your version will probably be different, just check here that you see some version outut and not an error):
|
||||||
|
|
||||||
```
|
```
|
||||||
laconic-so --help
|
laconic-so version
|
||||||
Usage: python -m laconic-so [OPTIONS] COMMAND [ARGS]...
|
Version: v1.0.27-7831078
|
||||||
|
|
||||||
Laconic Stack Orchestrator
|
|
||||||
|
|
||||||
Options:
|
|
||||||
--quiet
|
|
||||||
--verbose
|
|
||||||
--dry-run
|
|
||||||
--local-stack
|
|
||||||
-h, --help Show this message and exit.
|
|
||||||
|
|
||||||
Commands:
|
|
||||||
build-containers build the set of containers required for a complete...
|
|
||||||
build-npms build the set of npm packages required for a...
|
|
||||||
deploy-system deploy a stack
|
|
||||||
setup-repositories git clone the set of repositories required to build...
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -64,25 +51,25 @@ Three sub-commands: `setup-repositories`, `build-containers` and `deploy-system`
|
|||||||
Clone the set of git repositories necessary to build a system:
|
Clone the set of git repositories necessary to build a system:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --verbose setup-repositories --include cerc-io/go-ethereum,cerc-io/ipld-eth-db,cerc-io/ipld-eth-server,cerc-io/watcher-ts
|
laconic-so --stack erc20 setup-repositories
|
||||||
```
|
```
|
||||||
|
|
||||||
This will default to `~/cerc` or - if set - the environment variable `CERC_REPO_BASE_DIR`
|
This will default to cloning git reposiories into: `~/cerc` or - if set - the environment variable `CERC_REPO_BASE_DIR`
|
||||||
|
|
||||||
### Build Containers
|
### Build Containers
|
||||||
|
|
||||||
Build the set of docker container images required to run a system. It takes around 10 minutes to build all the containers from scratch.
|
Build the set of docker container images required to run a system. It takes around 10 minutes to build all the containers from scratch.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --verbose build-containers --include cerc/go-ethereum,cerc/go-ethereum-foundry,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/watcher-erc20
|
laconic-so --stack erc20 build-containers
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploy System
|
### Deploy System
|
||||||
|
|
||||||
Uses `docker-compose` to deploy a system (with most recently built container images).
|
Uses `docker compose` to deploy a system (with most recently built container images).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --verbose deploy-system --include ipld-eth-db,go-ethereum-foundry,ipld-eth-server,watcher-erc20 up
|
laconic-so --stack erc20 deploy-system up
|
||||||
```
|
```
|
||||||
|
|
||||||
Check out he GraphQL playground here: [http://localhost:3002/graphql](http://localhost:3002/graphql)
|
Check out he GraphQL playground here: [http://localhost:3002/graphql](http://localhost:3002/graphql)
|
||||||
@@ -92,7 +79,7 @@ See the [erc20 watcher demo](/app/data/stacks/erc20) to continue further.
|
|||||||
### Cleanup
|
### Cleanup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --verbose deploy-system --include ipld-eth-db,go-ethereum-foundry,ipld-eth-server,watcher-erc20 down
|
laconic-so --stack erc20 deploy-system down
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Add-on pod to include foundry tooling within a fixturenet
|
# Add-on pod to include foundry tooling within a fixturenet
|
||||||
services:
|
services:
|
||||||
foundry:
|
foundry:
|
||||||
image: ghcr.io/foundry-rs/foundry:latest
|
image: cerc/foundry:local
|
||||||
command: ["while :; do sleep 600; done"]
|
command: ["while :; do sleep 600; done"]
|
||||||
|
volumes:
|
||||||
|
- ../config/foundry/foundry.toml:/foundry.toml
|
||||||
|
- ./foundry/workspace:/workspace
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
version: '3.2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mobymask-watcher-db:
|
||||||
|
restart: unless-stopped
|
||||||
|
image: postgres:14-alpine
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=vdbm
|
||||||
|
- POSTGRES_MULTIPLE_DATABASES=mobymask-watcher,mobymask-watcher-job-queue
|
||||||
|
- POSTGRES_EXTENSION=mobymask-watcher-job-queue:pgcrypto
|
||||||
|
- POSTGRES_PASSWORD=password
|
||||||
|
volumes:
|
||||||
|
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
|
||||||
|
- mobymask_watcher_db_data:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "0.0.0.0:15432:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 15
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
|
mobymask-watcher-server:
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
mobymask-watcher-db:
|
||||||
|
condition: service_healthy
|
||||||
|
image: cerc/watcher-mobymask-v2:local
|
||||||
|
command: ["sh", "-c", "yarn server"]
|
||||||
|
volumes:
|
||||||
|
- ../config/watcher-mobymask-v2/watcher.toml:/app/packages/mobymask-v2-watcher/environments/local.toml
|
||||||
|
- ../config/watcher-mobymask-v2/.env:/app/packages/peer/.env
|
||||||
|
- ../config/watcher-mobymask-v2/relay-id.json:/app/packages/mobymask-v2-watcher/relay-id.json
|
||||||
|
ports:
|
||||||
|
- "0.0.0.0:3001:3001"
|
||||||
|
- "0.0.0.0:9001:9001"
|
||||||
|
- "0.0.0.0:9090:9090"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-v", "localhost", "9090"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 15
|
||||||
|
start_period: 5s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mobymask_watcher_db_data:
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
# Originally from: https://github.com/cerc-io/laconicd/blob/main/init.sh
|
|
||||||
# TODO: fold this back into the laconicd repo
|
|
||||||
|
|
||||||
|
# TODO: this file is now an unmodified copy of cerc-io/laconicd/init.sh
|
||||||
|
# so we should have a mechanism to bundle it inside the container rather than link from here
|
||||||
|
# at deploy time.
|
||||||
|
|
||||||
KEY="mykey"
|
KEY="mykey"
|
||||||
CHAINID="laconic_9000-1"
|
CHAINID="laconic_9000-1"
|
||||||
@@ -10,7 +10,7 @@ MONIKER="localtestnet"
|
|||||||
KEYRING="test"
|
KEYRING="test"
|
||||||
KEYALGO="eth_secp256k1"
|
KEYALGO="eth_secp256k1"
|
||||||
LOGLEVEL="info"
|
LOGLEVEL="info"
|
||||||
# to trace evm
|
# trace evm
|
||||||
TRACE="--trace"
|
TRACE="--trace"
|
||||||
# TRACE=""
|
# TRACE=""
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ laconicd config chain-id $CHAINID
|
|||||||
# if $KEY exists it should be deleted
|
# if $KEY exists it should be deleted
|
||||||
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
||||||
|
|
||||||
# Set moniker and chain-id for laconic (Moniker can be anything, chain-id must be an integer)
|
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||||
laconicd init $MONIKER --chain-id $CHAINID
|
laconicd init $MONIKER --chain-id $CHAINID
|
||||||
|
|
||||||
# Change parameter token denominations to aphoton
|
# Change parameter token denominations to aphoton
|
||||||
@@ -37,28 +37,28 @@ cat $HOME/.laconicd/config/genesis.json | jq '.app_state["crisis"]["constant_fee
|
|||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
# Custom modules
|
# Custom modules
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
|
||||||
if [[ "$TEST_NAMESERVICE_EXPIRY" == "true" ]]; then
|
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
||||||
echo "Setting timers for expiry tests."
|
echo "Setting timers for expiry tests."
|
||||||
|
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["record_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_grace_period"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
||||||
echo "Enabling auction and setting timers."
|
echo "Enabling auction and setting timers."
|
||||||
|
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_enabled"]=true' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_enabled"]=true' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_grace_period"]="300s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="300s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# increase block time (?)
|
# increase block time (?)
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[profile.default]
|
||||||
|
eth-rpc-url = "http://fixturenet-eth-geth-1:8545"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
RELAY="/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct/p2p/12D3KooWSPCsVkHVyLQoCqhu2YRPvvM7o6r6NRYyLM5zeA6Uig5t"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"relayNodes": [
|
||||||
|
"/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct/p2p/12D3KooWSPCsVkHVyLQoCqhu2YRPvvM7o6r6NRYyLM5zeA6Uig5t"
|
||||||
|
],
|
||||||
|
"peer": {
|
||||||
|
"enableDebugInfo": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"id": "12D3KooWSPCsVkHVyLQoCqhu2YRPvvM7o6r6NRYyLM5zeA6Uig5t",
|
||||||
|
"privKey": "CAESQGsqG5o4VlWJZM9XlA3MjabyZOXWQ2MLZU5AhBQsjXGt9iSlGtTuNOrHX5xSRgLBxLuMoqWsjGxE/dDB9c46RI8=",
|
||||||
|
"pubKey": "CAESIPYkpRrU7jTqx1+cUkYCwcS7jKKlrIxsRP3QwfXOOkSP"
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
[server]
|
||||||
|
host = "0.0.0.0"
|
||||||
|
port = 3001
|
||||||
|
kind = "lazy"
|
||||||
|
|
||||||
|
# Checkpointing state.
|
||||||
|
checkpointing = true
|
||||||
|
|
||||||
|
# Checkpoint interval in number of blocks.
|
||||||
|
checkpointInterval = 2000
|
||||||
|
|
||||||
|
# Enable state creation
|
||||||
|
enableState = true
|
||||||
|
|
||||||
|
# Boolean to filter logs by contract.
|
||||||
|
filterLogs = true
|
||||||
|
|
||||||
|
# Max block range for which to return events in eventsInRange GQL query.
|
||||||
|
# Use -1 for skipping check on block range.
|
||||||
|
maxEventsBlockRange = -1
|
||||||
|
|
||||||
|
[server.p2p]
|
||||||
|
enableRelay = true
|
||||||
|
enablePeer = false
|
||||||
|
|
||||||
|
[server.p2p.relay]
|
||||||
|
host = "0.0.0.0"
|
||||||
|
port = 9090
|
||||||
|
relayPeers = []
|
||||||
|
peerIdFile = './relay-id.json'
|
||||||
|
enableDebugInfo = true
|
||||||
|
|
||||||
|
[server.p2p.peer]
|
||||||
|
relayMultiaddr = '/ip4/mobymask-watcher-server/tcp/9090/http/p2p-webrtc-direct/p2p/12D3KooWSPCsVkHVyLQoCqhu2YRPvvM7o6r6NRYyLM5zeA6Uig5t'
|
||||||
|
pubSubTopic = 'mobymask'
|
||||||
|
peerIdFile = './peer-id.json'
|
||||||
|
enableDebugInfo = true
|
||||||
|
|
||||||
|
[metrics]
|
||||||
|
host = "0.0.0.0"
|
||||||
|
port = 9000
|
||||||
|
[metrics.gql]
|
||||||
|
port = 9001
|
||||||
|
|
||||||
|
[database]
|
||||||
|
type = "postgres"
|
||||||
|
host = "mobymask-watcher-db"
|
||||||
|
port = 5432
|
||||||
|
database = "mobymask-watcher"
|
||||||
|
username = "vdbm"
|
||||||
|
password = "password"
|
||||||
|
synchronize = true
|
||||||
|
logging = false
|
||||||
|
|
||||||
|
[upstream]
|
||||||
|
[upstream.ethServer]
|
||||||
|
gqlApiEndpoint = "http://ipld-eth-server:8083/graphql"
|
||||||
|
rpcProviderEndpoint = "http://ipld-eth-server:8082"
|
||||||
|
blockDelayInMilliSecs = 60000
|
||||||
|
|
||||||
|
[upstream.cache]
|
||||||
|
name = "requests"
|
||||||
|
enabled = false
|
||||||
|
deleteOnStart = false
|
||||||
|
|
||||||
|
[jobQueue]
|
||||||
|
dbConnectionString = "postgres://vdbm:password@mobymask-watcher-db/mobymask-watcher-job-queue"
|
||||||
|
maxCompletionLagInSecs = 300
|
||||||
|
jobDelayInMilliSecs = 100
|
||||||
|
eventsInBatch = 50
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
|
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
|
||||||
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local
|
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local
|
||||||
# npm registry for all packages in a spcific scope (currently @cerc-io)
|
# npm registry for all packages in a spcific scope (currently @cerc-io and @lirewine)
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
@@ -17,18 +17,21 @@ fi
|
|||||||
set -e
|
set -e
|
||||||
local_npm_registry_url=$1
|
local_npm_registry_url=$1
|
||||||
package_publish_version=$2
|
package_publish_version=$2
|
||||||
# TODO: make this a paramater and allow a list of scopes
|
# If we need to handle an additional scope, add it to the list below:
|
||||||
npm_scope_for_local="@cerc-io"
|
npm_scopes_to_handle=("@cerc-io" "@lirewine")
|
||||||
# We need to configure the local registry
|
for npm_scope_for_local in ${npm_scopes_to_handle[@]}
|
||||||
npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url}
|
|
||||||
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
|
||||||
# Find the set of dependencies from the specified scope
|
|
||||||
mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]')
|
|
||||||
echo "Fixing up dependencies"
|
|
||||||
for package in "${dependencies_from_scope[@]}"
|
|
||||||
do
|
do
|
||||||
echo "Fixing up package ${package}"
|
# We need to configure the local registry
|
||||||
yarn-local-registry-fixup.sh $package ${local_npm_registry_url}
|
npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url}
|
||||||
|
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||||
|
# Find the set of dependencies from the specified scope
|
||||||
|
mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]')
|
||||||
|
echo "Fixing up dependencies in scope ${npm_scope_for_local}"
|
||||||
|
for package in "${dependencies_from_scope[@]}"
|
||||||
|
do
|
||||||
|
echo "Fixing up package ${package}"
|
||||||
|
yarn-local-registry-fixup.sh $package ${local_npm_registry_url}
|
||||||
|
done
|
||||||
done
|
done
|
||||||
echo "Running build"
|
echo "Running build"
|
||||||
build-npm-package.sh ${local_npm_registry_url} ${package_publish_version}
|
build-npm-package.sh ${local_npm_registry_url} ${package_publish_version}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ set -e
|
|||||||
# Get the name of this package from package.json since we weren't passed that
|
# Get the name of this package from package.json since we weren't passed that
|
||||||
package_name=$( cat package.json | jq -r .name )
|
package_name=$( cat package.json | jq -r .name )
|
||||||
local_npm_registry_url=$1
|
local_npm_registry_url=$1
|
||||||
npm config set @lirewine:registry ${local_npm_registry_url}
|
|
||||||
npm config set @cerc-io:registry ${local_npm_registry_url}
|
npm config set @cerc-io:registry ${local_npm_registry_url}
|
||||||
|
npm config set @lirewine:registry ${local_npm_registry_url}
|
||||||
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||||
# First check if the version of this package we're trying to build already exists in the registry
|
# First check if the version of this package we're trying to build already exists in the registry
|
||||||
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
|
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if [ -z "$GETH_BASE_URL" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function inc_status() {
|
function inc_status() {
|
||||||
echo " DONE!"
|
echo " done"
|
||||||
STATUS=$((STATUS + 1))
|
STATUS=$((STATUS + 1))
|
||||||
if [ $STATUS -lt ${#STATUSES[@]} ]; then
|
if [ $STATUS -lt ${#STATUSES[@]} ]; then
|
||||||
echo -n "Waiting for ${STATUSES[$STATUS]}..."
|
echo -n "Waiting for ${STATUSES[$STATUS]}..."
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build a local version of the foundry-rs/foundry image
|
||||||
|
docker build -t cerc/foundry:local -f ${CERC_REPO_BASE_DIR}/foundry/Dockerfile-debian ${CERC_REPO_BASE_DIR}/foundry
|
||||||
@@ -40,8 +40,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|||||||
# RUN su node -c "npm install -g <your-package-list-here>"
|
# RUN su node -c "npm install -g <your-package-list-here>"
|
||||||
|
|
||||||
# Configure the local npm registry
|
# Configure the local npm registry
|
||||||
RUN npm config set @lirewine:registry ${CERC_NPM_URL} \
|
RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \
|
||||||
&& npm config set @cerc-io:registry ${CERC_NPM_URL} \
|
|
||||||
&& npm config set @lirewine:registry ${CERC_NPM_URL} \
|
&& npm config set @lirewine:registry ${CERC_NPM_URL} \
|
||||||
&& npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
&& npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
FROM node:18.15.0-alpine3.16
|
||||||
|
|
||||||
|
RUN apk --update --no-cache add make git
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN echo "Building mobymask-ui" && \
|
||||||
|
npm install
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build cerc/mobymask-ui
|
||||||
|
|
||||||
|
# See: https://stackoverflow.com/a/246128/1701505
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
docker build -t cerc/mobymask-ui:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/mobymask-ui
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
FROM node:18.15.0-alpine3.16
|
||||||
|
|
||||||
|
RUN apk --update --no-cache add make git
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN echo "Building react-peer" && \
|
||||||
|
yarn && yarn workspace @cerc-io/react-peer build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build cerc/react-peer
|
||||||
|
|
||||||
|
# See: https://stackoverflow.com/a/246128/1701505
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
docker build -t cerc/react-peer:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/react-peer
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y curl gnupg build-essential \
|
||||||
|
&& curl --silent --location https://deb.nodesource.com/setup_18.x | bash - \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y nodejs git \
|
||||||
|
&& node -v
|
||||||
|
|
||||||
|
RUN corepack enable \
|
||||||
|
&& yarn --version
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN echo "Building watcher-ts" && \
|
||||||
|
yarn && yarn build
|
||||||
|
|
||||||
|
WORKDIR /app/packages/mobymask-v2-watcher
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build cerc/watcher-mobymask-v2
|
||||||
|
|
||||||
|
# See: https://stackoverflow.com/a/246128/1701505
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
docker build -t cerc/watcher-mobymask-v2:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/watcher-ts
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build foundry-rs/foundry
|
|
||||||
# HACK below : TARGETARCH needs to be derived from the host environment
|
|
||||||
docker build -t foundry-rs/foundry:local ${CERC_REPO_BASE_DIR}/foundry
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
foundry-rs/foundry
|
cerc/foundry
|
||||||
cerc/test-contract
|
cerc/test-contract
|
||||||
cerc/eth-statediff-fill-service
|
cerc/eth-statediff-fill-service
|
||||||
cerc/eth-statediff-service
|
cerc/eth-statediff-service
|
||||||
@@ -18,6 +18,9 @@ cerc/watcher-erc20
|
|||||||
cerc/watcher-erc721
|
cerc/watcher-erc721
|
||||||
cerc/watcher-uniswap-v3
|
cerc/watcher-uniswap-v3
|
||||||
cerc/uniswap-v3-info
|
cerc/uniswap-v3-info
|
||||||
|
cerc/watcher-mobymask-v2
|
||||||
|
cerc/react-peer
|
||||||
|
cerc/mobymask-ui
|
||||||
cerc/test-container
|
cerc/test-container
|
||||||
cerc/eth-probe
|
cerc/eth-probe
|
||||||
cerc/builder-js
|
cerc/builder-js
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
gem
|
|
||||||
laconic-sdk
|
laconic-sdk
|
||||||
debug
|
|
||||||
laconic-registry-cli
|
laconic-registry-cli
|
||||||
|
gem
|
||||||
|
debug
|
||||||
|
crypto
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ watcher-mobymask
|
|||||||
watcher-erc20
|
watcher-erc20
|
||||||
watcher-erc721
|
watcher-erc721
|
||||||
watcher-uniswap-v3
|
watcher-uniswap-v3
|
||||||
|
watcher-mobymask-v2
|
||||||
test
|
test
|
||||||
eth-probe
|
eth-probe
|
||||||
keycloak
|
keycloak
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ cerc-io/laconic-sdk
|
|||||||
cerc-io/laconic-registry-cli
|
cerc-io/laconic-registry-cli
|
||||||
cerc-io/mobymask-watcher
|
cerc-io/mobymask-watcher
|
||||||
cerc-io/watcher-ts
|
cerc-io/watcher-ts
|
||||||
|
cerc-io/react-peer
|
||||||
|
cerc-io/mobymask-ui
|
||||||
vulcanize/uniswap-watcher-ts
|
vulcanize/uniswap-watcher-ts
|
||||||
vulcanize/uniswap-v3-info
|
vulcanize/uniswap-v3-info
|
||||||
vulcanize/assemblyscript
|
vulcanize/assemblyscript
|
||||||
cerc-io/eth-probe
|
cerc-io/eth-probe
|
||||||
cerc-io/tx-spammer
|
cerc-io/tx-spammer
|
||||||
foundry-rs/foundry
|
dboreham/foundry
|
||||||
|
lirewine/gem
|
||||||
|
lirewine/debug
|
||||||
|
lirewine/crypto
|
||||||
|
|||||||
@@ -24,8 +24,32 @@ $ laconic-so --stack build-support build-containers --exclude cerc/builder-gerbi
|
|||||||
```
|
```
|
||||||
$ laconic-so --stack package-registry setup-repositories
|
$ laconic-so --stack package-registry setup-repositories
|
||||||
$ laconic-so --stack package-registry deploy up
|
$ laconic-so --stack package-registry deploy up
|
||||||
|
[+] Running 3/3
|
||||||
|
⠿ Network laconic-aecc4a21d3a502b14522db97d427e850_gitea Created 0.0s
|
||||||
|
⠿ Container laconic-aecc4a21d3a502b14522db97d427e850-db-1 Started 1.2s
|
||||||
|
⠿ Container laconic-aecc4a21d3a502b14522db97d427e850-server-1 Started 1.9s
|
||||||
|
New user 'gitea_admin' has been successfully created!
|
||||||
This is your gitea access token: 84fe66a73698bf11edbdccd0a338236b7d1d5c45. Keep it safe and secure, it can not be fetched again from gitea.
|
This is your gitea access token: 84fe66a73698bf11edbdccd0a338236b7d1d5c45. Keep it safe and secure, it can not be fetched again from gitea.
|
||||||
|
To use with laconic-so set this environment variable: export CERC_NPM_AUTH_TOKEN=3e493e77b3e83fe9e882f7e3a79dd4d5441c308b
|
||||||
|
Created the organization cerc-io
|
||||||
|
Gitea was configured to use host name: gitea.local, ensure that this resolves to localhost, e.g. with sudo vi /etc/hosts
|
||||||
|
Success, gitea is properly initialized
|
||||||
|
$
|
||||||
```
|
```
|
||||||
|
### 3. Configure the hostname gitea.local
|
||||||
|
How to do this is OS-dependent but usually involves editing a `hosts` file. For example on Linux add this line to the file `/etc/hosts` (needs sudo):
|
||||||
|
```
|
||||||
|
127.0.0.1 gitea.local
|
||||||
|
```
|
||||||
|
Test with:
|
||||||
|
```
|
||||||
|
$ ping gitea.local
|
||||||
|
PING gitea.local (127.0.0.1) 56(84) bytes of data.
|
||||||
|
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.147 ms
|
||||||
|
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.033 ms
|
||||||
|
```
|
||||||
|
Although not necessary in order to build and publish packages, you can now access the Gitea web interface at: [http://gitea.local:3000](http://gitea.local:3000) using these credentials: gitea_admin/admin1234 (Note: please properly secure Gitea if public internet access is allowed).
|
||||||
|
|
||||||
Now npm packages can be built:
|
Now npm packages can be built:
|
||||||
### Build npm Packages
|
### Build npm Packages
|
||||||
Ensure that `CERC_NPM_AUTH_TOKEN` is set with the token printed above when the package-registry stack was deployed (the actual token value will be different than shown in this example):
|
Ensure that `CERC_NPM_AUTH_TOKEN` is set with the token printed above when the package-registry stack was deployed (the actual token value will be different than shown in this example):
|
||||||
|
|||||||
@@ -20,27 +20,31 @@ This should create several container images in the local image registry:
|
|||||||
|
|
||||||
## Deploy the stack
|
## Deploy the stack
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-eth deploy-system up
|
$ laconic-so --stack fixturenet-eth deploy up
|
||||||
```
|
```
|
||||||
|
|
||||||
## Check status
|
## Check status
|
||||||
|
|
||||||
```
|
```
|
||||||
$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh
|
$ laconic-so --stack fixturenet-eth deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh
|
||||||
Waiting for geth to generate DAG ..................................................... DONE!
|
Waiting for geth to generate DAG.... done
|
||||||
Waiting for beacon phase0 .... DONE!
|
Waiting for beacon phase0.... done
|
||||||
Waiting for beacon altair .... DONE!
|
Waiting for beacon altair.... done
|
||||||
Waiting for beacon bellatrix pre-merge .... DONE!
|
Waiting for beacon bellatrix pre-merge.... done
|
||||||
Waiting for beacon bellatrix merge .... DONE!
|
Waiting for beacon bellatrix merge.... done
|
||||||
|
|
||||||
$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort
|
$ laconic-so --stack fixturenet-eth deploy ps
|
||||||
NAMES PORTS
|
Running containers:
|
||||||
fixturenet-eth-bootnode-geth-1 8545-8546/tcp, 30303/udp, 0.0.0.0:55847->9898/tcp, 0.0.0.0:55848->30303/tcp
|
id: c6538b60c0328dadfa2c5585c4d09674a6a13e6d712ff1cd82a26849e4e5679b, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-geth-1, ports: 0.0.0.0:58909->30303/tcp, 0.0.0.0:58910->9898/tcp
|
||||||
fixturenet-eth-bootnode-lighthouse-1
|
id: 5b70597a8211bc7e78d33e50486cb565a7f4a9ce581ce150b3bb450e342bdeda, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-lighthouse-1, ports:
|
||||||
fixturenet-eth-geth-1-1 8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:55851->8545/tcp
|
id: 19ed78867b6c534d893835cdeb1e89a9ea553b8e8c02ab02468e4bd1563a340f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-1-1, ports: 0.0.0.0:58911->40000/tcp, 0.0.0.0:58912->6060/tcp, 0.0.0.0:58913->8545/tcp
|
||||||
fixturenet-eth-geth-2-1 8545-8546/tcp, 30303/tcp, 30303/udp
|
id: 8da0e30a1ce33122d8fd2225e4d26c7f30eb4bfbfa743f2af04d9db5d0bf7fa6, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-2-1, ports:
|
||||||
fixturenet-eth-lighthouse-1-1 0.0.0.0:55858->8001/tcp
|
id: 387a42a14971034588ba9aeb9b9e2ca7fc0cc61b96f8fe8c2ab770c9d6fb1e0f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-1-1, ports: 0.0.0.0:58917->8001/tcp
|
||||||
fixturenet-eth-lighthouse-2-1
|
id: de5115bf89087bae03b291664a73ffe3554fe23e79e4b8345e088b040d5580ac, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-2-1, ports:
|
||||||
|
id: 2a7e5a0fb2be7fc9261a7b725a40818facbbe6d0cb2497d82c0e02de0a8e959b, name: laconic-b12fa16e999821562937781f8ab0b1e8-foundry-1, ports:
|
||||||
|
|
||||||
|
$ laconic-so --stack fixturenet-eth deploy exec foundry "cast block-number"
|
||||||
|
3
|
||||||
```
|
```
|
||||||
|
|
||||||
## Additional pieces
|
## Additional pieces
|
||||||
@@ -69,11 +73,11 @@ $ laconic-so deploy-system --include db,fixturenet-eth,ipld-eth-server,ipld-eth-
|
|||||||
# Status
|
# Status
|
||||||
|
|
||||||
$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh
|
$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh
|
||||||
Waiting for geth to generate DAG.... DONE!
|
Waiting for geth to generate DAG.... done
|
||||||
Waiting for beacon phase0.... DONE!
|
Waiting for beacon phase0.... done
|
||||||
Waiting for beacon altair.... DONE!
|
Waiting for beacon altair.... done
|
||||||
Waiting for beacon bellatrix pre-merge.... DONE!
|
Waiting for beacon bellatrix pre-merge.... done
|
||||||
Waiting for beacon bellatrix merge.... DONE!
|
Waiting for beacon bellatrix merge.... done
|
||||||
|
|
||||||
$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort
|
$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort
|
||||||
NAMES PORTS
|
NAMES PORTS
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ decription: "Ethereum Fixturenet"
|
|||||||
repos:
|
repos:
|
||||||
- cerc-io/go-ethereum
|
- cerc-io/go-ethereum
|
||||||
- cerc-io/tx-spammer
|
- cerc-io/tx-spammer
|
||||||
|
- dboreham/foundry
|
||||||
containers:
|
containers:
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
- cerc/lighthouse
|
- cerc/lighthouse
|
||||||
- cerc/fixturenet-eth-geth
|
- cerc/fixturenet-eth-geth
|
||||||
- cerc/fixturenet-eth-lighthouse
|
- cerc/fixturenet-eth-lighthouse
|
||||||
|
- cerc/foundry
|
||||||
pods:
|
pods:
|
||||||
- fixturenet-eth
|
- fixturenet-eth
|
||||||
- foundry
|
- foundry
|
||||||
|
|||||||
@@ -44,7 +44,5 @@ $ laconic-so --stack fixturenet-laconicd deploy logs
|
|||||||
```
|
```
|
||||||
## 6. Test with the Registry CLI
|
## 6. Test with the Registry CLI
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconicd deploy exec laconicd "sh /docker-entrypoint-scripts.d/export-mykey.sh"
|
|
||||||
$ laconic-so --stack fixturenet-laconicd deploy exec cli "sh /scripts/import-key.sh xxxxxxxxxxxxxxxxxxxxxxx"
|
|
||||||
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
|
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# MobyMask v2 watcher
|
||||||
|
|
||||||
|
Instructions to deploy MobyMask v2 watcher stack using [laconic-stack-orchestrator](/README.md#install)
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Clone required repositories:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack mobymask-v2 setup-repositories
|
||||||
|
```
|
||||||
|
|
||||||
|
Build the container images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack mobymask-v2 build-containers
|
||||||
|
```
|
||||||
|
|
||||||
|
This should create the required docker images in the local image registry.
|
||||||
|
|
||||||
|
Deploy the stack:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack mobymask-v2 deploy-system up
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
Find the watcher container's id:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker ps | grep "cerc/watcher-mobymask-v2:local"
|
||||||
|
```
|
||||||
|
|
||||||
|
Example output
|
||||||
|
|
||||||
|
```
|
||||||
|
8b38e9a64d7e cerc/watcher-mobymask-v2:local "sh -c 'yarn server'" 35 seconds ago Up 14 seconds (health: starting) 0.0.0.0:3001->3001/tcp, 0.0.0.0:9001->9001/tcp, 0.0.0.0:9090->9090/tcp laconic-aeb84676de2b0a7671ae90d537fc7d26-mobymask-watcher-server-1
|
||||||
|
```
|
||||||
|
|
||||||
|
In above output the container ID is `8b38e9a64d7e`
|
||||||
|
|
||||||
|
Export it for later use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export CONTAINER_ID=<CONTAINER_ID>
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the peer tests:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -w /app/packages/peer $CONTAINER_ID yarn test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Clean up
|
||||||
|
|
||||||
|
To stop all the services running in background run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so --stack mobymask-v2 deploy-system down
|
||||||
|
```
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
version: "1.0"
|
||||||
|
name: mobymask-v2
|
||||||
|
repos:
|
||||||
|
- cerc-io/watcher-ts
|
||||||
|
- cerc-io/react-peer
|
||||||
|
- cerc-io/mobymask-ui
|
||||||
|
containers:
|
||||||
|
- cerc/watcher-mobymask-v2
|
||||||
|
- cerc/mobymask-ui
|
||||||
|
pods:
|
||||||
|
- watcher-mobymask-v2
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
# This file should be re-generated running: scripts/update-version-file.sh script
|
# This file should be re-generated running: scripts/update-version-file.sh script
|
||||||
v1.0.25-75376d7
|
v1.0.29-5fca9bd
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import sys
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from decouple import config
|
from decouple import config
|
||||||
import subprocess
|
import subprocess
|
||||||
from python_on_whales import DockerClient
|
from python_on_whales import DockerClient, DockerException
|
||||||
import click
|
import click
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -83,7 +83,10 @@ def command(ctx, include, exclude, cluster, command, extra_args):
|
|||||||
container_exec_env = _make_runtime_env(ctx.obj)
|
container_exec_env = _make_runtime_env(ctx.obj)
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"Running compose exec {service_name} {command_to_exec}")
|
print(f"Running compose exec {service_name} {command_to_exec}")
|
||||||
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
|
try:
|
||||||
|
docker.compose.execute(service_name, command_to_exec, envs=container_exec_env)
|
||||||
|
except DockerException as error:
|
||||||
|
print(f"container command returned error exit status")
|
||||||
elif command == "port":
|
elif command == "port":
|
||||||
if extra_args_list is None or len(extra_args_list) < 2:
|
if extra_args_list is None or len(extra_args_list) < 2:
|
||||||
print("Usage: port <service> <exposed-port>")
|
print("Usage: port <service> <exposed-port>")
|
||||||
@@ -301,7 +304,7 @@ def _orchestrate_cluster_config(ctx, cluster_config, docker, container_exec_env)
|
|||||||
print(f"fetched source value: {source_value}")
|
print(f"fetched source value: {source_value}")
|
||||||
destination_output = docker.compose.execute(pd.destination_container,
|
destination_output = docker.compose.execute(pd.destination_container,
|
||||||
["sh", "-c",
|
["sh", "-c",
|
||||||
f"sh /scripts/import-{pd.destination_variable}.sh {pd.source_variable}"],
|
f"sh /scripts/import-{pd.destination_variable}.sh {source_value}"],
|
||||||
tty=False,
|
tty=False,
|
||||||
envs=container_exec_env)
|
envs=container_exec_env)
|
||||||
if ctx.debug:
|
if ctx.debug:
|
||||||
|
|||||||
Reference in New Issue
Block a user