From 3ad79dced3efd8bf428c88db6108ec45a874e4cb Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Sun, 22 Dec 2024 08:26:05 +0100 Subject: [PATCH] executable --- goat/mainnet/geth-entrypoint.sh | 8 ++++++++ goat/mainnet/node-entrypoint.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 goat/mainnet/geth-entrypoint.sh create mode 100755 goat/mainnet/node-entrypoint.sh diff --git a/goat/mainnet/geth-entrypoint.sh b/goat/mainnet/geth-entrypoint.sh new file mode 100755 index 00000000..4dd4b80c --- /dev/null +++ b/goat/mainnet/geth-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +if [ ! -d "/root/.ethereum/geth/chaindata" ]; then + geth init /genesis/geth.json +else + echo "Chain already initialized." +fi + +geth --goat=mainnet diff --git a/goat/mainnet/node-entrypoint.sh b/goat/mainnet/node-entrypoint.sh new file mode 100755 index 00000000..6241a0a3 --- /dev/null +++ b/goat/mainnet/node-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Custom initialization steps go here +echo "Starting initialization steps..." + +# Check if the genesis.json file exists; if not, initialize and copy it +if [ ! -f /goat/config/genesis.json ]; then + echo "Initializing goatd..." + goatd init --home /goat mainnet + echo "Copying genesis file..." + cp /genesis/goat.json /goat/config/genesis.json +else + echo "Genesis file already exists; skipping initialization." +fi + +# Pass control to the final command specified in docker-compose.yml +goatd start --home /goat --chain-id=goat-mainnet --goat.geth /geth/geth.ipc --api.enable --api.address=tcp://0.0.0.0:1317 --p2p.external-address $IP:40258 --p2p.laddr 0.0.0.0:40258