diff --git a/.github/workflows/build_local_tesnet.yml b/.github/workflows/build_local_tesnet.yml index 12acd984a2f..19bc444c2a3 100644 --- a/.github/workflows/build_local_tesnet.yml +++ b/.github/workflows/build_local_tesnet.yml @@ -29,17 +29,22 @@ jobs: with: repository: multiversx/mx-chain-deploy-go path: mx-chain-deploy-go - run: | - mv ${GITHUB_WORKSPACE}/mx-chain-deploy-go .. - cd .. - ls -la -# - name: Generate config -# id: generate-config -# run: | -# cd ${GITHUB_WORKSPACE}/scripts/docker-testnet -# export TESTNETDIR=${GITHUB_WORKSPACE}/docker-testnet -# ./prepare.sh + - name: Build node and seednode images + run: | + docker build -f docker/node/Dockerfile . -t node:dev + docker build -f docker/seednode/Dockerfile . -t node:dev + + - name: Start localnet + id: generate-config + run: | + cd ${GITHUB_WORKSPACE}/scripts/docker-testnet + export TESTNETDIR=${GITHUB_WORKSPACE}/docker-testnet + export CI_RUN=1 + ./start.sh + echo "Check everything is alright. Remove once confirmed" + docker ps + curl http://localhost:7950 # # - name: Deploy local testnet # run: | diff --git a/scripts/docker-testnet/clean.sh b/scripts/docker-testnet/clean.sh index aa5cbda7e72..a872ed57f13 100755 --- a/scripts/docker-testnet/clean.sh +++ b/scripts/docker-testnet/clean.sh @@ -6,11 +6,11 @@ export MULTIVERSXTESTNETSCRIPTSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/d source "$MULTIVERSXTESTNETSCRIPTSDIR/variables.sh" -echo "Stopping all containers" +echo "Stopping all containers..." docker stop $(docker ps -a -q) -echo "Removing all containers" -docker container prune +echo "Removing all containers..." +docker container prune -f echo "Removing $TESTNETDIR..." rm -rf $TESTNETDIR diff --git a/scripts/docker-testnet/variables.sh b/scripts/docker-testnet/variables.sh index 09f5d3eca43..b539d346234 100644 --- a/scripts/docker-testnet/variables.sh +++ b/scripts/docker-testnet/variables.sh @@ -19,8 +19,15 @@ export USE_TXGEN=0 # anyway. export TESTNETDIR="$HOME/MultiversX/testnet" + # Path to mx-chain-deploy-go, branch: master. Default: near mx-chain-go. -export CONFIGGENERATORDIR="$(dirname $MULTIVERSXDIR)/mx-chain-deploy-go/cmd/filegen" + +if [[ -n $CI_RUN ]]; then + export CONFIGGENERATORDIR="$(dirname $MULTIVERSXDIR)/mx-chain-go/mx-chain-deploy-go/cmd/filegen" +else + export CONFIGGENERATORDIR="$(dirname $MULTIVERSXDIR)/mx-chain-deploy-go/cmd/filegen" +fi + export CONFIGGENERATOR="$CONFIGGENERATORDIR/filegen" # Leave unchanged. export CONFIGGENERATOROUTPUTDIR="output" @@ -54,7 +61,7 @@ export OBSERVERS_ANTIFLOOD_DISABLE=0 # Shard structure export SHARDCOUNT=2 export SHARD_VALIDATORCOUNT=3 -export SHARD_OBSERVERCOUNT=0 +export SHARD_OBSERVERCOUNT=1 export SHARD_CONSENSUS_SIZE=3 # Metashard structure