This commit is contained in:
Sebastian
2024-11-23 08:53:42 +01:00
parent 4ae5c77f2d
commit 2c2a09878c
3 changed files with 41 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ services:
goat-testnet:
image: ghcr.io/goatnetwork/goat-geth:v0.1.0
image: ghcr.io/goatnetwork/goat-geth:v0.1.1
stop_grace_period: 5m
restart: unless-stopped
healthcheck:
@@ -26,7 +26,7 @@ services:
- "GETH_WS_PORT=8545"
- "GETH_NAT=extip:${IP}"
- "GETH_SYNCMODE=full"
- "GETH_BOOTNODES=enode://0d41d098846751f0f90ea66e4d7e6741591e9c4bfb6e75d14f78ca3702415fb795adad64b2805f428c86f6ae2ee5315322301e02c63c917f92756a909679599e@52.12.249.134:30303"
# - "GETH_BOOTNODES=enode://0d41d098846751f0f90ea66e4d7e6741591e9c4bfb6e75d14f78ca3702415fb795adad64b2805f428c86f6ae2ee5315322301e02c63c917f92756a909679599e@52.12.249.134:30303"
entrypoint: /entrypoint.sh
expose:
- 8545
@@ -36,8 +36,8 @@ services:
- "18141:18141/udp"
volumes:
- "goat-testnet:/root/.ethereum"
- ./goat/testnet:/genesis
- ./goat/geth-entrypoint.sh:/entrypoint.sh
# - ./goat/testnet:/genesis
- ./goat/testnet3/geth-entrypoint.sh:/entrypoint.sh
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.goat-testnet-stripprefix.stripprefix.prefixes=/goat-testnet"
@@ -50,7 +50,7 @@ services:
- chains
goat-testnet-node:
image: ghcr.io/goatnetwork/goat:v0.1.0
image: ghcr.io/goatnetwork/goat:v0.1.1
stop_grace_period: 30s
restart: unless-stopped
entrypoint: /entrypoint.sh
@@ -59,8 +59,8 @@ services:
volumes:
- "goat-testnet-node:/goat"
- "goat-testnet:/geth"
- ./goat/testnet:/genesis
- ./goat/node-entrypoint.sh:/entrypoint.sh
# - ./goat/testnet:/genesis
- ./goat/testnet3/node-entrypoint.sh:/entrypoint.sh
depends_on:
- goat-testnet
networks:

View File

@@ -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=testnet3

View File

@@ -0,0 +1,26 @@
#!/bin/sh
if [ ! -d "/root/.ethereum/geth/chaindata" ]; then
geth init /genesis/geth.json
else
echo "Chain already initialized."
fi
geth
root@rpc-jp-1:~/rpc# cat goat/node-entrypoint.sh
#!/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 testnet
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-testnet3 --goat.geth /geth/geth.ipc --api.enable --api.address=tcp://0.0.0.0:1317 --p2p.persistent_peers c9befb6b8421b46ec5cda76171a8cf7539af20fc@52.12.249.134:26656 --p2p.external-address $IP:40258 --p2p.laddr 0.0.0.0:40258