This commit is contained in:
Sebastian
2025-03-19 13:36:37 +01:00
parent 56d8cba406
commit aa5e92a5df
2 changed files with 21 additions and 32 deletions

View File

@@ -1,4 +1,5 @@
services: services:
berachain-bepolia: berachain-bepolia:
image: ghcr.io/paradigmxyz/reth:${RETH_VERSION:-v1.3.2} image: ghcr.io/paradigmxyz/reth:${RETH_VERSION:-v1.3.2}
user: root user: root
@@ -33,39 +34,19 @@ services:
networks: networks:
- chains - chains
# berachain-bepolia-node-prepare:
# image: icculp/berachain_beacon:v1.1.1
# environment:
# - "MONIKER=d${DOMAIN}"
# command: init ${MONIKER} --chain-id bepolia-beacon-80069 --consensus-key-algo bls12_381 --home /root/.beacond/ --overwrite
# volumes:
# - "berachain-bepolia-node:/root/.beacond/data"
# - "./berachain/bepolia/config:/root/.beacond/config"
berachain-bepolia-node-init:
image: alpine:latest
environment:
- "MONIKER=d${DOMAIN}"
volumes:
- "berachain-bepolia-node:/root/.beacond/data"
- "./berachain/bepolia/script/init.sh:/init.sh"
- "./berachain/bepolia/config:/root/.beacond/config"
entrypoint: [ "sh", "/init.sh" ]
command: init ${MONIKER} --chain-id bepolia-beacon-80069 --consensus-key-algo bls12_381 --home /root/.beacond/
berachain-bepolia-node: berachain-bepolia-node:
image: icculp/berachain_beacon:v1.1.1 image: icculp/berachain_beacon:v1.1.1
depends_on:
- "berachain-bepolia-node-init"
expose: expose:
- 26657 #rpc - 26657 #rpc
ports: ports:
- "9692:9692" - "9692:9692"
- "9692:9692/udp" - "9692:9692/udp"
command: start --minimum-gas-prices 0atom --beacon-kit.engine.jwt-secret-path /jwtsecret --beacon-kit.kzg.trusted-setup-path /root/.beacond/config/kzg-trusted-setup.json entrypoint: [ "sh", "/init.sh" ]
command: --beacon-kit.engine.jwt-secret-path /jwtsecret
networks: networks:
- chains - chains
volumes: volumes:
- "./berachain/bepolia/script/init.sh:/init.sh"
- "berachain-bepolia-node:/root/.beacond/data" - "berachain-bepolia-node:/root/.beacond/data"
- "./berachain/bepolia/config:/root/.beacond/config" - "./berachain/bepolia/config:/root/.beacond/config"
- ".jwtsecret:/jwtsecret" - ".jwtsecret:/jwtsecret"

View File

@@ -1,6 +1,11 @@
#!/bin/sh #!/bin/sh
exec apk add --no-cache curl set -e # Exit on failure
apk add --no-cache curl
# this goes first because it won't overwrite shit
/usr/bin/beacond init ${MONIKER} --chain-id bepolia-beacon-80069 --consensus-key-algo bls12_381 --home /root/.beacond/
# Define variables # Define variables
CONFIG_DIR="/root/.beacond/config" CONFIG_DIR="/root/.beacond/config"
@@ -8,15 +13,15 @@ CONFIG_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/tes
APP_TOML_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/80069/app.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" SEEDS_URL="https://raw.githubusercontent.com/berachain/beacon-kit/main/testing/networks/80069/cl-seeds.txt"
# Create config directory if it doesn't exist # Create config directory
mkdir -p "$CONFIG_DIR" mkdir -p "$CONFIG_DIR"
# Download the config files # Download config files
curl -sL "$CONFIG_TOML_URL" -o "$CONFIG_DIR/config.toml" curl -sL "$CONFIG_TOML_URL" -o "$CONFIG_DIR/config.toml"
curl -sL "$APP_TOML_URL" -o "$CONFIG_DIR/app.toml" curl -sL "$APP_TOML_URL" -o "$CONFIG_DIR/app.toml"
# Update moniker # Update moniker if set
if [ -n "$MONIKER" ]; then if [ -n "$MONIKER" ] && [ -f "$CONFIG_DIR/config.toml" ]; then
sed -i "s/^moniker = \".*\"/moniker = \"$MONIKER\"/" "$CONFIG_DIR/config.toml" sed -i "s/^moniker = \".*\"/moniker = \"$MONIKER\"/" "$CONFIG_DIR/config.toml"
fi fi
@@ -24,12 +29,15 @@ fi
SEEDS=$(curl -s "$SEEDS_URL" | tail -n +2 | tr '\n' ',' | sed 's/,$//') SEEDS=$(curl -s "$SEEDS_URL" | tail -n +2 | tr '\n' ',' | sed 's/,$//')
# Update seeds and persistent_peers # Update seeds and persistent_peers
if [ -n "$SEEDS" ]; then if [ -n "$SEEDS" ] && [ -f "$CONFIG_DIR/config.toml" ]; then
sed -i "s/^seeds = \".*\"/seeds = \"$SEEDS\"/" "$CONFIG_DIR/config.toml" sed -i "s/^seeds = \".*\"/seeds = \"$SEEDS\"/" "$CONFIG_DIR/config.toml"
sed -i "s/^persistent_peers = \".*\"/persistent_peers = \"$SEEDS\"/" "$CONFIG_DIR/config.toml" sed -i "s/^persistent_peers = \".*\"/persistent_peers = \"$SEEDS\"/" "$CONFIG_DIR/config.toml"
fi fi
sed -i "s|^rpc-dial-url = \".*\"|rpc-dial-url = \"http://berachain-bepolia:8551\"|" "$CONFIG_DIR/app.toml"; # Update RPC dial URL in app.toml
if [ -f "$CONFIG_DIR/app.toml" ]; then
exec /usr/bin/beacond "$@" sed -i "s|^rpc-dial-url = \".*\"|rpc-dial-url = \"http://berachain-bepolia:8551\"|" "$CONFIG_DIR/app.toml"
fi
# Execute beacond
exec /usr/bin/beacond start --beacon-kit.kzg.trusted-setup-path /root/.beacond/config/kzg-trusted-setup.json --minimum-gas-prices 0atom "$@"