From acac485ecbdb2a54091915c2e4f8e0b632acc3f9 Mon Sep 17 00:00:00 2001 From: Ayaan Date: Wed, 16 Oct 2024 17:07:29 +0900 Subject: [PATCH] feat: setup RIP-7560 devnet environment --- .gitignore | 2 ++ circleciconfig.toml | 2 +- config/test-jwt-secret.txt | 1 + prepare-dev.sh | 11 +++++++++ prepare.sh | 49 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 config/test-jwt-secret.txt create mode 100755 prepare-dev.sh create mode 100755 prepare.sh diff --git a/.gitignore b/.gitignore index 0e22b69849..956772e61e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ tests/spec-tests/ /alexfdata/prysmctl /alexfdata/validator /alexfdata/genesis.ssz + +/db diff --git a/circleciconfig.toml b/circleciconfig.toml index edc119fa42..5fe40629c8 100644 --- a/circleciconfig.toml +++ b/circleciconfig.toml @@ -1,5 +1,5 @@ [Eth] Rip7560MaxBundleSize = 0 Rip7560MaxBundleGas = 0 -Rip7560PullUrls = ["http://localhost:3001/rpc"] +Rip7560PullUrls = ["http://localhost:7560/rpc"] Rip7560AcceptPush = false diff --git a/config/test-jwt-secret.txt b/config/test-jwt-secret.txt new file mode 100644 index 0000000000..6e72091cdd --- /dev/null +++ b/config/test-jwt-secret.txt @@ -0,0 +1 @@ +688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a diff --git a/prepare-dev.sh b/prepare-dev.sh new file mode 100755 index 0000000000..c78a8743bf --- /dev/null +++ b/prepare-dev.sh @@ -0,0 +1,11 @@ +VERBOSITY=${GETH_VERBOSITY:-3} + +echo " +--dev +--dev.gaslimit=30000000 +--http +--http.api=eth,net,web3,personal,debug +--http.port=8545 +--rpc.allow-unprotected-txs +--config=circleciconfig.toml +" | pbcopy diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000000..7d000637b9 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,49 @@ +VERBOSITY=${GETH_VERBOSITY:-3} +GETH_DATA_DIR=./db +GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" +GENESIS_FILE_PATH="${GENESIS_FILE_PATH:-../.devnet/genesis-l2.json}" +CHAIN_ID=$(cat "$GENESIS_FILE_PATH" | jq -r .config.chainId) +RPC_PORT="${RPC_PORT:-38545}" +WS_PORT="${WS_PORT:-38546}" + +if [ ! -d "$GETH_CHAINDATA_DIR" ]; then + echo "$GETH_CHAINDATA_DIR missing, running init" + echo "Initializing genesis." + ./build/bin/geth --verbosity="$VERBOSITY" init \ + --state.scheme=hash \ + --datadir="$GETH_DATA_DIR" \ + "$GENESIS_FILE_PATH" +else + echo "$GETH_CHAINDATA_DIR exists." +fi + +echo " +--datadir=$GETH_DATA_DIR +--verbosity=$VERBOSITY +--http +--http.corsdomain=* +--http.vhosts=* +--http.addr=0.0.0.0 +--http.port=$RPC_PORT +--http.api=web3,debug,eth,txpool,net,engine +--ws +--ws.addr=0.0.0.0 +--ws.port=$WS_PORT +--ws.origins=* +--ws.api=debug,eth,txpool,net,engine +--syncmode=full +--nodiscover +--maxpeers=0 +--networkid=$CHAIN_ID +--rpc.allow-unprotected-txs +--authrpc.addr=0.0.0.0 +--authrpc.port=38551 +--authrpc.vhosts=* +--authrpc.jwtsecret=./config/test-jwt-secret.txt +--gcmode=archive +--metrics +--metrics.addr=0.0.0.0 +--metrics.port=36060 +--miner.recommit=1s +--config=circleciconfig.toml +" | pbcopy