forked from cerc-io/stack-orchestrator
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0770d7379 | ||
|
|
4aecfcd780 | ||
|
|
03f6d027f9 | ||
|
|
d8522211f4 | ||
|
|
4ca185c753 | ||
|
|
e004d93891 | ||
|
|
8f6703940a | ||
|
|
cf0e0c5d94 | ||
|
|
7f3a33564a | ||
|
|
10337e77f6 | ||
|
|
7a1ec3f196 |
@@ -49,6 +49,8 @@ services:
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
environment:
|
||||
CERC_KEEP_RUNNING_AFTER_GETH_EXIT: "true"
|
||||
env_file:
|
||||
- ../config/fixturenet-eth/fixturenet-eth.env
|
||||
image: cerc/fixturenet-eth-geth:local
|
||||
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
- l2_accounts:/l2-accounts
|
||||
- l1_deployment:/app/packages/contracts-bedrock
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
# Generates the config files required for L2 (outputs to volume l2_config)
|
||||
op-node-l2-config-gen:
|
||||
@@ -50,7 +50,7 @@ services:
|
||||
- l2_config:/app
|
||||
command: ["sh", "/app/generate-l2-config.sh"]
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
# Initializes and runs the L2 execution client (outputs to volume l2_geth_data)
|
||||
op-geth:
|
||||
@@ -122,8 +122,35 @@ services:
|
||||
# Waits for L1 endpoint to be up before running the batcher
|
||||
command: |
|
||||
"/wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- /run-op-batcher.sh"
|
||||
ports:
|
||||
- "127.0.0.1:8548:8548"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
# Runs the proposer (periodically submits new state roots to L1)
|
||||
op-proposer:
|
||||
image: cerc/optimism-op-proposer:local
|
||||
depends_on:
|
||||
op-node:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- ../config/fixturenet-optimism/l1-params.env
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_L1_RPC: ${CERC_L1_RPC}
|
||||
volumes:
|
||||
- ../config/wait-for-it.sh:/wait-for-it.sh
|
||||
- ../config/fixturenet-optimism/run-op-proposer.sh:/run-op-proposer.sh
|
||||
- l1_deployment:/contracts-bedrock:ro
|
||||
- l2_accounts:/l2-accounts:ro
|
||||
entrypoint: ["sh", "-c"]
|
||||
# Waits for L1 endpoint to be up before running the proposer
|
||||
command: |
|
||||
"/wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- /run-op-proposer.sh"
|
||||
ports:
|
||||
- "127.0.0.1:8560:8560"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
volumes:
|
||||
l1_deployment:
|
||||
|
||||
@@ -15,12 +15,7 @@ services:
|
||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
||||
CERC_BUILD_DIR: "@cerc-io/mobymask-ui/build"
|
||||
working_dir: /scripts
|
||||
# Waits for watcher server to be up before app build
|
||||
# Required when running with watcher stack to get deployed contract address
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./mobymask-app-start.sh
|
||||
command: ["sh", "mobymask-app-start.sh"]
|
||||
volumes:
|
||||
- ../config/wait-for-it.sh:/scripts/wait-for-it.sh
|
||||
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
||||
@@ -51,12 +46,7 @@ services:
|
||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
||||
CERC_BUILD_DIR: "@cerc-io/mobymask-ui-lxdao/build"
|
||||
working_dir: /scripts
|
||||
# Waits for watcher server to be up before app build
|
||||
# Required when running with watcher stack to get deployed contract address
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./mobymask-app-start.sh
|
||||
command: ["sh", "mobymask-app-start.sh"]
|
||||
volumes:
|
||||
- ../config/wait-for-it.sh:/scripts/wait-for-it.sh
|
||||
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
||||
|
||||
@@ -10,10 +10,7 @@ services:
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- ./wait-for-it.sh -h ${CERC_WATCHER_HOST:-$${DEFAULT_CERC_WATCHER_HOST}} -p ${CERC_WATCHER_PORT:-$${DEFAULT_CERC_WATCHER_PORT}} -s -t 0 -- ./test-app-start.sh
|
||||
command: ["sh", "test-app-start.sh"]
|
||||
volumes:
|
||||
- ../config/wait-for-it.sh:/scripts/wait-for-it.sh
|
||||
- ../config/watcher-mobymask-v2/test-app-start.sh:/scripts/test-app-start.sh
|
||||
|
||||
@@ -76,6 +76,13 @@ else
|
||||
echo "Couldn't fetch L1 account credentials, using them from env"
|
||||
fi
|
||||
|
||||
# Send balances to the above L2 addresses
|
||||
yarn hardhat send-balance --to "${ADMIN_ADDRESS}" --amount 2 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
yarn hardhat send-balance --to "${PROPOSER_ADDRESS}" --amount 5 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
yarn hardhat send-balance --to "${BATCHER_ADDRESS}" --amount 1000 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
|
||||
echo "Balances sent to L2 accounts"
|
||||
|
||||
# Select a finalized L1 block as the starting point for roll ups
|
||||
until FINALIZED_BLOCK=$(cast block finalized --rpc-url "$CERC_L1_RPC"); do
|
||||
echo "Waiting for a finalized L1 block to exist, retrying after 10s"
|
||||
@@ -88,13 +95,6 @@ L1_BLOCKTIMESTAMP=$(echo "$FINALIZED_BLOCK" | awk '/timestamp/{print $2}')
|
||||
|
||||
echo "Selected L1 block ${L1_BLOCKNUMBER} as the starting block for roll ups"
|
||||
|
||||
# Send balances to the above L2 addresses
|
||||
yarn hardhat send-balance --to "${ADMIN_ADDRESS}" --amount 2 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
yarn hardhat send-balance --to "${PROPOSER_ADDRESS}" --amount 5 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
yarn hardhat send-balance --to "${BATCHER_ADDRESS}" --amount 1000 --private-key "${CERC_L1_PRIV_KEY}" --network getting-started
|
||||
|
||||
echo "Balances sent to L2 accounts"
|
||||
|
||||
# Update the deployment config
|
||||
sed -i 's/"l2OutputOracleStartingTimestamp": TIMESTAMP/"l2OutputOracleStartingTimestamp": '"$L1_BLOCKTIMESTAMP"'/g' deploy-config/getting-started.json
|
||||
jq --arg chainid "$CERC_L1_CHAIN_ID" '.l1ChainID = ($chainid | tonumber)' deploy-config/getting-started.json > tmp.json && mv tmp.json deploy-config/getting-started.json
|
||||
@@ -110,7 +110,7 @@ echo "PRIVATE_KEY_DEPLOYER=$ADMIN_PRIV_KEY" >> .env
|
||||
echo "Deploying the L1 smart contracts, this will take a while..."
|
||||
|
||||
# Deploy the L1 smart contracts
|
||||
yarn hardhat deploy --network getting-started
|
||||
yarn hardhat deploy --network getting-started --tags l1
|
||||
|
||||
echo "Deployed the L1 smart contracts"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ fi
|
||||
|
||||
CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
|
||||
# Get BACTHER_KEY from keys.json
|
||||
# Get Batcher key from keys.json
|
||||
BATCHER_KEY=$(jq -r '.Batcher.privateKey' /l2-accounts/keys.json | tr -d '"')
|
||||
|
||||
cleanup() {
|
||||
@@ -18,6 +18,7 @@ cleanup() {
|
||||
}
|
||||
trap 'cleanup' INT TERM
|
||||
|
||||
# Run op-batcher
|
||||
op-batcher \
|
||||
--l2-eth-rpc=http://op-geth:8545 \
|
||||
--rollup-rpc=http://op-node:8547 \
|
||||
@@ -30,7 +31,6 @@ op-batcher \
|
||||
--rpc.port=8548 \
|
||||
--rpc.enable-admin \
|
||||
--max-channel-duration=1 \
|
||||
--target-l1-tx-size-bytes=2048 \
|
||||
--l1-eth-rpc=$CERC_L1_RPC \
|
||||
--private-key=$BATCHER_KEY \
|
||||
&
|
||||
|
||||
@@ -8,7 +8,7 @@ fi
|
||||
echo "Installing jq"
|
||||
apk update && apk add jq
|
||||
|
||||
# Get SEQUENCER key from keys.json
|
||||
# Get Sequencer key from keys.json
|
||||
SEQUENCER_KEY=$(jq -r '.Sequencer.privateKey' /l2-accounts/keys.json | tr -d '"')
|
||||
|
||||
# Initialize op-geth if datadir/geth not found
|
||||
@@ -70,7 +70,7 @@ geth \
|
||||
--ws.origins="*" \
|
||||
--ws.api=debug,eth,txpool,net,engine \
|
||||
--syncmode=full \
|
||||
--gcmode=full \
|
||||
--gcmode=archive \
|
||||
--nodiscover \
|
||||
--maxpeers=0 \
|
||||
--networkid=42069 \
|
||||
|
||||
@@ -6,9 +6,10 @@ fi
|
||||
|
||||
CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
|
||||
# Get SEQUENCER KEY from keys.json
|
||||
# Get Sequencer key from keys.json
|
||||
SEQUENCER_KEY=$(jq -r '.Sequencer.privateKey' /l2-accounts/keys.json | tr -d '"')
|
||||
|
||||
# Run op-node
|
||||
op-node \
|
||||
--l2=http://op-geth:8551 \
|
||||
--l2.jwt-secret=/op-node-data/jwt.txt \
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
|
||||
# Read the L2OutputOracle contract address from the deployment
|
||||
L2OO_DEPLOYMENT=$(cat /contracts-bedrock/deployments/getting-started/L2OutputOracle.json)
|
||||
L2OO_ADDR=$(echo "$L2OO_DEPLOYMENT" | jq -r '.address')
|
||||
|
||||
# Get Proposer key from keys.json
|
||||
PROPOSER_KEY=$(jq -r '.Proposer.privateKey' /l2-accounts/keys.json | tr -d '"')
|
||||
|
||||
cleanup() {
|
||||
echo "Signal received, cleaning up..."
|
||||
kill ${proposer_pid}
|
||||
|
||||
wait
|
||||
echo "Done"
|
||||
}
|
||||
trap 'cleanup' INT TERM
|
||||
|
||||
# Run op-proposer
|
||||
op-proposer \
|
||||
--poll-interval 12s \
|
||||
--rpc.port 8560 \
|
||||
--rollup-rpc http://op-node:8547 \
|
||||
--l2oo-address $L2OO_ADDR \
|
||||
--private-key $PROPOSER_KEY \
|
||||
--l1-eth-rpc $CERC_L1_RPC \
|
||||
&
|
||||
|
||||
proposer_pid=$!
|
||||
wait $proposer_pid
|
||||
@@ -48,7 +48,7 @@ CERC_L2_GETH_PORT="${CERC_L2_GETH_PORT:-${DEFAULT_CERC_L2_GETH_PORT}}"
|
||||
CERC_L2_NODE_HOST="${CERC_L2_NODE_HOST:-${DEFAULT_CERC_L2_NODE_HOST}}"
|
||||
CERC_L2_NODE_PORT="${CERC_L2_NODE_PORT:-${DEFAULT_CERC_L2_NODE_PORT}}"
|
||||
./wait-for-it.sh -h "${CERC_L2_GETH_HOST}" -p "${CERC_L2_GETH_PORT}" -s -t 0
|
||||
./wait-for-it.sh -h "${CERC_L2_GETH_PORT}" -p "${CERC_L2_NODE_PORT}" -s -t 0
|
||||
./wait-for-it.sh -h "${CERC_L2_NODE_HOST}" -p "${CERC_L2_NODE_PORT}" -s -t 0
|
||||
|
||||
export RPC_URL="${CERC_L2_GETH_RPC}"
|
||||
|
||||
|
||||
@@ -17,9 +17,13 @@ fi
|
||||
|
||||
echo "Using CERC_RELAY_NODES $CERC_RELAY_NODES"
|
||||
|
||||
# Use config from mounted volume if available (when running web-app along with watcher stack)
|
||||
if [ -f /server/config.json ]; then
|
||||
if [ -z "$CERC_DEPLOYED_CONTRACT" ]; then
|
||||
# Use config from mounted volume (when running web-app along with watcher stack)
|
||||
echo "Taking config for deployed contract from mounted volume"
|
||||
while [ ! -f /server/config.json ]; do
|
||||
echo "Config not found, retrying after 5 seconds"
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# Get deployed contract address and chain id
|
||||
CERC_DEPLOYED_CONTRACT=$(jq -r '.address' /server/config.json | tr -d '"')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Defaults
|
||||
|
||||
# Watcher endpoint
|
||||
DEFAULT_CERC_WATCHER_HOST="mobymask-watcher-server"
|
||||
DEFAULT_CERC_WATCHER_PORT=3001
|
||||
DEFAULT_CERC_APP_WATCHER_URL="http://localhost:3001"
|
||||
|
||||
# Set of relay peers to connect to from the relay node
|
||||
|
||||
@@ -127,3 +127,9 @@ else
|
||||
fi
|
||||
|
||||
wait $geth_pid
|
||||
|
||||
if [ "true" == "$CERC_KEEP_RUNNING_AFTER_GETH_EXIT" ]; then
|
||||
while [ 1 -eq 1 ]; do
|
||||
sleep 60
|
||||
done
|
||||
fi
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exports the complete fixturenet-eth ethdb data to a tarball (default, ./ethdb.tgz), waiting for a minimum
|
||||
# block height (default 1000) to be reached before exporting.
|
||||
|
||||
# Usage: export-ethdb.sh [min_block_number=1000] [output_file=./ethdb.tgz]
|
||||
|
||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
GETH_EXPORT_MIN_BLOCK=${1:-${GETH_EXPORT_MIN_BLOCK:-1000}}
|
||||
|
||||
# Wait for block.
|
||||
${SCRIPT_DIR}/status.sh $GETH_EXPORT_MIN_BLOCK
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to export ethdb." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Stop geth.
|
||||
echo -n "Exporting ethdb.... "
|
||||
GETH_CONTAINER=`docker ps -q -f "name=${CERC_SO_COMPOSE_PROJECT}-fixturenet-eth-geth-2-1"`
|
||||
if [[ -z "$GETH_CONTAINER" ]]; then
|
||||
echo "not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker exec $GETH_CONTAINER sh -c 'rm -rf /root/tmp && mkdir -p /root/tmp/export'
|
||||
docker exec $GETH_CONTAINER sh -c 'ln -s /opt/testnet/build/el/geth.json /root/tmp/export/genesis.json && ln -s /root/ethdata /root/tmp/export/'
|
||||
docker exec $GETH_CONTAINER sh -c 'cat /root/tmp/export/genesis.json | jq ".config" > /root/tmp/export/genesis.config.json'
|
||||
|
||||
# Stop geth and zip up ethdb.
|
||||
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x0\", false]}" > /root/tmp/export/eth_getBlockByNumber_0x0.json'
|
||||
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_blockNumber\", \"params\": []}" > /root/tmp/export/eth_blockNumber.json'
|
||||
docker exec $GETH_CONTAINER sh -c "killall geth && sleep 2 && tar chzf /root/tmp/ethdb.tgz -C /root/tmp/export ."
|
||||
|
||||
# Copy ethdb to host.
|
||||
GETH_EXPORT_FILE=${2:-${GETH_EXPORT_FILE:-./ethdb.tgz}}
|
||||
docker cp $GETH_CONTAINER:/root/tmp/ethdb.tgz $GETH_EXPORT_FILE
|
||||
echo "$GETH_EXPORT_FILE"
|
||||
docker exec $GETH_CONTAINER sh -c "rm -rf /root/tmp"
|
||||
|
||||
# Restart the container to get geth back up and running.
|
||||
docker restart $GETH_CONTAINER >/dev/null
|
||||
@@ -2,9 +2,10 @@
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
STATUSES=("geth to generate DAG" "beacon phase0" "beacon altair" "beacon bellatrix pre-merge" "beacon bellatrix merge")
|
||||
STATUS=0
|
||||
|
||||
MIN_BLOCK_NUM=${1:-${MIN_BLOCK_NUM:-3}}
|
||||
STATUSES=("geth to generate DAG" "beacon phase0" "beacon altair" "beacon bellatrix pre-merge" "beacon bellatrix merge" "block number $MIN_BLOCK_NUM")
|
||||
STATUS=0
|
||||
|
||||
LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL}
|
||||
GETH_BASE_URL=${GETH_BASE_URL}
|
||||
@@ -13,18 +14,29 @@ GETH_BASE_URL=${GETH_BASE_URL}
|
||||
# or some execution environment-neutral mechanism.
|
||||
if [ -z "$LIGHTHOUSE_BASE_URL" ]; then
|
||||
LIGHTHOUSE_CONTAINER=`docker ps -q -f "name=fixturenet-eth-lighthouse-1-1"`
|
||||
if [ -z "$LIGHTHOUSE_CONTAINER" ]; then
|
||||
echo "Lighthouse container not found." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
LIGHTHOUSE_PORT=`docker port $LIGHTHOUSE_CONTAINER 8001 | cut -d':' -f2`
|
||||
LIGHTHOUSE_BASE_URL="http://localhost:${LIGHTHOUSE_PORT}"
|
||||
fi
|
||||
|
||||
if [ -z "$GETH_BASE_URL" ]; then
|
||||
GETH_CONTAINER=`docker ps -q -f "name=fixturenet-eth-geth-1-1"`
|
||||
if [ -z "$GETH_CONTAINER" ]; then
|
||||
echo "Lighthouse container not found." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
GETH_PORT=`docker port $GETH_CONTAINER 8545 | cut -d':' -f2`
|
||||
GETH_BASE_URL="http://localhost:${GETH_PORT}"
|
||||
fi
|
||||
|
||||
MARKER="."
|
||||
|
||||
function inc_status() {
|
||||
echo " done"
|
||||
MARKEr="."
|
||||
STATUS=$((STATUS + 1))
|
||||
if [ $STATUS -lt ${#STATUSES[@]} ]; then
|
||||
echo -n "Waiting for ${STATUSES[$STATUS]}..."
|
||||
@@ -34,7 +46,7 @@ function inc_status() {
|
||||
echo -n "Waiting for ${STATUSES[$STATUS]}..."
|
||||
while [ $STATUS -lt ${#STATUSES[@]} ]; do
|
||||
sleep 1
|
||||
echo -n "."
|
||||
echo -n "$MARKER"
|
||||
case $STATUS in
|
||||
0)
|
||||
result=`wget --no-check-certificate --quiet -O - --method POST --header 'Content-Type: application/json' \
|
||||
@@ -67,5 +79,13 @@ while [ $STATUS -lt ${#STATUSES[@]} ]; do
|
||||
inc_status
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
result=`wget --no-check-certificate --quiet -O - "$LIGHTHOUSE_BASE_URL/eth/v2/beacon/blocks/head" | jq -r '.data.message.body.execution_payload.block_number'`
|
||||
if [ ! -z "$result" ] && [ $result -gt $MIN_BLOCK_NUM ]; then
|
||||
inc_status
|
||||
else
|
||||
MARKER="$result "
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -52,7 +52,7 @@ RUN yarn global add http-server
|
||||
# Install old version of MobyMask web app
|
||||
RUN yarn global add @cerc-io/mobymask-ui@0.1.3
|
||||
# Install the LXDAO version of MobyMask web app
|
||||
RUN yarn global add @cerc-io/mobymask-ui-lxdao@npm:@cerc-io/mobymask-ui@0.1.3-lxdao-0.1.0
|
||||
RUN yarn global add @cerc-io/mobymask-ui-lxdao@npm:@cerc-io/mobymask-ui@0.1.3-lxdao-0.1.1
|
||||
|
||||
# Expose port for http
|
||||
EXPOSE 80
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build cerc/optimism-l2geth
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
docker build -t cerc/optimism-l2geth:local ${build_command_args} ${CERC_REPO_BASE_DIR}/op-geth
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build cerc/optimism-op-batcher
|
||||
# TODO: use upstream Dockerfile once its buildx-specific content has been removed
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
docker build -t cerc/optimism-op-batcher:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/optimism
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build cerc/optimism-op-node
|
||||
# TODO: use upstream Dockerfile once its buildx-specific content has been removed
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
docker build -t cerc/optimism-op-node:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/optimism
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
FROM golang:1.19.0-alpine3.15 as builder
|
||||
|
||||
ARG VERSION=v0.0.0
|
||||
|
||||
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
|
||||
|
||||
# build op-proposer with the shared go.mod & go.sum files
|
||||
COPY ./op-proposer /app/op-proposer
|
||||
COPY ./op-bindings /app/op-bindings
|
||||
COPY ./op-node /app/op-node
|
||||
COPY ./op-service /app/op-service
|
||||
COPY ./op-signer /app/op-signer
|
||||
COPY ./go.mod /app/go.mod
|
||||
COPY ./go.sum /app/go.sum
|
||||
COPY ./.git /app/.git
|
||||
|
||||
WORKDIR /app/op-proposer
|
||||
|
||||
RUN go mod download
|
||||
|
||||
ARG TARGETOS TARGETARCH
|
||||
|
||||
RUN make op-proposer VERSION="$VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
|
||||
FROM alpine:3.15
|
||||
|
||||
RUN apk add --no-cache jq bash
|
||||
|
||||
COPY --from=builder /app/op-proposer/bin/op-proposer /usr/local/bin
|
||||
|
||||
CMD ["op-proposer"]
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build cerc/optimism-op-proposer
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
docker build -t cerc/optimism-op-proposer:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/optimism
|
||||
@@ -14,7 +14,7 @@ WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN echo "Building watcher-ts" && \
|
||||
RUN echo "Building mobymask-v2-watcher-ts" && \
|
||||
yarn && yarn build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -35,3 +35,4 @@ cerc/act-runner-task-executor
|
||||
cerc/optimism-l2geth
|
||||
cerc/optimism-op-batcher
|
||||
cerc/optimism-op-node
|
||||
cerc/optimism-op-proposer
|
||||
|
||||
@@ -10,7 +10,6 @@ laconicd
|
||||
fixturenet-laconicd
|
||||
fixturenet-eth
|
||||
fixturenet-eth-metrics
|
||||
watcher-ts
|
||||
watcher-mobymask
|
||||
watcher-erc20
|
||||
watcher-erc721
|
||||
|
||||
@@ -13,8 +13,6 @@ cerc-io/laconic-console
|
||||
cerc-io/mobymask-watcher
|
||||
cerc-io/watcher-ts
|
||||
cerc-io/mobymask-v2-watcher-ts
|
||||
cerc-io/react-peer
|
||||
cerc-io/mobymask-ui
|
||||
cerc-io/MobyMask
|
||||
vulcanize/uniswap-watcher-ts
|
||||
vulcanize/uniswap-v3-info
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# fixturenet-eth-tx
|
||||
|
||||
A variation of `fixturenet-eth` that automatically generates transactions using `tx-spammer`.
|
||||
|
||||
See `stacks/fixturenet-eth/README.md` for more information.
|
||||
|
||||
## Containers
|
||||
|
||||
* cerc/go-ethereum
|
||||
* cerc/lighthouse
|
||||
* cerc/fixturenet-eth-geth
|
||||
* cerc/fixturenet-eth-lighthouse
|
||||
* cerc/tx-spammer
|
||||
|
||||
## Deploy the stack
|
||||
```
|
||||
$ laconic-so --stack fixturenet-eth-tx setup-repositories
|
||||
$ laconic-so --stack fixturenet-eth-tx build-containers
|
||||
$ laconic-so --stack fixturenet-eth-tx deploy up
|
||||
```
|
||||
|
||||
## Export the ethdb (optional)
|
||||
|
||||
It is easy to export data from the fixturenet for offline processing of the raw ethdb files (eg, by eth-statediff-service) using the `export-ethdb.sh` script.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
$ app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/export-ethdb.sh 500
|
||||
Waiting for geth to generate DAG.... done
|
||||
Waiting for beacon phase0.... done
|
||||
Waiting for beacon altair.... done
|
||||
Waiting for beacon bellatrix pre-merge.... done
|
||||
Waiting for beacon bellatrix merge.... done
|
||||
Waiting for block number 500.... done
|
||||
Exporting ethdb.... ./ethdb.tgz
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
version: "1.1"
|
||||
name: fixturenet-eth-tx
|
||||
decription: "Ethereum Fixturenet w/ tx-spammer"
|
||||
repos:
|
||||
- cerc-io/go-ethereum
|
||||
- cerc-io/tx-spammer
|
||||
containers:
|
||||
- cerc/go-ethereum
|
||||
- cerc/lighthouse
|
||||
- cerc/fixturenet-eth-geth
|
||||
- cerc/fixturenet-eth-lighthouse
|
||||
- cerc/tx-spammer
|
||||
pods:
|
||||
- fixturenet-eth
|
||||
- tx-spammer
|
||||
@@ -19,7 +19,7 @@ Checkout to the required versions and branches in repos:
|
||||
```bash
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout @eth-optimism/sdk@0.0.0-20230329025055
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
@@ -36,8 +36,9 @@ This should create the required docker images in the local image registry:
|
||||
* `cerc/foundry`
|
||||
* `cerc/optimism-contracts`
|
||||
* `cerc/optimism-l2geth`
|
||||
* `cerc/optimism-op-batcher`
|
||||
* `cerc/optimism-op-node`
|
||||
* `cerc/optimism-op-batcher`
|
||||
* `cerc/optimism-op-proposer`
|
||||
|
||||
## Deploy
|
||||
|
||||
@@ -69,7 +70,7 @@ docker logs -f <CONTAINER_ID>
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism deploy down
|
||||
laconic-so --stack fixturenet-optimism deploy down 30
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
@@ -19,21 +19,22 @@ Checkout to the required versions and branches in repos:
|
||||
```bash
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout @eth-optimism/sdk@0.0.0-20230329025055
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism build-containers --include cerc/foundry,cerc/optimism-contracts,cerc/optimism-op-node,cerc/optimism-l2geth,cerc/optimism-op-batcher
|
||||
laconic-so --stack fixturenet-optimism build-containers --include cerc/foundry,cerc/optimism-contracts,cerc/optimism-op-node,cerc/optimism-l2geth,cerc/optimism-op-batcher,cerc/optimism-op-proposer
|
||||
```
|
||||
|
||||
This should create the required docker images in the local image registry:
|
||||
* `cerc/foundry`
|
||||
* `cerc/optimism-contracts`
|
||||
* `cerc/optimism-l2geth`
|
||||
* `cerc/optimism-op-batcher`
|
||||
* `cerc/optimism-op-node`
|
||||
* `cerc/optimism-op-batcher`
|
||||
* `cerc/optimism-op-proposer`
|
||||
|
||||
## Deploy
|
||||
|
||||
@@ -89,7 +90,7 @@ docker logs -f <CONTAINER_ID>
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down
|
||||
laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down 30
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
@@ -16,6 +16,7 @@ containers:
|
||||
- cerc/optimism-op-node
|
||||
- cerc/optimism-l2geth
|
||||
- cerc/optimism-op-batcher
|
||||
- cerc/optimism-op-proposer
|
||||
pods:
|
||||
- fixturenet-eth
|
||||
- fixturenet-optimism
|
||||
|
||||
@@ -35,7 +35,7 @@ git checkout v0.1.2
|
||||
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout @eth-optimism/sdk@0.0.0-20230329025055
|
||||
git checkout v1.0.4
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
@@ -111,7 +111,7 @@ 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-system down
|
||||
laconic-so --stack mobymask-v2 deploy-system down 30
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
+33
-20
@@ -81,10 +81,11 @@ Add the following contents to `mobymask-watcher.env`:
|
||||
|
||||
```bash
|
||||
# Domain to be used in the relay node's announce address
|
||||
CERC_RELAY_ANNOUNCE_DOMAIN="example.com"
|
||||
CERC_RELAY_ANNOUNCE_DOMAIN="mobymask.example.com"
|
||||
|
||||
|
||||
# DO NOT CHANGE THESE VALUES
|
||||
CERC_L2_GETH_RPC="https://mobymask-l2.dev.vdb.to"
|
||||
CERC_DEPLOYED_CONTRACT="0x2B6AFbd4F479cE4101Df722cF4E05F941523EaD9"
|
||||
CERC_ENABLE_PEER_L2_TXS=false
|
||||
CERC_RELAY_PEERS=["/dns4/relay1.dev.vdb.to/tcp/443/wss/p2p/12D3KooWAx83SM9GWVPc9v9fNzLzftRX6EaAFMjhYiFxRYqctcW1", "/dns4/relay2.dev.vdb.to/tcp/443/wss/p2p/12D3KooWBycy6vHVEfUwwYRbPLBdb5gx9gtFSEMpErYPUjUkDNkm", "/dns4/relay3.dev.vdb.to/tcp/443/wss/p2p/12D3KooWARcUJsiGCgiygiRVVK94U8BNSy8DFBbzAF3B6orrabwn"]
|
||||
@@ -99,9 +100,8 @@ laconic-so --stack mobymask-v2 deploy --cluster mobymask_v2 --include watcher-mo
|
||||
|
||||
# Expected output (ignore the "The X variable is not set. Defaulting to a blank string." warnings):
|
||||
|
||||
# [+] Running 10/10
|
||||
# [+] Running 9/9
|
||||
# ✔ Network mobymask_v2_default Created 0.1s
|
||||
# ✔ Volume "mobymask_v2_fixturenet_geth_accounts" Created 0.0s
|
||||
# ✔ Volume "mobymask_v2_peers_ids" Created 0.0s
|
||||
# ✔ Volume "mobymask_v2_mobymask_watcher_db_data" Created 0.0s
|
||||
# ✔ Volume "mobymask_v2_mobymask_deployment" Created 0.0s
|
||||
@@ -116,7 +116,7 @@ This will run the `mobymask-v2-watcher` including:
|
||||
* A relay node which is in a federated setup with relay nodes set in the env file
|
||||
* A peer node which connects to the watcher relay node as an entrypoint to the MobyMask watcher p2p network. This peer listens for messages from other peers on the network and logs them out to the console
|
||||
|
||||
The watcher endpoint is exposed on host port `3001` and the relay node endpoint is exposed on host port `9090`
|
||||
The watcher GraphQL endpoint is exposed on host port `3001` and the relay node endpoint is exposed on host port `9090`
|
||||
|
||||
To list down and monitor the running containers:
|
||||
|
||||
@@ -156,18 +156,30 @@ Check watcher container logs to get multiaddr advertised by the watcher's relay
|
||||
|
||||
# mobymask_v2-mobymask-watcher-server-1 | 2023-04-20T04:22:57.069Z laconic:relay Relay node started with id 12D3KooWKef84LAcBNb9wZNs6jC5kQFXjddo47hK6AGHD2dSvGai (characteristic-black-pamella)
|
||||
# mobymask_v2-mobymask-watcher-server-1 | 2023-04-20T04:22:57.069Z laconic:relay Listening on:
|
||||
# mobymask_v2-mobymask-watcher-server-1 | 2023-04-20T04:22:57.070Z laconic:relay /dns4/example.com/tcp/443/wss/p2p/12D3KooWKef84LAcBNb9wZNs6jC5kQFXjddo47hK6AGHD2dSvGai
|
||||
# mobymask_v2-mobymask-watcher-server-1 | 2023-04-20T04:22:57.070Z laconic:relay /dns4/mobymask.example.com/tcp/443/wss/p2p/12D3KooWKef84LAcBNb9wZNs6jC5kQFXjddo47hK6AGHD2dSvGai
|
||||
```
|
||||
|
||||
## Web App
|
||||
|
||||
To be able to connect to the relay node from remote peers, it needs to be publicly reachable. Configure your website with SSL and the `https` traffic forwarded to port `9090`.
|
||||
To be able to connect to the relay node from remote peers, it needs to be publicly reachable.
|
||||
Configure your website with SSL and the `https` traffic reverse proxied as:
|
||||
* `/graphql` to port `3001` (watcher GQL endpoint)
|
||||
* `/` to port `9090` (relay node)
|
||||
|
||||
For example, a Nginx configuration for domain `example.com` would look something like:
|
||||
For example, a Nginx configuration for domain `mobymask.example.com` would look something like:
|
||||
|
||||
```bash
|
||||
server {
|
||||
server_name example.com;
|
||||
server_name mobymask.example.com;
|
||||
|
||||
location /graphql {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://127.0.0.1:3001;
|
||||
proxy_read_timeout 90;
|
||||
}
|
||||
|
||||
# https://nginx.org/en/docs/http/websocket.html
|
||||
location / {
|
||||
@@ -182,35 +194,37 @@ For example, a Nginx configuration for domain `example.com` would look something
|
||||
|
||||
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
||||
listen 443 ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/mobymask.example.com/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/mobymask.example.com/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||
}
|
||||
|
||||
server {
|
||||
if ($host = example.com) {
|
||||
if ($host = mobymask.example.com) {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name example.com;
|
||||
server_name mobymask.example.com;
|
||||
return 404; # managed by Certbot
|
||||
}
|
||||
```
|
||||
|
||||
To connect a browser peer to the watcher's relay node:
|
||||
* Visit https://mobymask-lxdao-app.dev.vdb.to/
|
||||
To test the web-app, either visit https://mobymask-lxdao-app.dev.vdb.to/ or follow [web-app.md](./web-app.md) to deploy the app locally that hits your watcher's GQL endpoint
|
||||
|
||||
Connect a browser peer to the watcher's relay node:
|
||||
* Click on debug panel on bottom right of the homepage
|
||||
* Select `<custom>` in `Primary Relay` dropdown on the right and enter the watcher relay node's multiaddr
|
||||
* Click on `UPDATE` to refresh the page and connect to the watcher's relay node; you should see the relay node's multiaddr in `Self Node Info` on the debug panel
|
||||
* Switch to the `GRAPH (PEERS)` tab to see peers connected to this browser node and the `GRAPH (NETWORK)` tab to see the whole MobyMask p2p network
|
||||
|
||||
Perform transactions (invite required):
|
||||
* Open the invite link in a browser and open the debug panel
|
||||
* Confirm that the browser peer is connected to at least one other peer, then close the debug panel
|
||||
Perform transactions:
|
||||
* An invitation is required to be able to perform transactions; ask an existing user of the app for an invite
|
||||
* In a browser, close the app if it's already open and then open the invite link
|
||||
* From the debug panel, confirm that the browser peer is connected to at least one other peer
|
||||
* Check the status for a phisher to be reported in the `Check Phisher Status` section on homepage
|
||||
* Select `Report Phisher` option in the `Pending reports` section, enter multiple phisher records and click on the `Submit batch to p2p network` button; this broadcasts signed invocations to peers on the network, including the watcher peer
|
||||
* Check the watcher container logs to see the message received:
|
||||
@@ -287,18 +301,17 @@ 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_v2"
|
||||
|
||||
# Expected output:
|
||||
|
||||
# mobymask_v2_fixturenet_geth_accounts
|
||||
# mobymask_v2_mobymask_deployment
|
||||
# mobymask_v2_mobymask_watcher_db_data
|
||||
# mobymask_v2_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_v2")
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
@@ -0,0 +1,162 @@
|
||||
# MobyMask Watcher P2P Network - Web App
|
||||
|
||||
Instructions to setup and deploy the MobyMask app locally, pointed to a watcher on the p2p network
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Laconic Stack Orchestrator ([installation](/README.md#install))
|
||||
* Watcher GQL endpoint
|
||||
|
||||
## Setup
|
||||
|
||||
Build the container images:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 build-containers --include cerc/react-peer,cerc/mobymask-ui
|
||||
```
|
||||
|
||||
Check that the required images are created in the local image registry:
|
||||
|
||||
```bash
|
||||
docker image ls
|
||||
|
||||
# Expected output:
|
||||
|
||||
# REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
# cerc/react-peer local d66b144dbb53 4 days ago 868MB
|
||||
# cerc/mobymask-ui local e456bf9937ec 4 days ago 1.67GB
|
||||
# .
|
||||
# .
|
||||
```
|
||||
|
||||
## Deploy
|
||||
|
||||
### Configuration
|
||||
|
||||
Create an env file `mobymask-app.env`:
|
||||
|
||||
```bash
|
||||
touch mobymask-app.env
|
||||
```
|
||||
|
||||
Add the following contents to `mobymask-app.env`:
|
||||
|
||||
```bash
|
||||
# Watcher endpoint used by the app for GQL queries
|
||||
CERC_APP_WATCHER_URL="http://127.0.0.1:3001"
|
||||
|
||||
|
||||
# DO NOT CHANGE THESE VALUES
|
||||
CERC_DEPLOYED_CONTRACT="0x2B6AFbd4F479cE4101Df722cF4E05F941523EaD9"
|
||||
CERC_RELAY_NODES=["/dns4/relay1.dev.vdb.to/tcp/443/wss/p2p/12D3KooWAx83SM9GWVPc9v9fNzLzftRX6EaAFMjhYiFxRYqctcW1","/dns4/relay2.dev.vdb.to/tcp/443/wss/p2p/12D3KooWBycy6vHVEfUwwYRbPLBdb5gx9gtFSEMpErYPUjUkDNkm","/dns4/relay3.dev.vdb.to/tcp/443/wss/p2p/12D3KooWARcUJsiGCgiygiRVVK94U8BNSy8DFBbzAF3B6orrabwn"]
|
||||
```
|
||||
|
||||
Replace `CERC_APP_WATCHER_URL` with the watcher's endpoint (eg. `https://mobymask.example.com`)
|
||||
|
||||
### Deploy the stack
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mm_v2 --include mobymask-app --env-file mobymask-app.env up lxdao-mobymask-app
|
||||
|
||||
# Expected output (ignore the "The X variable is not set. Defaulting to a blank string." warnings):
|
||||
|
||||
# [+] Running 4/4
|
||||
# ✔ Network mm_v2_default Created 0.1s
|
||||
# ✔ Volume "mm_v2_peers_ids" Created 0.0s
|
||||
# ✔ Volume "mm_v2_mobymask_deployment" Created 0.0s
|
||||
# ✔ Container mm_v2-lxdao-mobymask-app-1 Started 1.1s
|
||||
```
|
||||
|
||||
This will run the `lxdao-mobymask-app` (at `http://localhost:3004`) pointed to `CERC_APP_WATCHER_URL` for GQL queries
|
||||
|
||||
To monitor the running container:
|
||||
|
||||
```bash
|
||||
# With status
|
||||
docker ps
|
||||
|
||||
# Expected output:
|
||||
|
||||
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
# f1369dbae1c9 cerc/mobymask-ui:local "docker-entrypoint.s…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:3004->80/tcp mm_v2-lxdao-mobymask-app-1
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f mm_v2-lxdao-mobymask-app-1
|
||||
|
||||
# Expected output:
|
||||
|
||||
# .
|
||||
# .
|
||||
# .
|
||||
# Available on:
|
||||
# http://127.0.0.1:80
|
||||
# http://192.168.0.2:80
|
||||
# Hit CTRL-C to stop the server
|
||||
```
|
||||
|
||||
Note: For opening an invite link on this deployed app, replace the URL part before `/#` with `http://localhost:3004`
|
||||
For example: `http://localhost:3004/#/members?invitation=XYZ`
|
||||
|
||||
In order to host the app using a public domain, configure your website with SSL and `https` traffic reverse proxied to port `3004`.
|
||||
|
||||
For example, a Nginx configuration for domain `my-mobymask-app.example.com` would look something like:
|
||||
|
||||
```bash
|
||||
server {
|
||||
server_name my-mobymask-app.example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3004;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
listen [::]:443 ssl;
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/letsencrypt/live/my-mobymask-app.example.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/my-mobymask-app.example.com/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
}
|
||||
|
||||
server {
|
||||
if ($host = my-mobymask-app.example.com) {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
server_name my-mobymask-app.example.com;
|
||||
listen 80;
|
||||
return 404; # managed by Certbot
|
||||
}
|
||||
```
|
||||
|
||||
## Clean up
|
||||
|
||||
Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --cluster mm_v2 --include mobymask-app down
|
||||
|
||||
# Expected output:
|
||||
|
||||
# [+] Running 2/2
|
||||
# ✔ Container mm_v2-lxdao-mobymask-app-1 Removed 10.6s
|
||||
# ✔ Network mm_v2_default Removed 0.5s
|
||||
```
|
||||
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter "name=mm_v2"
|
||||
|
||||
# Expected output:
|
||||
|
||||
# mm_v2_mobymask_deployment
|
||||
# mm_v2_peers_ids
|
||||
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter "name=mm_v2")
|
||||
```
|
||||
@@ -22,16 +22,12 @@ Create and update an env file to be used in the next step ([defaults](../../conf
|
||||
|
||||
```bash
|
||||
# Set of relay nodes to be used by the web-app
|
||||
# (use double quotes " for strings)
|
||||
# (use double quotes " for strings, avoid space after commas)
|
||||
# Eg. CERC_RELAY_NODES=["/dns4/example.com/tcp/443/wss/p2p/12D3KooWGHmDDCc93XUWL16FMcTPCGu2zFaMkf67k8HZ4gdQbRDr"]
|
||||
CERC_RELAY_NODES=[]
|
||||
|
||||
# Also add if running MobyMask app:
|
||||
|
||||
# External watcher endpoint (to check if watcher is up)
|
||||
CERC_WATCHER_HOST=
|
||||
CERC_WATCHER_PORT=
|
||||
|
||||
# Watcher endpoint used by the app for GQL queries
|
||||
CERC_APP_WATCHER_URL="http://127.0.0.1:3001"
|
||||
|
||||
@@ -50,7 +46,7 @@ For running mobymask-app
|
||||
```bash
|
||||
laconic-so --stack mobymask-v2 deploy --include mobymask-app --env-file <PATH_TO_ENV_FILE> up
|
||||
|
||||
# Runs on host port 3002
|
||||
# Runs mobymask-app on host port 3002 and lxdao-mobymask-app on host port 3004
|
||||
```
|
||||
|
||||
For running peer-test-app
|
||||
|
||||
@@ -74,7 +74,13 @@ def command(ctx, include, exclude, env_file, cluster, command, extra_args):
|
||||
elif command == "down":
|
||||
if verbose:
|
||||
print("Running compose down")
|
||||
docker.compose.down()
|
||||
|
||||
timeout_arg = None
|
||||
if extra_args_list:
|
||||
timeout_arg=extra_args_list[0]
|
||||
|
||||
# Specify shutdown timeout (default 10s) to give services enough time to shutdown gracefully
|
||||
docker.compose.down(timeout=timeout_arg)
|
||||
elif command == "exec":
|
||||
if extra_args_list is None or len(extra_args_list) < 2:
|
||||
print("Usage: exec <service> <cmd>")
|
||||
|
||||
Reference in New Issue
Block a user