diff --git a/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh b/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh index 526c76d7..edde1ba2 100755 --- a/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh +++ b/app/data/container-build/cerc-fixturenet-eth-geth/run-el.sh @@ -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 diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh index c6e65a68..f6d9d27b 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh @@ -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 diff --git a/app/data/stacks/fixturenet-eth-tx/README.md b/app/data/stacks/fixturenet-eth-tx/README.md new file mode 100644 index 00000000..838ada53 --- /dev/null +++ b/app/data/stacks/fixturenet-eth-tx/README.md @@ -0,0 +1,20 @@ +# 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 +``` diff --git a/app/data/stacks/fixturenet-eth-tx/stack.yml b/app/data/stacks/fixturenet-eth-tx/stack.yml new file mode 100644 index 00000000..0c3b45a3 --- /dev/null +++ b/app/data/stacks/fixturenet-eth-tx/stack.yml @@ -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