Add script for exporting ethdb from fixturenet. #370

Merged
telackey merged 3 commits from telackey/export into main 2023-04-26 05:13:35 +00:00
4 changed files with 64 additions and 3 deletions
Showing only changes of commit f9a2eb2973 - Show all commits

View File

@ -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

View File

@ -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

View File

@ -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
```

View File

@ -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