do the thing

This commit is contained in:
Sebastian
2025-03-20 08:56:40 +01:00
parent fbd00a2314
commit 3b4f46da64
4 changed files with 74 additions and 1512105 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

50
berachain/bepolia/script/init.sh Normal file → Executable file
View File

@@ -4,20 +4,36 @@ set -e # Exit on failure
echo "MONIKER: $MONIKER"
CHAIN_SPEC=${CHAIN_SPEC:-testnet}
BEACOND=${BEACOND_PATH:-beacond}
CONFIG_DIR="/root/.beacond/config"
# Create config directory
mkdir -p "$CONFIG_DIR"
JWTSECRET="0x$(cat /jwtsecret)" # reth and bepolia don't speak the same language
CHAINID=80069
P2P_STRING="tcp:\\/\\/0\\.0\\.0\\.0\\:${P2P_PORT:-55696}"
echo "$JWTSECRET" > "$CONFIG_DIR/jwt.hex"
# this goes first because it won't overwrite shit
if /usr/bin/beacond init ${MONIKER} --chain-id bepolia-beacon-80069 --consensus-key-algo bls12_381 --home /root/.beacond/; then
apt-get update && apt-get install -y curl
#if $BEACOND init ${MONIKER} --chain-id bepolia-beacon-80069 --consensus-key-algo bls12_381 --home /root/.beacond/; then
if $BEACOND init ${MONIKER} --chain-id bepolia-beacon-80069 --home /root/.beacond/; then
apk add curl
# Define variables
CONFIG_DIR="/root/.beacond/config"
CONFIG_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/80069/config.toml"
APP_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/80069/app.toml"
SEEDS_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/80069/cl-seeds.txt"
# Create config directory
mkdir -p "$CONFIG_DIR"
CONFIG_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/config.toml"
APP_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/app.toml"
SEEDS_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/cl-seeds.txt"
KZG_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/kzg-trusted-setup.json"
ETH_GENESIS_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/eth-genesis.json"
GENESIS_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/$CHAINID/genesis.json"
# Download config files
curl -sL "$GENESIS_URL" -o "$CONFIG_DIR/genesis.json"
curl -sL "$ETH_GENESIS_URL" -o "$CONFIG_DIR/eth-genesis.json"
curl -sL "$KZG_URL" -o "$CONFIG_DIR/kzg-trusted-setup.json"
curl -sL "$CONFIG_TOML_URL" -o "$CONFIG_DIR/config.toml"
curl -sL "$APP_TOML_URL" -o "$CONFIG_DIR/app.toml"
@@ -43,5 +59,19 @@ else
echo "Already initialized, continuing!" >&2
fi
# apply a port change to the config
sed -i "/^\[p2p\]/,/^\[/{s|^laddr = .*|laddr = \"$P2P_STRING\"|}" "$CONFIG_DIR/config.toml"
#sed -i "s/^laddr = \".*\"/laddr = \"$P2P_STRING\"/" "$CONFIG_DIR/config.toml"
sed -i 's|~/|/root/|g' "$CONFIG_DIR/config.toml"
sed -i 's|~/|/root/|g' "$CONFIG_DIR/app.toml"
echo "$CONFIG_DIR/jwt.hex: $(cat $CONFIG_DIR/jwt.hex)"
#cd "$CONFIG_DIR"
# Execute beacond
exec /usr/bin/beacond start --beacon-kit.kzg.trusted-setup-path /root/.beacond/config/kzg-trusted-setup.json --minimum-gas-prices 0atom "$@"
#exec $BEACOND start --beacon-kit.kzg.trusted-setup-path /root/.beacond/config/kzg-trusted-setup.json --minimum-gas-prices 0atom "$@"
exec $BEACOND start --home /root/.beacond $@
# --beacon-kit.engine.jwt-secret-path $CONFIG_DIR/jwt.hex --beacon-kit.kzg.trusted-setup-path $CONFIG_DIR/kzg-trusted-setup.json --home /root/.beacond
#--minimum-gas-prices 0atom