-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: added local development testing node sync docker compose (#2070)
* ci: re-organizaed the folder structure for docker compose, made the docker commposes dynamic, added new make commands for building working branches to test non-governance upgrades against a full node fully synced against testnet or mainnet. Updated readme as well.
- Loading branch information
Showing
17 changed files
with
372 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Use the official Go Ethereum image | ||
FROM ethereum/client-go:latest | ||
|
||
# Expose the ports (8545 for JSON-RPC, 8546 for WebSocket, 30303 for P2P) | ||
EXPOSE 8545 8546 30303 | ||
|
||
# Set the entrypoint to start Geth | ||
ENTRYPOINT ["geth"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: '3.8' | ||
services: | ||
lighthouse: | ||
image: sigp/lighthouse:latest | ||
command: lighthouse --network mainnet beacon --http --checkpoint-sync-url https://sync.invis.tools | ||
ports: | ||
- "5052:5052" | ||
volumes: | ||
- type: volume | ||
source: lighthouse_data | ||
target: /root/.lighthouse | ||
geth: | ||
build: . | ||
ports: | ||
- "18545:18545" # JSON-RPC | ||
- "18546:18546" # WebSocket | ||
- "30303:30303" # P2P Network | ||
volumes: | ||
- type: volume | ||
source: ethereum_data | ||
target: /root/.ethereum | ||
command: | ||
- "--http" | ||
- "--http.addr" | ||
- "0.0.0.0" | ||
- "--http.vhosts=*" | ||
- "--http.api=admin,eth,debug,miner,net,txpool,personal,web3" | ||
- "--ws" | ||
- "--ws.addr" | ||
- "0.0.0.0" | ||
- "--ws.api=admin,eth,debug,miner,net,txpool,personal,web3" | ||
- "--ws.origins=*" | ||
- "--maxpeers=50" | ||
- "--syncmode=snap" | ||
|
||
volumes: | ||
ethereum_data: | ||
lighthouse_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.8' | ||
services: | ||
-=name=-: | ||
platform: linux/amd64 | ||
-=image_block=- | ||
container_name: "zetachain_${NETWORK:-mainnet}_rpc" | ||
environment: | ||
DAEMON_HOME: "${DAEMON_HOME:-/root/.zetacored}" | ||
NETWORK: ${NETWORK:-mainnet} | ||
RESTORE_TYPE: "${RESTORE_TYPE:-snapshot}" | ||
SNAPSHOT_API: ${SNAPSHOT_API:-https://snapshots.zetachain.com} | ||
TRUST_HEIGHT_DIFFERENCE_STATE_SYNC: ${TRUST_HEIGHT_DIFFERENCE_STATE_SYNC:-40000} | ||
CHAIN_ID: "${CHAIN_ID:-zetachain_7000-1}" | ||
VISOR_NAME: "${VISOR_NAME:-cosmovisor}" | ||
DAEMON_NAME: "${DAEMON_NAME:-zetacored}" | ||
DAEMON_ALLOW_DOWNLOAD_BINARIES: "${DAEMON_ALLOW_DOWNLOAD_BINARIES:-false}" | ||
DAEMON_RESTART_AFTER_UPGRADE: "${DAEMON_RESTART_AFTER_UPGRADE:-true}" | ||
UNSAFE_SKIP_BACKUP: "${UNSAFE_SKIP_BACKUP:-true}" | ||
MONIKER: ${MONIKER:-mainnet-docker-rpc} | ||
#If this is true it will erase everything and start over from scratch. | ||
RE_DO_START_SEQUENCE: "${RE_DO_START_SEQUENCE:-false}" | ||
#If this is true it will build the dockerfile and use binary from built docker file instead of remote docker image for local development testing on non-governance upgrades. | ||
IS_LOCAL_DEVELOPMENT: "${IS_LOCAL_DEVELOPMENT:-false}" | ||
ports: | ||
- "26656:26656" | ||
- "1317:1317" | ||
- "8545:8545" | ||
- "8546:8546" | ||
- "26657:26657" | ||
- "9090:9090" | ||
- "9091:9091" | ||
volumes: | ||
- -=name=-:/root/.zetacored/ | ||
entrypoint: bash /scripts/start.sh | ||
volumes: | ||
-=name=-: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
NETWORK=${1} | ||
TYPE=${2} | ||
DOCKER_TAG=${3} | ||
|
||
if [ "$TYPE" == "image" ]; then | ||
echo "Source Environment File." | ||
SOURCE_FILE_NAME="networks/.${NETWORK}" | ||
if [ ! -f "$SOURCE_FILE_NAME" ]; then | ||
echo "Environment file $SOURCE_FILE_NAME does not exist." | ||
exit 1 | ||
fi | ||
source ${SOURCE_FILE_NAME} | ||
elif [ "$TYPE" == "localbuild" ]; then | ||
echo "Source Environment File." | ||
SOURCE_FILE_NAME="networks/.${NETWORK}-localbuild" | ||
if [ ! -f "$SOURCE_FILE_NAME" ]; then | ||
echo "Environment file $SOURCE_FILE_NAME does not exist." | ||
exit 1 | ||
fi | ||
source ${SOURCE_FILE_NAME} | ||
fi | ||
|
||
# Define the path to the Docker Compose file | ||
FILE_PATH="${NETWORK}-docker-compose.yml" | ||
cp docker-compose.yml ${FILE_PATH} | ||
|
||
# Determine the appropriate Docker Compose configuration based on TYPE | ||
if [ "$TYPE" == "image" ]; then | ||
IMAGE_BLOCK="image: zetachain/zetacored:\${DOCKER_TAG:-ubuntu-v14.0.1.0}" | ||
NAME="zetacored-rpc-${NETWORK}" | ||
elif [ "$TYPE" == "localbuild" ]; then | ||
IMAGE_BLOCK=$(cat << 'EOF' | ||
build: | ||
context: ../../.. | ||
dockerfile: Dockerfile | ||
EOF | ||
) | ||
NAME="zetacored-rpc-${NETWORK}-localbuild" | ||
else | ||
echo "Invalid TYPE. Please specify 'image' or 'localbuild'." | ||
exit 1 | ||
fi | ||
|
||
IMAGE_BLOCK_ESCAPED=$(echo "$IMAGE_BLOCK" | sed 's/[&/]/\\&/g; s/$/\\/') | ||
IMAGE_BLOCK_ESCAPED=${IMAGE_BLOCK_ESCAPED%?} | ||
|
||
# Replace placeholders in the Docker Compose file | ||
sed -i '' "s|-=name=-|$NAME|g" $FILE_PATH | ||
sed -i '' "s|-=image_block=-|$IMAGE_BLOCK_ESCAPED|g" $FILE_PATH | ||
|
||
echo "DEBUG ENV VARS" | ||
printenv | ||
echo "================" | ||
|
||
echo "Placeholders have been replaced in $FILE_PATH." | ||
cat $FILE_PATH | ||
echo "================" | ||
|
||
if [ "$TYPE" == "image" ]; then | ||
docker-compose -f ${FILE_PATH} up | ||
elif [ "$TYPE" == "localbuild" ]; then | ||
docker-compose -f ${FILE_PATH} up --build | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
NETWORK=${1} | ||
CLEAN=${2} | ||
FILE_PATH="${NETWORK}-docker-compose.yml" | ||
|
||
if [ "${CLEAN}" == "true" ]; then | ||
docker-compose -f ${FILE_PATH} down -v | ||
rm -rf ${FILE_PATH} | ||
else | ||
docker-compose -f ${FILE_PATH} down | ||
rm -rf ${FILE_PATH} | ||
fi | ||
|
Oops, something went wrong.