Skip to content

Commit

Permalink
rebase for start-e2e-import-mainnet-test
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Jun 21, 2024
1 parent 4213185 commit d9b2f23
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 37 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export DOCKER_BUILDKIT := 1
export LOCALNET_MODE
export E2E_ARGS := $(E2E_ARGS)
export UPGRADE_HEIGHT
export ZETACORED_IMPORT_GENESIS_DATA
export ZETACORED_START_PERIOD := 30s

clean: clean-binaries clean-dir clean-test-dir clean-coverage
Expand Down Expand Up @@ -266,12 +267,13 @@ start-localnet-skip-build:
export LOCALNET_MODE=setup-only && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d

stop-localnet:
start-e2e-import-mainnet-test: zetanode
@echo "--> Starting e2e import-data test"
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml -f docker-compose-import-data.yml up -d
export ZETACORED_IMPORT_GENESIS_DATA=true && \
export ZETACORED_START_PERIOD=10m && \
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml up -d

stop-test:
stop-localnet:
cd contrib/localnet/ && $(DOCKER) compose down --remove-orphans

###############################################################################
Expand Down
30 changes: 0 additions & 30 deletions contrib/localnet/docker-compose-import-data.yml

This file was deleted.

2 changes: 2 additions & 0 deletions contrib/localnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ services:
- HOTKEY_BACKEND=file
- HOTKEY_PASSWORD=password # test purposes only
- ZETACORED_REPLICAS=2
- ZETACORED_IMPORT_GENESIS_DATA=${ZETACORED_IMPORT_GENESIS_DATA}
volumes:
- ssh:/root/.ssh
- ~/.zetacored/genesis_data:/root/genesis_data

zetacore1:
image: zetanode:latest
Expand Down
6 changes: 3 additions & 3 deletions contrib/localnet/scripts/import-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ fi

NETWORK=$1
echo "NETWORK: ${NETWORK}"
rm -rf ~/genesis_export/
mkdir ~/genesis_export/
rm -rf ~/.zetacored/genesis_data
mkdir ~/.zetacored/genesis_data
echo "Download Latest State Export"
LATEST_EXPORT_URL=$(curl https://snapshots.zetachain.com/latest-state-export | jq -r ."${NETWORK}")
echo "LATEST EXPORT URL: ${LATEST_EXPORT_URL}"
wget -q ${LATEST_EXPORT_URL} -O ~/genesis_export/exported-genesis.json
wget -q ${LATEST_EXPORT_URL} -O ~/.zetacored/genesis_data/exported-genesis.json
2 changes: 1 addition & 1 deletion contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ then
scp $NODE:~/.zetacored/config/gentx/* ~/.zetacored/config/gentx/z2gentx/
done

if [[ "$OPTION" == "import-data" || "$OPTION" == "import-data-upgrade" ]]; then
if [[ -n "$ZETACORED_IMPORT_GENESIS_DATA" ]]; then
echo "Importing data"
zetacored parse-genesis-file /root/genesis_data/exported-genesis.json
fi
Expand Down

0 comments on commit d9b2f23

Please sign in to comment.