nimbus-eth2/scripts/geth_binaries.sh
zah 0f758c5f02
Working Makefile targets for Capella devnet2 (#4494)
* Working Makefile targets for Capella devnet2

make capella-devnet-2
make clean-capella-devnet-2

You'll need to have https://github.com/tmuxinator/tmuxinator installed.
It's available as a regular package in most Linux distributions or through
Nix or Brew on macOS.

This commit also fixes the initial hang in the Eth1 monitor in the "find
TTD block" procedure through a fix to the network metadata files which
hasn't been upstreamed yet.

Other changes:

* Disabled Geth snap sync in the simulation

When all Geth nodes are configured to run with snap sync enabled, they all
start snap sync after the first forkchoiceUpdated which causes the BNs to
skip validator duties because the EL is syncing. The snap sync never completes
due to poor connectivity between the Geth nodes in the simulation.
2023-01-13 12:21:58 +02:00

111 lines
3.4 KiB
Bash

if [ -z "${GETH_BINARIES_SOURCED:-}" ]; then
GETH_BINARIES_SOURCED=1
SCRIPTS_DIR="$(dirname "${BASH_SOURCE[0]}")"
BUILD_DIR="$(cd "$SCRIPTS_DIR/../build"; pwd)"
source "${SCRIPTS_DIR}/detect_platform.sh"
source "${SCRIPTS_DIR}/bash_utils.sh"
: ${CURL_BINARY:="curl"}
: ${STABLE_GETH_BINARY:="${BUILD_DIR}/downloads/geth"}
: ${GETH_CAPELLA_BINARY:="${BUILD_DIR}/downloads/geth_capella"}
: ${GETH_EIP_4844_BINARY:="${BUILD_DIR}/downloads/geth_eip4844"}
download_geth_stable() {
if [[ ! -e "${STABLE_GETH_BINARY}" ]]; then
GETH_VERSION="1.10.26-e5eb32ac"
GETH_URL="https://gethstore.blob.core.windows.net/builds/"
case "${OS}-${ARCH}" in
linux-amd64|linux-x86_64)
GETH_TARBALL="geth-linux-amd64-${GETH_VERSION}.tar.gz"
;;
linux-arm64|linux-aarch64)
GETH_TARBALL="geth-linux-arm64-${GETH_VERSION}.tar.gz"
;;
macos-amd64|macos-x86_64)
GETH_TARBALL="geth-darwin-amd64-${GETH_VERSION}.tar.gz"
;;
macos-arm64|macos-aarch64)
# There is no official binary for macOS/ARM at the moment
# The AMD64 binary should work under Rosetta
GETH_TARBALL="geth-darwin-amd64-${GETH_VERSION}.tar.gz"
;;
windows-amd64|windows-x86_64)
GETH_TARBALL="geth-windows-amd64-${GETH_VERSION}.zip"
;;
*)
echo "No Geth binaries available for platform: ${OS}-${ARCH}"
exit 1
;;
esac
log "Downloading Geth binary"
"$CURL_BINARY" -sSLO "$GETH_URL/$GETH_TARBALL"
local tmp_extract_dir
tmp_extract_dir=$(mktemp -d geth-stable-tarball-XXX)
CLEANUP_DIRS+=("$tmp_extract_dir")
tar -xzf "$GETH_TARBALL" -C "$tmp_extract_dir" --strip-components=1
mkdir -p "$(dirname "$STABLE_GETH_BINARY")"
mv "$tmp_extract_dir/geth" "$STABLE_GETH_BINARY"
chmod +x "$STABLE_GETH_BINARY"
fi
}
download_status_geth_binary() {
BINARY_NAME="$1"
BINARY_FS_PATH="$2"
if [[ ! -e "${BINARY_FS_PATH}" ]]; then
case "${OS}-${ARCH}" in
linux-amd64|linux-x86_64)
GETH_PLATFORM=linux-amd64
;;
linux-arm64|linux-aarch64)
GETH_PLATFORM=linux-arm64
;;
macos-amd64|macos-x86_64)
GETH_PLATFORM=macos-amd64
;;
macos-arm64|macos-aarch64)
GETH_PLATFORM=macos-arm64
;;
windows-amd64|windows-x86_64)
GETH_PLATFORM=windows-amd64
;;
*)
echo "No Status Geth binaries available for platform: ${OS}-${ARCH}"
exit 1
;;
esac
log "Downloading Status geth binary ($1)"
GETH_TARBALL_NAME="geth-binaries-${GETH_PLATFORM}.tar.gz"
GETH_TARBALL_URL="https://github.com/status-im/nimbus-simulation-binaries/releases/download/latest/${GETH_TARBALL_NAME}"
GETH_BINARY_IN_TARBALL="geth/${BINARY_NAME}/geth"
"$CURL_BINARY" -o "$GETH_TARBALL_NAME" -sSL "$GETH_TARBALL_URL"
local tmp_extract_dir
tmp_extract_dir=$(mktemp -d geth-status-tarball-XXX)
CLEANUP_DIRS+=("$tmp_extract_dir")
tar -xzf "$GETH_TARBALL_NAME" -C "$tmp_extract_dir" --strip-components 2 \
"$GETH_BINARY_IN_TARBALL"
mkdir -p "$(dirname "$BINARY_FS_PATH")"
mv "$tmp_extract_dir/geth" "$BINARY_FS_PATH"
chmod +x "$BINARY_FS_PATH"
fi
}
download_geth_capella() {
download_status_geth_binary withdrawals-timestamp "$GETH_CAPELLA_BINARY"
}
download_geth_eip_4844() {
download_status_geth_binary eip-4844 "$GETH_EIP_4844_BINARY"
}
fi