#!/bin/bash # Start an isolated single-node fork chain with the AERE future-EIP precompiles # (0x0AE1-0x0AE7) active from genesis. Ethash + instant low-difficulty mining. set -uo pipefail # Paths are parameterized so this script runs as-is in a clean checkout. Override # any of them in the environment. Previously these were hardcoded to a build # operator's home directory, which both disclosed an internal layout and made the # script unrunnable for anyone else without editing it. # AERE_BESU_BIN path to the built besu launcher # AERE_WORK_DIR scratch directory for node data and logs (WILL BE DELETED) # AERE_STAGING directory holding bench/genesis.json and the KAT vectors BESU="${AERE_BESU_BIN:-${HOME}/besu/build/install/besu/bin/besu}" WORK_DIR="${AERE_WORK_DIR:-/tmp/aere-bench}" STAGING="${AERE_STAGING:-$(cd "$(dirname "$0")/.." && pwd)}" NODE_DIR="${WORK_DIR}/node" NODE_LOG="${WORK_DIR}/node.log" mkdir -p "${WORK_DIR}" rm -rf "${NODE_DIR}" nohup "$BESU" \ --data-path="${NODE_DIR}" \ --genesis-file="${STAGING}/bench/genesis.json" \ --network-id=28777 \ --miner-enabled --miner-coinbase=0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf \ --min-gas-price=0 \ --rpc-http-enabled --rpc-http-host=127.0.0.1 --rpc-http-port=8545 \ --rpc-http-api=ETH,NET,WEB3,DEBUG,TXPOOL \ --host-allowlist='*' \ > "${NODE_LOG}" 2>&1 & echo "besu pid $!" echo "waiting for RPC..." for i in $(seq 1 60); do bn=$(curl -s -X POST http://127.0.0.1:8545 -H 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 2>/dev/null | grep -o '"result":"[^"]*"') if [ -n "$bn" ]; then echo "RPC up: $bn"; break; fi sleep 2 done tail -5 "${NODE_LOG}"