Compare commits

...
Author SHA1 Message Date
roysc ff616db4ad Updates for running IPLD-ETH CI tests (#414)
* random nits

* geth - visibility of migration status

* forward CERC_RUN_STATEDIFF to geth container

* fix ipld-eth-server vars

* fix fixturenet-eth-loaded stack

* fixturenet geth genesis - include mergeNetsplitBlock

* forward CERC_STATEDIFF_DB_GOOSE_MIN_VER to env file

* add TAG_SUFFIX arg to lighthouse build

  intended to avoid sporadic failures when running lcli on github CI runners, likely related to non-portable builds
2023-05-31 03:10:58 -05:00
dboreham 9880b48b78 Add foundry to fixturenet-plugeth-tx (#418) 2023-05-30 23:51:01 -06:00
telackey 23a336020c Make a separate lighthouse container for the plugeth fixturenet. (#412)
* Make a separate lighthouse container for the plugeth fixturenet.
2023-05-26 16:57:15 -05:00
Zach 605db8a4d2 Update pokt README (#413)
* Update pokt README

* split cmds from responses
2023-05-26 10:37:59 -04:00
telackey 6ec55ba460 Add a plugeth-based version of the fixturenet (#411)
* plugeth version of the fixturenet

* Use pre-built plugeth.
2023-05-25 11:21:08 -05:00
dboreham 938f51ef8c Specify chunker stack branches (#410)
* Specify v5 branches

* Fix logic for branch switch
2023-05-24 20:00:42 -06:00
dboreham 6d620ba9c2 git branch in stack and on command line (#409)
* Support @branch notation in stack.yml

* Refactor and support branches directive
2023-05-24 19:49:26 -06:00
erikdiesanddboreham 0c4c128465 cleanup Options boilerplate (#402)
Co-authored-by: David Boreham <david@bozemanpass.com>
2023-05-24 18:02:25 -06:00
dboreham 97c1ae1c43 Use upstream act_runner project (#408) 2023-05-24 18:01:49 -06:00
dboreham ec6b5439f4 Support for git hosts other than github (#407)
* Update repository list file

* Add host part to repo name

* Allow git hosts other than github
2023-05-24 17:19:21 -06:00
dboreham 1d8f252a51 Detect bad reponse from yarn info (#406) 2023-05-22 13:42:55 -06:00
dboreham 161665ef72 Fix deploy commands (#404)
* Fix bugs

* Add test for deploy port command
2023-05-22 12:43:59 -06:00
dboreham 9c5f6469ff Allow docker buildkit to be enabled via env var (#403) 2023-05-22 11:38:34 -06:00
dboreham 85225c72d7 Fix another typo 2023-05-21 15:43:15 -06:00
dboreham 223d1171e8 Change test display name 2023-05-21 07:42:09 -06:00
dboreham 1e38e16550 Fix typo 2023-05-21 07:40:22 -06:00
dboreham dddae8cc7a Dboreham/deploy volume control (#401)
* Implement volume control

* Deploy test

* Add test for volumes

* Enable CI for deploy test
2023-05-21 07:39:00 -06:00
telackey aa702737ef Fix 397 by pegging alpine version. 2023-05-19 11:26:09 -05:00
56 changed files with 718 additions and 217 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Deploy Test
on:
pull_request:
branches: '*'
push:
branches:
- main
- ci-test
# Needed until we can incorporate docker startup into the executor container
env:
DOCKER_HOST: unix:///var/run/dind.sock
jobs:
test:
name: "Run deploy test suite"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: "Install Python"
uses: cerc-io/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install shiv"
run: pip install shiv
- name: "Generate build version file"
run: ./scripts/create_build_tag_file.sh
- name: "Build local shiv package"
run: ./scripts/build_shiv_package.sh
- name: Start dockerd # Also needed until we can incorporate into the executor
run: |
dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5
- name: "Run deploy tests"
run: ./tests/deploy/run-deploy-test.sh
+1 -1
View File
@@ -1,4 +1,4 @@
name: Integration Test name: Smoke Test
on: on:
pull_request: pull_request:
+29
View File
@@ -0,0 +1,29 @@
name: Deploy Test
on:
pull_request:
branches: '*'
push:
branches: '*'
jobs:
test:
name: "Run deploy test suite"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: "Install Python"
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install shiv"
run: pip install shiv
- name: "Generate build version file"
run: ./scripts/create_build_tag_file.sh
- name: "Build local shiv package"
run: ./scripts/build_shiv_package.sh
- name: "Run deploy tests"
run: ./tests/deploy/run-deploy-test.sh
+1 -1
View File
@@ -1,4 +1,4 @@
name: Test name: Smoke Test
on: on:
pull_request: pull_request:
+1 -1
View File
@@ -90,7 +90,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
"CERC_CONTAINER_BASE_DIR": container_build_dir, "CERC_CONTAINER_BASE_DIR": container_build_dir,
"CERC_HOST_UID": f"{os.getuid()}", "CERC_HOST_UID": f"{os.getuid()}",
"CERC_HOST_GID": f"{os.getgid()}", "CERC_HOST_GID": f"{os.getgid()}",
"DOCKER_BUILDKIT": "0" "DOCKER_BUILDKIT": config("DOCKER_BUILDKIT", default="0")
} }
container_build_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {}) container_build_env.update({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
container_build_env.update({"CERC_FORCE_REBUILD": "true"} if force_rebuild else {}) container_build_env.update({"CERC_FORCE_REBUILD": "true"} if force_rebuild else {})
@@ -22,7 +22,7 @@ services:
- SYS_PTRACE - SYS_PTRACE
environment: environment:
CERC_REMOTE_DEBUG: "true" CERC_REMOTE_DEBUG: "true"
CERC_RUN_STATEDIFF: "detect" CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
CERC_STATEDIFF_DB_NODE_ID: 1 CERC_STATEDIFF_DB_NODE_ID: 1
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
env_file: env_file:
@@ -0,0 +1,129 @@
services:
fixturenet-eth-bootnode-geth:
restart: always
hostname: fixturenet-eth-bootnode-geth
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-plugeth-plugeth:local
volumes:
- fixturenet_plugeth_bootnode_geth_data:/root/ethdata
- ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins
ports:
- "9898"
- "30303"
fixturenet-eth-geth-1:
restart: always
hostname: fixturenet-eth-geth-1
cap_add:
- SYS_PTRACE
environment:
CERC_REMOTE_DEBUG: "true"
CERC_RUN_STATEDIFF: "detect"
CERC_STATEDIFF_DB_NODE_ID: 1
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-plugeth-plugeth:local
volumes:
- fixturenet_plugeth_geth_1_data:/root/ethdata
- ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8545/"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
depends_on:
- fixturenet-eth-bootnode-geth
ports:
- "8545"
- "40000"
- "6060"
fixturenet-eth-geth-2:
restart: always
hostname: fixturenet-eth-geth-2
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8545/"]
interval: 30s
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-plugeth-plugeth:local
depends_on:
- fixturenet-eth-bootnode-geth
volumes:
- fixturenet_plugeth_geth_2_data:/root/ethdata
- ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins
fixturenet-eth-bootnode-lighthouse:
restart: always
hostname: fixturenet-eth-bootnode-lighthouse
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-plugeth-lighthouse:local
fixturenet-eth-lighthouse-1:
restart: always
hostname: fixturenet-eth-lighthouse-1
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8001/eth/v2/beacon/blocks/head"]
interval: 30s
timeout: 10s
retries: 10
start_period: 30s
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
NODE_NUMBER: "1"
ETH1_ENDPOINT: "http://fixturenet-eth-geth-1:8545"
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-1:8551"
image: cerc/fixturenet-plugeth-lighthouse:local
volumes:
- fixturenet_plugeth_lighthouse_1_data:/opt/testnet/build/cl
depends_on:
fixturenet-eth-bootnode-lighthouse:
condition: service_started
fixturenet-eth-geth-1:
condition: service_healthy
ports:
- "8001"
fixturenet-eth-lighthouse-2:
restart: always
hostname: fixturenet-eth-lighthouse-2
healthcheck:
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:8001/eth/v2/beacon/blocks/head"]
interval: 30s
timeout: 10s
retries: 10
start_period: 30s
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
environment:
NODE_NUMBER: "2"
ETH1_ENDPOINT: "http://fixturenet-eth-geth-2:8545"
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-2:8551"
LIGHTHOUSE_GENESIS_STATE_URL: "http://fixturenet-eth-lighthouse-1:8001/eth/v2/debug/beacon/states/0"
image: cerc/fixturenet-plugeth-lighthouse:local
volumes:
- fixturenet_plugeth_lighthouse_2_data:/opt/testnet/build/cl
depends_on:
fixturenet-eth-bootnode-lighthouse:
condition: service_started
fixturenet-eth-geth-2:
condition: service_healthy
volumes:
fixturenet_plugeth_bootnode_geth_data:
fixturenet_plugeth_geth_1_data:
fixturenet_plugeth_geth_2_data:
fixturenet_plugeth_lighthouse_1_data:
fixturenet_plugeth_lighthouse_2_data:
@@ -7,11 +7,9 @@ services:
condition: service_healthy condition: service_healthy
image: cerc/ipld-eth-server:local image: cerc/ipld-eth-server:local
environment: environment:
IPLD_SERVER_GRAPHQL: "true" SERVER_HTTP_PATH: 0.0.0.0:8081
IPLD_POSTGRAPHILEPATH: http://graphql:5000 SERVER_GRAPHQL: "true"
ETH_SERVER_HTTPPATH: 0.0.0.0:8081 SERVER_GRAPHQLPATH: 0.0.0.0:8082
ETH_SERVER_GRAPHQL: "true"
ETH_SERVER_GRAPHQLPATH: 0.0.0.0:8082
VDB_COMMAND: "serve" VDB_COMMAND: "serve"
ETH_CHAIN_CONFIG: "/tmp/chain.json" ETH_CHAIN_CONFIG: "/tmp/chain.json"
DATABASE_NAME: cerc_testing DATABASE_NAME: cerc_testing
@@ -17,7 +17,7 @@ CERC_STATEDIFF_DB_PORT=5432
CERC_STATEDIFF_DB_NAME="cerc_testing" CERC_STATEDIFF_DB_NAME="cerc_testing"
CERC_STATEDIFF_DB_USER="vdbm" CERC_STATEDIFF_DB_USER="vdbm"
CERC_STATEDIFF_DB_PASSWORD="password" CERC_STATEDIFF_DB_PASSWORD="password"
CERC_STATEDIFF_DB_GOOSE_MIN_VER=23 CERC_STATEDIFF_DB_GOOSE_MIN_VER=${CERC_STATEDIFF_DB_GOOSE_MIN_VER:-23}
CERC_STATEDIFF_DB_LOG_STATEMENTS="false" CERC_STATEDIFF_DB_LOG_STATEMENTS="false"
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5" CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
@@ -0,0 +1 @@
See: https://docs.plugeth.org/
@@ -27,8 +27,8 @@ yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null)
# If it doesn't exist there will be no .data.dist.tarball element, # If it doesn't exist there will be no .data.dist.tarball element,
# and jq will output the string "null" # and jq will output the string "null"
package_tarball=$(echo $yarn_info_output | jq -r .data.dist.tarball) package_tarball=$(echo $yarn_info_output | jq -r .data.dist.tarball)
if [[ $package_tarball == "null" ]]; then if [[ "$yarn_info_output" == "" || $package_tarball == "null" ]]; then
echo "FATAL: Target package version ($versioned_target_package) not found" >&2 echo "FATAL: Target package version ($versioned_target_package) not found (or bad npm auth token)" >&2
exit 1 exit 1
fi fi
# Code below parses out the values we need # Code below parses out the values we need
@@ -6,7 +6,7 @@ RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM cerc/go-ethereum:local as geth FROM cerc/go-ethereum:local as geth
FROM alpine:latest FROM alpine:3.17
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
COPY --from=delve /go/bin/dlv /usr/local/bin/ COPY --from=delve /go/bin/dlv /usr/local/bin/
@@ -34,5 +34,7 @@ python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
jq ".config.istanbulBlock=$istanbul_block" | \ jq ".config.istanbulBlock=$istanbul_block" | \
jq ".config.berlinBlock=$berlin_block" | \ jq ".config.berlinBlock=$berlin_block" | \
jq ".config.londonBlock=$london_block" | \ jq ".config.londonBlock=$london_block" | \
jq ".config.mergeForkBlock=$merge_fork_block" > ../build/el/geth.json jq ".config.mergeForkBlock=$merge_fork_block" | \
jq ".config.mergeNetsplitBlock=$merge_fork_block" \
> ../build/el/geth.json
python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv
@@ -64,8 +64,8 @@ else
STATEDIFF_OPTS="" STATEDIFF_OPTS=""
if [ "$CERC_RUN_STATEDIFF" == "true" ]; then if [ "$CERC_RUN_STATEDIFF" == "true" ]; then
ready=0 ready=0
echo "Waiting for statediff DB..."
while [ $ready -eq 0 ]; do while [ $ready -eq 0 ]; do
echo "Waiting for statediff DB..."
sleep 1 sleep 1
export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD" export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD"
result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \ result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \
@@ -73,9 +73,13 @@ else
-U "$CERC_STATEDIFF_DB_USER" \ -U "$CERC_STATEDIFF_DB_USER" \
-d "$CERC_STATEDIFF_DB_NAME" \ -d "$CERC_STATEDIFF_DB_NAME" \
-t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }') -t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }')
if [ -n "$result" ] && [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then if [ -n "$result" ]; then
echo "DB ready..." echo "DB ready..."
ready=1 if [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then
ready=1
else
echo "DB not at required version (want $CERC_STATEDIFF_DB_GOOSE_MIN_VER, have $result)"
fi
fi fi
done done
STATEDIFF_OPTS="--statediff=true \ STATEDIFF_OPTS="--statediff=true \
@@ -15,9 +15,6 @@ GENESIS_VALIDATOR_COUNT=${GENESIS_VALIDATOR_COUNT:-80}
# Number of beacon_node instances that you intend to run # Number of beacon_node instances that you intend to run
BN_COUNT=${BN_COUNT:-2} BN_COUNT=${BN_COUNT:-2}
# Number of validator clients
VC_COUNT=${VC_COUNT:-$BN_COUNT}
# Number of seconds to delay to start genesis block. # Number of seconds to delay to start genesis block.
# If started by a script this can be 0, if starting by hand # If started by a script this can be 0, if starting by hand
# use something like 180. # use something like 180.
@@ -4,7 +4,14 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
fi fi
MIN_BLOCK_NUM=${1:-${MIN_BLOCK_NUM:-3}} 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") STATUSES=(
"geth to generate DAG"
"beacon phase0"
"beacon altair"
"beacon bellatrix pre-merge"
"beacon bellatrix merge"
"block number $MIN_BLOCK_NUM"
)
STATUS=0 STATUS=0
LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL} LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL}
@@ -36,7 +43,6 @@ MARKER="."
function inc_status() { function inc_status() {
echo " done" echo " done"
MARKEr="."
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]}..."
@@ -0,0 +1,27 @@
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
FROM golang:1.19.4-bullseye AS delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python3-dev python3-pip curl wget jq gettext gettext-base openssl bash dnsutils postgresql-client make iproute2 netcat && \
rm -rf /var/lib/apt/lists/*
COPY --from=delve /go/bin/dlv /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
COPY --from=ethgen /apps /apps
RUN wget -O /usr/local/bin/geth https://github.com/openrelayxyz/plugeth/releases/download/v1.11.6.1.0/geth-linux-amd64-v1.1.0-v1.11.6.1.0 && chmod a+x /usr/local/bin/geth
RUN cd /apps/el-gen && pip3 install -r requirements.txt
COPY genesis /opt/testnet
COPY run-el.sh /opt/testnet/run.sh
RUN cd /opt/testnet && make genesis-el
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"]
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-eth-plugeth
set -x
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ ! -d "${SCRIPT_DIR}/genesis" ]; then
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/genesis ${SCRIPT_DIR}/genesis
fi
if [ ! -d "${SCRIPT_DIR}/run-el.sh" ]; then
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/
fi
docker build -t cerc/fixturenet-eth-plugeth:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
@@ -0,0 +1,34 @@
FROM sigp/lcli:v4.1.0 AS lcli
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
FROM cerc/fixturenet-plugeth-plugeth:local AS fnetgeth
FROM cerc/lighthouse:local
# cerc/lighthouse is based on Ubuntu
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
libssl-dev ca-certificates \
curl socat iproute2 telnet wget jq \
build-essential python3 python3-dev python3-pip gettext-base \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY genesis /opt/testnet
COPY run-cl.sh /opt/testnet/run.sh
COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
COPY --from=ethgen /apps /apps
COPY --from=fnetgeth /opt/testnet/el /opt/testnet/el
COPY --from=fnetgeth /opt/testnet/build/el /opt/testnet/build/el
RUN cd /opt/testnet && make genesis-cl
# Work around some bugs in lcli where the default path is always used.
RUN mkdir -p /root/.lighthouse && cd /root/.lighthouse && ln -s /opt/testnet/build/cl/testnet
RUN mkdir -p /scripts
COPY scripts/status-internal.sh /scripts
COPY scripts/status.sh /scripts
ENTRYPOINT ["/opt/testnet/run.sh"]
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-plugeth-lighthouse
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ ! -d "${SCRIPT_DIR}/genesis" ]; then
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/genesis ${SCRIPT_DIR}/genesis
fi
if [ ! -e "${SCRIPT_DIR}/run-cl.sh" ]; then
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/run-cl.sh ${SCRIPT_DIR}/
fi
if [ ! -d "${SCRIPT_DIR}/scripts" ]; then
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/scripts ${SCRIPT_DIR}/
fi
docker build -t cerc/fixturenet-plugeth-lighthouse:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
@@ -0,0 +1,27 @@
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
FROM golang:1.19.4-bullseye AS delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python3-dev python3-pip curl wget jq gettext gettext-base openssl bash dnsutils postgresql-client make iproute2 netcat && \
rm -rf /var/lib/apt/lists/*
COPY --from=delve /go/bin/dlv /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
COPY --from=ethgen /apps /apps
RUN wget -O /usr/local/bin/geth https://github.com/openrelayxyz/plugeth/releases/download/v1.11.6.1.0/geth-linux-amd64-v1.1.0-v1.11.6.1.0 && chmod a+x /usr/local/bin/geth
RUN cd /apps/el-gen && pip3 install -r requirements.txt
COPY genesis /opt/testnet
COPY run-el.sh /opt/testnet/run.sh
RUN cd /opt/testnet && make genesis-el
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"]
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Build cerc/fixturenet-plugeth-plugeth
set -x
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ ! -d "${SCRIPT_DIR}/genesis" ]; then
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/genesis ${SCRIPT_DIR}/genesis
fi
if [ ! -e "${SCRIPT_DIR}/run-el.sh" ]; then
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/
fi
docker build -t cerc/fixturenet-plugeth-plugeth:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
@@ -16,7 +16,7 @@ db-waitforsync=bool Should the statediff service start once geth has synced to
rpc-port=port change RPC port (default: 8545) rpc-port=port change RPC port (default: 8545)
rpc-addr=address change RPC address (default: 127.0.0.1) rpc-addr=address change RPC address (default: 127.0.0.1)
chain-id=number change chain ID (default: 99) chain-id=number change chain ID (default: 99)
extra-args=name extra args to pass to geth on startup extra-args=name extra args to pass to geth on startup
period=seconds use a block time instead of instamine period=seconds use a block time instead of instamine
accounts=number create multiple accounts (default: 1) accounts=number create multiple accounts (default: 1)
address=address eth address to add to genesis address=address eth address to add to genesis
@@ -1,4 +1,5 @@
FROM sigp/lighthouse:v4.1.0-modern ARG TAG_SUFFIX="-modern"
FROM sigp/lighthouse:v4.1.0${TAG_SUFFIX}
RUN apt-get update; apt-get install bash netcat curl less jq -y; RUN apt-get update; apt-get install bash netcat curl less jq -y;
+36 -35
View File
@@ -1,35 +1,36 @@
cerc-io/ipld-eth-db github.com/cerc-io/ipld-eth-db
cerc-io/go-ethereum github.com/cerc-io/go-ethereum
cerc-io/ipld-eth-server github.com/cerc-io/ipld-eth-server
cerc-io/eth-statediff-service github.com/cerc-io/eth-statediff-service
cerc-io/eth-statediff-fill-service github.com/cerc-io/eth-statediff-fill-service
cerc-io/ipld-eth-db-validator github.com/cerc-io/ipld-eth-db-validator
cerc-io/ipld-eth-beacon-indexer github.com/cerc-io/ipld-eth-beacon-indexer
cerc-io/ipld-eth-beacon-db github.com/cerc-io/ipld-eth-beacon-db
cerc-io/laconicd github.com/cerc-io/laconicd
cerc-io/laconic-sdk github.com/cerc-io/laconic-sdk
cerc-io/laconic-registry-cli github.com/cerc-io/laconic-registry-cli
cerc-io/laconic-console github.com/cerc-io/laconic-console
cerc-io/mobymask-watcher github.com/cerc-io/mobymask-watcher
cerc-io/watcher-ts github.com/cerc-io/watcher-ts
cerc-io/mobymask-v2-watcher-ts github.com/cerc-io/mobymask-v2-watcher-ts
cerc-io/MobyMask github.com/cerc-io/MobyMask
vulcanize/uniswap-watcher-ts github.com/vulcanize/uniswap-watcher-ts
vulcanize/uniswap-v3-info github.com/vulcanize/uniswap-v3-info
vulcanize/assemblyscript github.com/vulcanize/assemblyscript
cerc-io/eth-probe github.com/cerc-io/eth-probe
cerc-io/tx-spammer github.com/cerc-io/tx-spammer
dboreham/foundry github.com/dboreham/foundry
lirewine/gem github.com/lirewine/gem
lirewine/debug github.com/lirewine/debug
lirewine/crypto github.com/lirewine/crypto
lirewine/sdk github.com/lirewine/sdk
telackey/act_runner github.com/telackey/act_runner
ethereum-optimism/op-geth github.com/ethereum-optimism/op-geth
ethereum-optimism/optimism github.com/ethereum-optimism/optimism
pokt-network/pocket-core github.com/pokt-network/pocket-core
pokt-network/pocket-core-deployments github.com/pokt-network/pocket-core-deployments
cerc-io/azimuth-watcher-ts github.com/cerc-io/azimuth-watcher-ts
cerc-io/ipld-eth-state-snapshot github.com/cerc-io/ipld-eth-state-snapshot
cerc-io/gelato-watcher-ts github.com/cerc-io/gelato-watcher-ts
filecoin-project/lotus github.com/filecoin-project/lotus
git.vdb.to/cerc-io/test-project
+1 -1
View File
@@ -1,7 +1,7 @@
version: "1.0" version: "1.0"
name: azimuth name: azimuth
repos: repos:
- cerc-io/azimuth-watcher-ts - github.com/cerc-io/azimuth-watcher-ts
containers: containers:
- cerc/watcher-azimuth - cerc/watcher-azimuth
pods: pods:
+4 -4
View File
@@ -2,10 +2,10 @@ version: "1.0"
name: chain-chunker name: chain-chunker
decription: "Stack to build containers for chain-chunker" decription: "Stack to build containers for chain-chunker"
repos: repos:
- cerc-io/ipld-eth-state-snapshot - github.com/cerc-io/ipld-eth-state-snapshot@v5
- cerc-io/eth-statediff-service - github.com/cerc-io/eth-statediff-service@v5
- cerc-io/ipld-eth-db - github.com/cerc-io/ipld-eth-db@v5
- cerc-io/ipld-eth-server - github.com/cerc-io/ipld-eth-server@v5
containers: containers:
- cerc/ipld-eth-state-snapshot - cerc/ipld-eth-state-snapshot
- cerc/eth-statediff-service - cerc/eth-statediff-service
+5 -5
View File
@@ -1,11 +1,11 @@
version: "1.0" version: "1.0"
name: erc20-watcher name: erc20-watcher
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- cerc-io/ipld-eth-db - github.com/cerc-io/ipld-eth-db
- cerc-io/ipld-eth-server - github.com/cerc-io/ipld-eth-server
- cerc-io/watcher-ts - github.com/cerc-io/watcher-ts
- dboreham/foundry - github.com/dboreham/foundry
containers: containers:
- cerc/foundry - cerc/foundry
- cerc/go-ethereum - cerc/go-ethereum
+4 -4
View File
@@ -1,10 +1,10 @@
version: "1.0" version: "1.0"
name: erc721-watcher name: erc721-watcher
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- cerc-io/ipld-eth-db - github.com/cerc-io/ipld-eth-db
- cerc-io/ipld-eth-server - github.com/cerc-io/ipld-eth-server
- cerc-io/watcher-ts - github.com/cerc-io/watcher-ts
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/go-ethereum-foundry - cerc/go-ethereum-foundry
@@ -2,12 +2,12 @@ version: "1.0"
name: fixturenet-eth-loaded name: fixturenet-eth-loaded
decription: "Loaded Ethereum Fixturenet" decription: "Loaded Ethereum Fixturenet"
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- cerc-io/tx-spammer - github.com/cerc-io/tx-spammer
- cerc-io/ipld-eth-server - github.com/cerc-io/ipld-eth-server
- cerc-io/ipld-eth-db - github.com/cerc-io/ipld-eth-db
- cerc/go-ethereum
containers: containers:
- cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
- cerc/fixturenet-eth-geth - cerc/fixturenet-eth-geth
- cerc/fixturenet-eth-lighthouse - cerc/fixturenet-eth-lighthouse
+2 -2
View File
@@ -2,8 +2,8 @@ version: "1.2"
name: fixturenet-eth-tx name: fixturenet-eth-tx
decription: "Ethereum Fixturenet w/ tx-spammer" decription: "Ethereum Fixturenet w/ tx-spammer"
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- cerc-io/tx-spammer - github.com/cerc-io/tx-spammer
- dboreham/foundry - dboreham/foundry
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
+2 -2
View File
@@ -1,6 +1,6 @@
# fixturenet-eth # fixturenet-eth
Instructions for deploying a local a geth + lighthouse blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator#user-mode)): Instructions for deploying a local a geth + lighthouse blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator)):
## Clone required repositories ## Clone required repositories
@@ -66,7 +66,7 @@ It is not necessary to use them all at once, but a complete example follows:
``` ```
# Setup # Setup
$ laconic-so setup-repositories --include cerc-io/go-ethereum,cerc-io/ipld-eth-db,cerc-io/ipld-eth-server,cerc-io/ipld-eth-beacon-db,cerc-io/ipld-eth-beacon-indexer,cerc-io/eth-probe,cerc-io/tx-spammer $ laconic-so setup-repositories --include github.com/cerc-io/go-ethereum,github.com/cerc-io/ipld-eth-db,github.com/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,github.com/cerc-io/tx-spammer
# Build # Build
$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer $ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer
+2 -2
View File
@@ -2,8 +2,8 @@ version: "1.1"
name: fixturenet-eth name: fixturenet-eth
decription: "Ethereum Fixturenet" decription: "Ethereum Fixturenet"
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- dboreham/foundry - github.com/dboreham/foundry
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
@@ -2,14 +2,14 @@ version: "1.1"
name: fixturenet-laconic-loaded name: fixturenet-laconic-loaded
description: "A full featured laconic fixturenet" description: "A full featured laconic fixturenet"
repos: repos:
- cerc-io/laconicd - github.com/cerc-io/laconicd
- lirewine/debug - github.com/lirewine/debug
- lirewine/crypto - github.com/lirewine/crypto
- lirewine/gem - github.com/lirewine/gem
- lirewine/sdk - github.com/lirewine/sdk
- cerc-io/laconic-sdk - github.com/cerc-io/laconic-sdk
- cerc-io/laconic-registry-cli - github.com/cerc-io/laconic-registry-cli
- cerc-io/laconic-console - github.com/cerc-io/laconic-console
npms: npms:
- laconic-sdk - laconic-sdk
- laconic-registry-cli - laconic-registry-cli
@@ -2,9 +2,9 @@ version: "1.0"
name: fixturenet-laconicd name: fixturenet-laconicd
description: "A laconicd fixturenet" description: "A laconicd fixturenet"
repos: repos:
- cerc-io/laconicd - github.com/cerc-io/laconicd
- cerc-io/laconic-sdk - github.com/cerc-io/laconic-sdk
- cerc-io/laconic-registry-cli - github.com/cerc-io/laconic-registry-cli
npms: npms:
- laconic-sdk - laconic-sdk
- laconic-registry-cli - laconic-registry-cli
+1 -1
View File
@@ -2,7 +2,7 @@ version: "1.0"
name: fixturenet-lotus name: fixturenet-lotus
description: "A lotus fixturenet" description: "A lotus fixturenet"
repos: repos:
- filecoin-project/lotus - github.com/filecoin-project/lotus
containers: containers:
- cerc/lotus - cerc/lotus
pods: pods:
@@ -9,7 +9,7 @@ Prerequisite: An L1 Ethereum RPC endpoint
Clone required repositories: Clone required repositories:
```bash ```bash
laconic-so --stack fixturenet-optimism setup-repositories --exclude cerc-io/go-ethereum laconic-so --stack fixturenet-optimism setup-repositories --exclude github.com/cerc-io/go-ethereum
# 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 # 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
``` ```
@@ -2,10 +2,10 @@ version: "1.0"
name: fixturenet-optimism name: fixturenet-optimism
decription: "Optimism Fixturenet" decription: "Optimism Fixturenet"
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- dboreham/foundry - github.com/dboreham/foundry
- ethereum-optimism/optimism - github.com/ethereum-optimism/optimism
- ethereum-optimism/op-geth - github.com/ethereum-optimism/op-geth
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
@@ -0,0 +1,19 @@
# fixturenet-plugeth-tx
A variation of `fixturenet-eth` that uses `plugeth` instead of `go-ethereum`.
See `stacks/fixturenet-eth/README.md` for more information.
## Containers
* cerc/lighthouse
* cerc/fixturenet-eth-plugeth
* cerc/fixturenet-eth-lighthouse
* cerc/tx-spammer
## Deploy the stack
```
$ laconic-so --stack fixturenet-plugeth-tx setup-repositories
$ laconic-so --stack fixturenet-plugeth-tx build-containers
$ laconic-so --stack fixturenet-plugeth-tx deploy up
```
@@ -0,0 +1,16 @@
version: "1.2"
name: fixturenet-plugeth-tx
decription: "plugeth Ethereum Fixturenet w/ tx-spammer"
repos:
- github.com/cerc-io/tx-spammer
- dboreham/foundry
containers:
- cerc/lighthouse
- cerc/fixturenet-plugeth-plugeth
- cerc/fixturenet-plugeth-lighthouse
- cerc/tx-spammer
- cerc/foundry
pods:
- fixturenet-plugeth
- foundry
- tx-spammer
+18 -17
View File
@@ -1,41 +1,41 @@
# Pocket Fixturenet # Pocket Fixturenet
Instructions for deploying a local single-node Pocket chain alongside a geth + lighthouse blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator. Instructions for deploying a local single-node Pocket chain alongside a geth + lighthouse blockchain "fixturenet" for development and testing purposes using Stack Orchestrator.
## 1. Build Laconic Stack Orchestrator ## 1. Clone required repositories
Build this fork of Laconic Stack Orchestrator which includes the fixturenet-pocket stack:
```
$ scripts/build_shiv_package.sh
$ cd package
$ mv laconic-so-{version} /usr/local/bin/laconic-so # Or move laconic-so to ~/bin or your favorite on-path directory
```
## 2. Clone required repositories
``` ```
$ laconic-so --stack fixturenet-pocket setup-repositories $ laconic-so --stack fixturenet-pocket setup-repositories
``` ```
## 3. Build the stack's containers ## 2. Build the stack's containers
``` ```
$ laconic-so --stack fixturenet-pocket build-containers $ laconic-so --stack fixturenet-pocket build-containers
``` ```
## 4. Deploy the stack ## 3. Deploy the stack
``` ```
$ laconic-so --stack fixturenet-pocket deploy up $ laconic-so --stack fixturenet-pocket deploy up
``` ```
It may take up to 10 minutes for the Eth Fixturenet to fully come online and start producing blocks. It may take up to 10 minutes for the Eth Fixturenet to fully come online and start producing blocks.
## 5. Check status
## 4. Check status
**Eth Fixturenet:** **Eth Fixturenet:**
``` ```
$ laconic-so --stack fixturenet-pocket deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh $ laconic-so --stack fixturenet-pocket deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh
```
Response:
```
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
``` ```
**Pocket node:** **Pocket node:**
``` ```
$ laconic-so --stack fixturenet-pocket deploy exec pocket "pocket query height" $ laconic-so --stack fixturenet-pocket deploy exec pocket "pocket query height"
```
Response:
```
2023/04/20 08:07:46 Initializing Pocket Datadir 2023/04/20 08:07:46 Initializing Pocket Datadir
2023/04/20 08:07:46 datadir = /home/app/.pocket 2023/04/20 08:07:46 datadir = /home/app/.pocket
http://localhost:8081/v1/query/height http://localhost:8081/v1/query/height
@@ -43,17 +43,18 @@ http://localhost:8081/v1/query/height
"height": 4 "height": 4
} }
``` ```
or or see the full logs:
``` ```
$ laconic-so --stack fixturenet-pocket deploy logs pocket $ laconic-so --stack fixturenet-pocket deploy logs pocket
``` ```
## 6. Send a relay request to Pocket node ## 5. Send a relay request to Pocket node
The Pocket node serves relay requests at `http://localhost:8081/v1/client/sim` The Pocket node serves relay requests at `http://localhost:8081/v1/client/sim`
**Example request:**
Example request:
``` ```
$ curl -X POST --data '{"relay_network_id":"0021","payload":{"data":"{\"jsonrpc\": \"2.0\",\"id\": 1,\"method\": \"eth_blockNumber\",\"params\": []}","method":"POST","path":"","headers":{}}}' http://localhost:8081/v1/client/sim $ curl -X POST --data '{"relay_network_id":"0021","payload":{"data":"{\"jsonrpc\": \"2.0\",\"id\": 1,\"method\": \"eth_blockNumber\",\"params\": []}","method":"POST","path":"","headers":{}}}' http://localhost:8081/v1/client/sim
``` ```
**Response:** Response:
``` ```
"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x6fe\"}\n" "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x6fe\"}\n"
``` ```
+3 -3
View File
@@ -2,9 +2,9 @@ version: "1.0"
name: fixturenet-pocket name: fixturenet-pocket
description: "A single node pocket chain that can serve relays from the geth-1 node in eth-fixturenet" description: "A single node pocket chain that can serve relays from the geth-1 node in eth-fixturenet"
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- pokt-network/pocket-core - github.com/pokt-network/pocket-core
- pokt-network/pocket-core-deployments # contains the dockerfile - github.com/pokt-network/pocket-core-deployments # contains the dockerfile
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
+1 -1
View File
@@ -1,7 +1,7 @@
version: "1.0" version: "1.0"
name: gelato name: gelato
repos: repos:
- cerc-io/gelato-watcher-ts - github.com/cerc-io/gelato-watcher-ts
containers: containers:
- cerc/watcher-gelato - cerc/watcher-gelato
pods: pods:
+1 -1
View File
@@ -9,7 +9,7 @@ Prerequisite: L2 Optimism Geth and Node RPC endpoints
Clone required repositories: Clone required repositories:
```bash ```bash
laconic-so --stack mobymask-v2 setup-repositories --include cerc-io/MobyMask,cerc-io/watcher-ts,cerc-io/mobymask-v2-watcher-ts laconic-so --stack mobymask-v2 setup-repositories --include github.com/cerc-io/MobyMask,github.com/cerc-io/watcher-ts,github.com/cerc-io/mobymask-v2-watcher-ts
# 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 # 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
``` ```
+7 -7
View File
@@ -1,13 +1,13 @@
version: "1.0" version: "1.0"
name: mobymask-v2 name: mobymask-v2
repos: repos:
- cerc-io/go-ethereum - github.com/cerc-io/go-ethereum
- dboreham/foundry - github.com/dboreham/foundry
- ethereum-optimism/optimism - github.com/ethereum-optimism/optimism
- ethereum-optimism/op-geth - github.com/ethereum-optimism/op-geth
- cerc-io/watcher-ts - github.com/cerc-io/watcher-ts
- cerc-io/mobymask-v2-watcher-ts - github.com/cerc-io/mobymask-v2-watcher-ts
- cerc-io/MobyMask - github.com/cerc-io/MobyMask
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
@@ -14,7 +14,7 @@ This demo has been tested on a `Ubuntu 22.04 LTS` machine with `8GB` of RAM
Clone required repositories: Clone required repositories:
```bash ```bash
laconic-so --stack mobymask-v2 setup-repositories --include cerc-io/MobyMask,cerc-io/watcher-ts,cerc-io/mobymask-v2-watcher-ts laconic-so --stack mobymask-v2 setup-repositories --include github.com/cerc-io/MobyMask,github.com/cerc-io/watcher-ts,github.com/cerc-io/mobymask-v2-watcher-ts
# This will clone the required repositories at ~/cerc # This will clone the required repositories at ~/cerc
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned in the next step and re-run the command # If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned in the next step and re-run the command
+1 -1
View File
@@ -11,7 +11,7 @@ This deployment expects that ipld-eth-server's endpoints are available on the lo
## Clone required repositories ## Clone required repositories
``` ```
$ laconic-so setup-repositories --include cerc-io/watcher-ts $ laconic-so setup-repositories --include github.com/cerc-io/watcher-ts
``` ```
## Build the watcher container ## Build the watcher container
+1 -1
View File
@@ -1,7 +1,7 @@
version: "1.0" version: "1.0"
name: mobymask-watcher name: mobymask-watcher
repos: repos:
- cerc-io/watcher-ts/v0.2.19 - github.com/cerc-io/watcher-ts/v0.2.19
containers: containers:
- cerc/watcher-mobymask - cerc/watcher-mobymask
pods: pods:
+2 -2
View File
@@ -2,8 +2,8 @@ version: "1.1"
name: package-registry name: package-registry
decription: "Local Package Registry" decription: "Local Package Registry"
repos: repos:
- cerc-io/hosting - github.com/cerc-io/hosting
- telackey/act_runner - gitea.com/gitea/act_runner
containers: containers:
- cerc/act-runner - cerc/act-runner
- cerc/act-runner-task-executor - cerc/act-runner-task-executor
+2 -1
View File
@@ -2,7 +2,8 @@ version: "1.0"
name: test name: test
description: "A test stack" description: "A test stack"
repos: repos:
- cerc-io/laconicd - github.com/cerc-io/laconicd
- git.vdb.to/cerc-io/test-project@test-branch
containers: containers:
- cerc/test-container - cerc/test-container
pods: pods:
+2 -2
View File
@@ -1,8 +1,8 @@
version: "1.0" version: "1.0"
name: uniswap-v3 name: uniswap-v3
repos: repos:
- vulcanize/uniswap-watcher-ts - github.com/vulcanize/uniswap-watcher-ts
- vulcanize/uniswap-v3-info - github.com/vulcanize/uniswap-v3-info
containers: containers:
- cerc/watcher-uniswap-v3 - cerc/watcher-uniswap-v3
- cerc/uniswap-v3-info - cerc/uniswap-v3-info
+6 -6
View File
@@ -67,15 +67,15 @@ def up(ctx, extra_args):
if global_context.verbose: if global_context.verbose:
print(f"Running compose up with container_exec_env: {container_exec_env}, extra_args: {extra_args_list}") print(f"Running compose up with container_exec_env: {container_exec_env}, extra_args: {extra_args_list}")
for pre_start_command in cluster_context.pre_start_commands: for pre_start_command in cluster_context.pre_start_commands:
_run_command(ctx.obj, cluster_context.cluster, pre_start_command) _run_command(global_context, cluster_context.cluster, pre_start_command)
ctx.obj.docker.compose.up(detach=True, services=extra_args_list) ctx.obj.docker.compose.up(detach=True, services=extra_args_list)
for post_start_command in cluster_context.post_start_commands: for post_start_command in cluster_context.post_start_commands:
_run_command(ctx.obj, cluster_context.cluster, post_start_command) _run_command(global_context, cluster_context.cluster, post_start_command)
_orchestrate_cluster_config(ctx.obj, cluster_context.config, ctx.obj.docker, container_exec_env) _orchestrate_cluster_config(global_context, cluster_context.config, ctx.obj.docker, container_exec_env)
@command.command() @command.command()
@click.option("--delete-volumes", default=False, help="delete data volumes") @click.option("--delete-volumes/--preserve-volumes", default=False, help="delete data volumes")
@click.argument('extra_args', nargs=-1) # help: command: down<service1> <service2> @click.argument('extra_args', nargs=-1) # help: command: down<service1> <service2>
@click.pass_context @click.pass_context
def down(ctx, delete_volumes, extra_args): def down(ctx, delete_volumes, extra_args):
@@ -88,7 +88,7 @@ def down(ctx, delete_volumes, extra_args):
if extra_args_list: if extra_args_list:
timeout_arg = extra_args_list[0] timeout_arg = extra_args_list[0]
# Specify shutdown timeout (default 10s) to give services enough time to shutdown gracefully # Specify shutdown timeout (default 10s) to give services enough time to shutdown gracefully
ctx.obj.docker.compose.down(timeout=timeout_arg) ctx.obj.docker.compose.down(timeout=timeout_arg, volumes=delete_volumes)
@command.command() @command.command()
@@ -130,7 +130,7 @@ def port(ctx, extra_args):
sys.exit(1) sys.exit(1)
service_name = extra_args_list[0] service_name = extra_args_list[0]
exposed_port = extra_args_list[1] exposed_port = extra_args_list[1]
if ctx.parent.obj.verbose: if global_context.verbose:
print(f"Running compose port {service_name} {exposed_port}") print(f"Running compose port {service_name} {exposed_port}")
mapped_port_data = ctx.obj.docker.compose.port(service_name, exposed_port) mapped_port_data = ctx.obj.docker.compose.port(service_name, exposed_port)
print(f"{mapped_port_data[0]}:{mapped_port_data[1]}") print(f"{mapped_port_data[0]}:{mapped_port_data[1]}")
+119 -59
View File
@@ -52,15 +52,111 @@ def is_git_repo(path):
# ) # )
def branch_strip(s):
return s.split('@')[0]
def host_and_path_for_repo(fully_qualified_repo):
repo_branch_split = fully_qualified_repo.split("@")
repo_branch = repo_branch_split[-1] if len(repo_branch_split) > 1 else None
repo_host_split = repo_branch_split[0].split("/")
# Legacy unqualified repo means github
if len(repo_host_split) == 2:
return "github.com", "/".join(repo_host_split), repo_branch
else:
if len(repo_host_split) == 3:
# First part is the host
return repo_host_split[0], "/".join(repo_host_split[1:]), repo_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):
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}/"
full_github_repo_path = f"{git_ssh_prefix if git_ssh else git_http_prefix}{repo_path}"
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 = git.Repo(full_filesystem_repo_path).active_branch.name if is_present else None
if not quiet:
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
if is_present:
if not is_git_repo(full_filesystem_repo_path):
print(f"Error: {full_filesystem_repo_path} does not contain a valid git repository")
sys.exit(1)
else:
if pull:
if verbose:
print(f"Running git pull for {full_filesystem_repo_path}")
if not check_only:
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:
# Clone
if verbose:
print(f'Running git clone for {full_github_repo_path} into {full_filesystem_repo_path}')
if not dry_run:
git.Repo.clone_from(full_github_repo_path,
full_filesystem_repo_path,
progress=None if quiet else GitProgress())
else:
print("(git clone skipped)")
# Checkout the requested branch, if one was specified
branch_to_checkout = None
if branches_array:
# Find the current repo in the branches list
print("Checking")
for repo_branch in branches_array:
repo_branch_tuple = repo_branch.split(" ")
if repo_branch_tuple[0] == branch_strip(fully_qualified_repo):
# checkout specified branch
branch_to_checkout = repo_branch_tuple[1]
else:
branch_to_checkout = repo_branch
if 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_repo.git.checkout(branch_to_checkout)
else:
if verbose:
print(f"repo {repo_path} is already switched to branch {branch_to_checkout}")
def parse_branches(branches_string):
if branches_string:
result_array = []
branches_directives = branches_string.split(",")
for branch_directive in branches_directives:
split_directive = branch_directive.split("@")
if len(split_directive) != 2:
print(f"Error: branch specified is not valid: {branch_directive}")
sys.exit(1)
result_array.append(f"{split_directive[0]} {split_directive[1]}")
return result_array
else:
return None
@click.command() @click.command()
@click.option("--include", help="only clone these repositories") @click.option("--include", help="only clone these repositories")
@click.option("--exclude", help="don\'t clone these repositories") @click.option("--exclude", help="don\'t clone these repositories")
@click.option('--git-ssh', is_flag=True, default=False) @click.option('--git-ssh', is_flag=True, default=False)
@click.option('--check-only', is_flag=True, default=False) @click.option('--check-only', is_flag=True, default=False)
@click.option('--pull', is_flag=True, default=False) @click.option('--pull', is_flag=True, default=False)
@click.option("--branches", help="override branches for repositories")
@click.option('--branches-file', help="checkout branches specified in this file") @click.option('--branches-file', help="checkout branches specified in this file")
@click.pass_context @click.pass_context
def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file): def command(ctx, include, exclude, git_ssh, check_only, pull, branches, branches_file):
'''git clone the set of repositories required to build the complete system from source''' '''git clone the set of repositories required to build the complete system from source'''
quiet = ctx.obj.quiet quiet = ctx.obj.quiet
@@ -68,16 +164,29 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file):
dry_run = ctx.obj.dry_run dry_run = ctx.obj.dry_run
stack = ctx.obj.stack stack = ctx.obj.stack
branches = [] branches_array = []
# TODO: branches file needs to be re-worked in the context of stacks # TODO: branches file needs to be re-worked in the context of stacks
if branches_file: if branches_file:
if verbose: if branches:
print(f"loading branches from: {branches_file}") print("Error: can't specify both --branches and --branches-file")
with open(branches_file) as branches_file_open: sys.exit(1)
branches = branches_file_open.read().splitlines() else:
if verbose: if verbose:
print(f"Branches are: {branches}") print(f"loading branches from: {branches_file}")
with open(branches_file) as branches_file_open:
branches_array = branches_file_open.read().splitlines()
print(f"branches: {branches}")
if branches:
if branches_file:
print("Error: can't specify both --branches and --branches-file")
sys.exit(1)
else:
branches_array = parse_branches(branches)
if branches_array and verbose:
print(f"Branches are: {branches_array}")
local_stack = ctx.obj.local_stack local_stack = ctx.obj.local_stack
@@ -119,64 +228,15 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches_file):
repos = [] repos = []
for repo in repos_in_scope: for repo in repos_in_scope:
if include_exclude_check(repo, include, exclude): if include_exclude_check(branch_strip(repo), include, exclude):
repos.append(repo) repos.append(repo)
else: else:
if verbose: if verbose:
print(f"Excluding: {repo}") print(f"Excluding: {repo}")
def process_repo(repo):
git_ssh_prefix = "git@github.com:"
git_http_prefix = "https://github.com/"
full_github_repo_path = f"{git_ssh_prefix if git_ssh else git_http_prefix}{repo}"
repoName = repo.split("/")[-1]
full_filesystem_repo_path = os.path.join(dev_root_path, repoName)
is_present = os.path.isdir(full_filesystem_repo_path)
if not quiet:
present_text = f"already exists active branch: {git.Repo(full_filesystem_repo_path).active_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
if is_present:
if not is_git_repo(full_filesystem_repo_path):
print(f"Error: {full_filesystem_repo_path} does not contain a valid git repository")
sys.exit(1)
else:
if pull:
if verbose:
print(f"Running git pull for {full_filesystem_repo_path}")
if not check_only:
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:
# Clone
if verbose:
print(f'Running git clone for {full_github_repo_path} into {full_filesystem_repo_path}')
if not dry_run:
git.Repo.clone_from(full_github_repo_path,
full_filesystem_repo_path,
progress=None if quiet else GitProgress())
else:
print("(git clone skipped)")
# Checkout the requested branch, if one was specified
if branches:
# Find the current repo in the branches list
for repo_branch in branches:
repo_branch_tuple = repo_branch.split(" ")
if repo_branch_tuple[0] == repo:
# checkout specified branch
branch_to_checkout = repo_branch_tuple[1]
if verbose:
print(f"checking out branch {branch_to_checkout} in repo {repo}")
git_repo = git.Repo(full_filesystem_repo_path)
git_repo.git.checkout(branch_to_checkout)
for repo in repos: for repo in repos:
try: try:
process_repo(repo) process_repo(verbose, quiet, dry_run, pull, check_only, git_ssh, dev_root_path, branches_array, repo)
except git.exc.GitCommandError as error: except git.exc.GitCommandError as error:
print(f"\n******* git command returned error exit status:\n{error}") print(f"\n******* git command returned error exit status:\n{error}")
sys.exit(1) sys.exit(1)
+10 -11
View File
@@ -14,6 +14,7 @@
# along with this program. If not, see <http:#www.gnu.org/licenses/>. # along with this program. If not, see <http:#www.gnu.org/licenses/>.
import click import click
from dataclasses import dataclass
from app import setup_repositories from app import setup_repositories
from app import build_containers from app import build_containers
@@ -24,17 +25,15 @@ from app import version
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# TODO: this seems kind of weird and heavy on boilerplate -- check it is @dataclass
# the best Python can do for us. class Options:
class Options(object): stack: str
def __init__(self, stack, quiet, verbose, dry_run, local_stack, debug, continue_on_error): quiet: bool = False
self.stack = stack verbose: bool = False
self.quiet = quiet dry_run: bool = False
self.verbose = verbose local_stack: bool = False
self.dry_run = dry_run debug: bool = False
self.local_stack = local_stack continue_on_error: bool = False
self.debug = debug
self.continue_on_error = continue_on_error
@click.group(context_settings=CONTEXT_SETTINGS) @click.group(context_settings=CONTEXT_SETTINGS)
+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
# Dump environment variables for debugging
echo "Environment variables:"
env
# Test basic stack-orchestrator deploy
echo "Running stack-orchestrator deploy test"
# Bit of a hack, test the most recent package
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
# Set a non-default repo dir
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
echo "Testing this package: $TEST_TARGET_SO"
echo "Test version command"
reported_version_string=$( $TEST_TARGET_SO version )
echo "Version reported is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR
# Test bringing the test container up and down
# with and without volume removal
$TEST_TARGET_SO --stack test setup-repositories
$TEST_TARGET_SO --stack test build-containers
$TEST_TARGET_SO --stack test deploy up
# Test deploy port command
deploy_port_output=$( $TEST_TARGET_SO --stack test deploy port test 80 )
if [[ "$deploy_port_output" =~ ^0.0.0.0:[1-9][0-9]* ]]; then
echo "Deploy port test: passed"
else
echo "Deploy port test: FAILED"
exit 1
fi
$TEST_TARGET_SO --stack test deploy down
# The next time we bring the container up the volume will be old (from the previous run above)
$TEST_TARGET_SO --stack test deploy up
log_output_1=$( $TEST_TARGET_SO --stack test deploy logs )
if [[ "$log_output_1" == *"Filesystem is old"* ]]; then
echo "Retain volumes test: passed"
else
echo "Retain volumes test: FAILED"
exit 1
fi
$TEST_TARGET_SO --stack test deploy down --delete-volumes
# Now when we bring the container up the volume will be new again
$TEST_TARGET_SO --stack test deploy up
log_output_2=$( $TEST_TARGET_SO --stack test deploy logs )
if [[ "$log_output_2" == *"Filesystem is fresh"* ]]; then
echo "Delete volumes test: passed"
else
echo "Delete volumes test: FAILED"
exit 1
fi
$TEST_TARGET_SO --stack test deploy down --delete-volumes
echo "Test passed"
+2 -2
View File
@@ -3,7 +3,7 @@ set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x set -x
fi fi
set -e
echo "Running stack-orchestrator Ethereum fixturenet test" echo "Running stack-orchestrator Ethereum fixturenet test"
# Bit of a hack, test the most recent package # Bit of a hack, test the most recent package
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 ) TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
@@ -15,7 +15,7 @@ reported_version_string=$( $TEST_TARGET_SO version )
echo "Version reported is: ${reported_version_string}" echo "Version reported is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR" echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
$TEST_TARGET_SO --stack fixturenet-eth setup-repositories $TEST_TARGET_SO --stack fixturenet-eth setup-repositories
$TEST_TARGET_SO --stack fixturenet-eth build-containers $TEST_TARGET_SO --stack fixturenet-eth build-containers
$TEST_TARGET_SO --stack fixturenet-eth deploy up $TEST_TARGET_SO --stack fixturenet-eth deploy up
# Verify that the fixturenet is up and running # Verify that the fixturenet is up and running
$TEST_TARGET_SO --stack fixturenet-eth deploy ps $TEST_TARGET_SO --stack fixturenet-eth deploy ps