From c8c94607cc789a8ee1d8b3f16f2e710cec5e7106 Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Fri, 31 May 2024 15:09:18 +0800 Subject: [PATCH] chore: add cosmosvisor dockerfile (#541) --- .dockerignore | 4 +- .github/workflows/docker.yml | 102 ++++++++++++++++++++++++++++-- Makefile | 4 +- contrib/upgrade/run-cosmovisor.sh | 74 ---------------------- contrib/upgrade/run-upgrade.sh | 61 ------------------ contrib/upgrade/run.sh | 15 ----- cosmovisor.Dockerfile | 64 +++++++++++++++++++ cosmovisor_lite.Dockerfile | 48 ++++++++++++++ tests/scripts/cosmovisor.sh | 70 ++++++++++++++++++++ tests/scripts/setup-env.sh | 3 +- 10 files changed, 284 insertions(+), 161 deletions(-) delete mode 100755 contrib/upgrade/run-cosmovisor.sh delete mode 100755 contrib/upgrade/run-upgrade.sh delete mode 100755 contrib/upgrade/run.sh create mode 100644 cosmovisor.Dockerfile create mode 100644 cosmovisor_lite.Dockerfile create mode 100755 tests/scripts/cosmovisor.sh diff --git a/.dockerignore b/.dockerignore index d30763d3a..880384ebc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,6 @@ build dist node_modules proto -artifacts \ No newline at end of file +artifacts +Dockerfile +*.Dockerfile \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bf02501d1..bd511c586 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,15 +7,17 @@ on: pull_request: paths: - 'Dockerfile' + - 'cosmovisor.Dockerfile' + - 'cosmovisor_lite.Dockerfile' - '.github/workflows/docker.yml' +permissions: + packages: write + contents: read + jobs: - build_and_push: - name: Push Docker image to multiple registries + fxcore: runs-on: ubuntu-latest - permissions: - packages: write - contents: read steps: - name: Check out the repo uses: actions/checkout@v4 @@ -55,4 +57,92 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} platforms: linux/amd64, linux/arm64 - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + + cosmovisor_lite: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/fxcorevisor_lite + ${{ secrets.DOCKER_HUB_USERNAME }}/fxcorevisor_lite + tags: | + type=semver,pattern={{version}} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Login to Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ./cosmovisor_lite.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64, linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + + cosmovisor: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/fxcorevisor + ${{ secrets.DOCKER_HUB_USERNAME }}/fxcorevisor + tags: | + type=semver,pattern={{version}} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Login to Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + file: ./cosmovisor.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64, linux/arm64 + tags: ${{ steps.meta.outputs.tags }} diff --git a/Makefile b/Makefile index 0d9f5c610..9aa94b4a9 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ #!/usr/bin/make -f -GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown') -GIT_TAGS := $(shell git describe --tags --always 2>/dev/null || echo 'unknown') -VERSION := $(GIT_BRANCH)-$(GIT_TAGS) +VERSION := $(shell git describe --tags --always 2>/dev/null || echo 'unknown') COMMIT := $(shell git log -1 --format='%H' 2>/dev/null || echo 'unknown') LEDGER_ENABLED ?= true diff --git a/contrib/upgrade/run-cosmovisor.sh b/contrib/upgrade/run-cosmovisor.sh deleted file mode 100755 index d2705bdbc..000000000 --- a/contrib/upgrade/run-cosmovisor.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -readonly init=${1:-"no"} -export CURRENT_VERSION=${2:-"$CURRENT_VERSION"} -[[ -z "$CURRENT_VERSION" ]] && echo "CURRENT_VERSION is required" && exit 1 -export UPGRADE_NAME=${3:-"$UPGRADE_NAME"} - -export CHAIN_ID=${CHAIN_ID:-"fxcore"} -export NODE_HOME=${NODE_HOME:-"$HOME/.fxcore"} -export BINARY=${BINARY:-"$NODE_HOME/cosmovisor/genesis/bin/fxcored"} - -function build_binary() { - local version=${1:-""} - echo "build binary for version $version" - [[ ! -d "/tmp/$CHAIN_ID-cache" ]] && mkdir -p "/tmp/$CHAIN_ID-cache" - ( - cd "/tmp/$CHAIN_ID-cache" || exit 1 - if [[ ! -d "fx-core/.git" ]]; then - git clone https://github.com/functionx/fx-core.git - fi - cd fx-core || exit 1 - git fetch --all - git checkout "release/$version" - make build - mkdir -p "$NODE_HOME/cosmovisor/upgrades/${version}/bin" - cp "./build/bin/fxcored" "$NODE_HOME/cosmovisor/upgrades/${version}/bin/fxcored" - ) -} - -if [ -n "$UPGRADE_NAME" ]; then - build_binary "$UPGRADE_NAME" -fi - -build_binary "$CURRENT_VERSION" -mkdir -p "$(dirname "$BINARY")" -[[ -f "$BINARY" ]] && rm "$BINARY" -ln -s "$NODE_HOME/cosmovisor/upgrades/${CURRENT_VERSION}/bin/fxcored" "$BINARY" - -if [ "$init" == "init" ]; then - [[ -d "$NODE_HOME/data" ]] && rm -r "$NODE_HOME/data" - [[ -d "$NODE_HOME/config" ]] && rm -r "$NODE_HOME/config" - [[ -d "$NODE_HOME/keyring-test" ]] && rm -r "$NODE_HOME/keyring-test" - - $BINARY init upgrader --chain-id "$CHAIN_ID" --home "$NODE_HOME" - $BINARY config chain-id "$CHAIN_ID" --home "$NODE_HOME" - $BINARY config keyring-backend test --home "$NODE_HOME" - - readonly genesis_tmp="$NODE_HOME"/config/genesis.json.tmp - # update genesis total supply - jq '.app_state.bank.supply[0].amount = "388604525462891000000000000"' "$NODE_HOME"/config/genesis.json >"$genesis_tmp" && - mv "$genesis_tmp" "$NODE_HOME"/config/genesis.json - # update gov voting period - jq '.app_state.gov.voting_params.voting_period = "15s"' "$NODE_HOME"/config/genesis.json >"$genesis_tmp" && - mv "$genesis_tmp" "$NODE_HOME"/config/genesis.json - - echo "test test test test test test test test test test test junk" | $BINARY keys add fx1 --recover --home "$NODE_HOME" - $BINARY add-genesis-account fx1 10004000000000000000000000FX --home "$NODE_HOME" - - $BINARY gentx fx1 100000000000000000000FX --chain-id "$CHAIN_ID" --home "$NODE_HOME" - $BINARY collect-gentxs --home "$NODE_HOME" -fi - -echo "start fxcore ..." -if docker stats --no-stream; then - docker run -d --name fxcore \ - -p 0.0.0.0:26656:26656 -p 127.0.0.1:26657:26657 -p 127.0.0.1:1317:1317 -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 \ - -v "$NODE_HOME":/root/.fxcore ghcr.io/functionx/fxcorevisor:latest run start --x-crisis-skip-assert-invariants -else - export DAEMON_NAME=fxcored - export DAEMON_HOME="$NODE_HOME" - cosmovisor run start --x-crisis-skip-assert-invariants --home "$NODE_HOME" -fi diff --git a/contrib/upgrade/run-upgrade.sh b/contrib/upgrade/run-upgrade.sh deleted file mode 100755 index bbf19cc45..000000000 --- a/contrib/upgrade/run-upgrade.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -export UPGRADE_HEIGHT_INTERVAL=${1:-10} -export UPGRADE_NAME=${2:-"$UPGRADE_NAME"} -[[ -z "$UPGRADE_NAME" ]] && echo "UPGRADE_NAME is required" && exit 1 - -export CHAIN_ID=${CHAIN_ID:-"fxcore"} -export NODE_HOME=${NODE_HOME:-"$HOME/.fxcore"} -export BINARY=${BINARY:-"fxcored"} -! test -f "$BINARY" && echo "Binary not found at $BINARY" - -$BINARY config chain-id "$CHAIN_ID" --home "$NODE_HOME" -$BINARY config output json --home "$NODE_HOME" -$BINARY config keyring-backend test --home "$NODE_HOME" -$BINARY config node tcp://localhost:26657 --home "$NODE_HOME" -$BINARY config broadcast-mode block --home "$NODE_HOME" -$BINARY config --home "$NODE_HOME" - -while true; do - sync_state=$("$BINARY" status --home "$NODE_HOME" | jq -r '.SyncInfo.catching_up') - if [ "$sync_state" != "false" ]; then - echo "Node is syncing..." && sleep 0.1 && continue - fi - break -done - -if [ -z "$($BINARY keys show fx1 --home "$NODE_HOME")" ]; then - echo "test test test test test test test test test test test junk" | $BINARY --home "$NODE_HOME" keys add fx1 --recover -fi - -upgrade_height=$($BINARY status --home "$NODE_HOME" | jq -r '.SyncInfo.latest_block_height|tonumber + '"${UPGRADE_HEIGHT_INTERVAL}"'') -readonly upgrade_height -printf "\n" -echo "Upgrade Height = ${upgrade_height}" -printf "Submitting proposal... \n" -$BINARY tx gov submit-proposal software-upgrade "$UPGRADE_NAME" \ - --title "$UPGRADE_NAME" \ - --deposit "$($BINARY query gov params --home "$NODE_HOME" | jq -r '.deposit_params.min_deposit[0].amount')FX" \ - --upgrade-height "${upgrade_height}" \ - --upgrade-info "upgrade to $UPGRADE_NAME" \ - --description "upgrade to $UPGRADE_NAME" \ - --gas auto --gas-prices 4000000000000FX --gas-adjustment=1.3 \ - --from fx1 \ - --home "${NODE_HOME}" \ - --yes -printf "Done \n" - -printf "Casting vote... \n" -PROPOSAL_ID=$($BINARY query gov proposals --status=voting_period --home "$NODE_HOME" | jq -r '.proposals[0].PROPOSAL_ID') - -echo "Vote ProposalID = ${PROPOSAL_ID}" - -$BINARY tx gov vote "${PROPOSAL_ID}" yes \ - --gas auto --gas-prices 4000000000000FX --gas-adjustment=1.3 \ - --from fx1 \ - --home "${NODE_HOME}" \ - --yes - -printf "Done \n" diff --git a/contrib/upgrade/run.sh b/contrib/upgrade/run.sh deleted file mode 100755 index 4dbe71fa0..000000000 --- a/contrib/upgrade/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -current_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -readonly current_path - -export NODE_HOME=${NODE_HOME:-"./out/.upgrade"} -[[ -d "$NODE_HOME" ]] && rm -r "$NODE_HOME" && mkdir -p "$NODE_HOME" - -[[ ! -f "${current_path}/run-upgrade.sh" ]] && echo "run-upgrade.sh not found" && exit 1 -nohup "${current_path}/run-upgrade.sh" 10 >&1 & - -[[ ! -f "${current_path}/run-cosmovisor.sh" ]] && echo "run-cosmovisor.sh not found" && exit 1 -"${current_path}/run-cosmovisor.sh" init "v3.1.x" "v4.1.x" diff --git a/cosmovisor.Dockerfile b/cosmovisor.Dockerfile new file mode 100644 index 000000000..eeda4ef4e --- /dev/null +++ b/cosmovisor.Dockerfile @@ -0,0 +1,64 @@ +FROM golang:1.21.4-alpine3.18 as builder + +RUN apk add --no-cache git build-base linux-headers + +RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 + +WORKDIR /app + +COPY . . + +RUN make build + +FROM functionx/fx-core:1.1.4 as fxv1 +FROM functionx/fx-core:2.4.3 as fxv2 +FROM functionx/fx-core:3.1.2 as fxv3 +FROM functionx/fx-core:4.0.1-rc1 as fxv4 +FROM functionx/fx-core:4.1.1-rc0 as fxv4_1 +FROM functionx/fx-core:4.2.2 as fxv4_2 +FROM functionx/fx-core:5.0.0 as fxv5 +FROM functionx/fx-core:6.0.0 as fxv6 +FROM functionx/fx-core:7.0.1-rc0 as fxv7 +FROM functionx/fx-core:7.1.0-rc1 as fxv7_1 +FROM functionx/fx-core:7.2.0-rc2 as fxv7_2 + +FROM alpine:3.18 + +WORKDIR /root + +ENV DAEMON_HOME=/root/.fxcore +ENV DAEMON_NAME=fxcored +ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=false +ENV DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM=false +ENV DAEMON_RESTART_AFTER_UPGRADE=true +ENV DAEMON_RESTART_DELAY=1s +ENV DAEMON_POLL_INTERVAL=3s +ENV UNSAFE_SKIP_BACKUP=true +ENV DAEMON_PREUPGRADE_MAX_RETRIES=3 +ENV COSMOVISOR_DISABLE_LOGS=false +ENV COSMOVISOR_COLOR_LOGS=true + +COPY --from=builder /go/bin/cosmovisor /usr/bin/cosmovisor +COPY --from=builder /app/build/bin/fxcored /usr/bin/fxcored + +# The copy directory needs to be changed in the next version +COPY --from=fxv1 /usr/bin/fxcored /root/.fxcore/cosmovisor/genesis/bin/fxcored +COPY --from=fxv2 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/fxv2/bin/fxcored +COPY --from=fxv3 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/fxv3/bin/fxcored +COPY --from=fxv4 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/fxv4/bin/fxcored +COPY --from=fxv4_1 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v4.1.x/bin/fxcored +COPY --from=fxv4_2 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v4.2.x/bin/fxcored +COPY --from=fxv5 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v5.0.x/bin/fxcored +COPY --from=fxv6 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v6.0.x/bin/fxcored +COPY --from=fxv7 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.0.x/bin/fxcored +COPY --from=fxv7_1 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.1.x/bin/fxcored +COPY --from=fxv7_2 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.2.x/bin/fxcored + +RUN cosmovisor init /root/.fxcore/cosmovisor/genesis/bin/fxcored + +EXPOSE 26656/tcp 26657/tcp 26660/tcp 9090/tcp 1317/tcp 8545/tcp 8546/tcp + +VOLUME ["/root"] + +ENTRYPOINT ["cosmovisor", "run"] + diff --git a/cosmovisor_lite.Dockerfile b/cosmovisor_lite.Dockerfile new file mode 100644 index 000000000..9fe453639 --- /dev/null +++ b/cosmovisor_lite.Dockerfile @@ -0,0 +1,48 @@ +FROM golang:1.21.4-alpine3.18 as builder + +RUN apk add --no-cache git build-base linux-headers + +RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 + +WORKDIR /app + +COPY . . + +RUN make build + +FROM functionx/fx-core:6.0.0 as fxv6 +FROM functionx/fx-core:7.0.1-rc0 as fxv7 +FROM functionx/fx-core:7.1.0-rc1 as fxv7_1 +FROM functionx/fx-core:7.2.0-rc2 as fxv7_2 + +FROM alpine:3.18 + +WORKDIR /root + +ENV DAEMON_HOME=/root/.fxcore +ENV DAEMON_NAME=fxcored +ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=false +ENV DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM=false +ENV DAEMON_RESTART_AFTER_UPGRADE=true +ENV DAEMON_RESTART_DELAY=1s +ENV DAEMON_POLL_INTERVAL=3s +ENV UNSAFE_SKIP_BACKUP=true +ENV DAEMON_PREUPGRADE_MAX_RETRIES=3 +ENV COSMOVISOR_DISABLE_LOGS=false +ENV COSMOVISOR_COLOR_LOGS=true + +COPY --from=builder /go/bin/cosmovisor /usr/bin/cosmovisor +COPY --from=builder /app/build/bin/fxcored /usr/bin/fxcored + +COPY --from=fxv6 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v6.0.x/bin/fxcored +COPY --from=fxv7 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.0.x/bin/fxcored +COPY --from=fxv7_1 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.1.x/bin/fxcored +COPY --from=fxv7_2 /usr/bin/fxcored /root/.fxcore/cosmovisor/upgrades/v7.2.x/bin/fxcored + +RUN cosmovisor init /root/.fxcore/cosmovisor/upgrades/v6.0.x/bin/fxcored + +EXPOSE 26656/tcp 26657/tcp 26660/tcp 9090/tcp 1317/tcp 8545/tcp 8546/tcp + +VOLUME ["/root"] + +ENTRYPOINT ["cosmovisor", "run"] diff --git a/tests/scripts/cosmovisor.sh b/tests/scripts/cosmovisor.sh new file mode 100755 index 000000000..f184b2489 --- /dev/null +++ b/tests/scripts/cosmovisor.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +set -eo pipefail + +# shellcheck source=/dev/null +. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/setup-env.sh" + +export NODE_HOME="$OUT_DIR/.$CHAIN_NAME" +export DOCKER_IMAGE="ghcr.io/functionx/fxcorevisor:latest" +export DAEMON="docker run --rm -i --network $DOCKER_NETWORK --entrypoint /root/.fxcore/cosmovisor/genesis/bin/fxcored -v $NODE_HOME:$NODE_HOME $DOCKER_IMAGE" + +function run_cosmovisor() { + local init=${1:-""} + + docker rm -f fxcore + + if [[ "$init" == "init" ]]; then + gen_cosmos_genesis + json_processor "$NODE_HOME/config/genesis.json" '.app_state.gov.voting_params.voting_period = "15s"' + json_processor "$NODE_HOME/config/genesis.json" '.initial_height = "2100000"' + fi + + docker run -d --name fxcore \ + -p 127.0.0.1:26657:26657 -p 127.0.0.1:1317:1317 \ + -p 127.0.0.1:8545:8545 -p 127.0.0.1:8546:8546 \ + -v "$NODE_HOME"/data:/root/.fxcore/data \ + -v "$NODE_HOME"/config:/root/.fxcore/config \ + -v "$NODE_HOME"/keyring-test:/root/.fxcore/keyring-test \ + "$DOCKER_IMAGE" start --x-crisis-skip-assert-invariants +} + +function send_upgrade_proposal() { + upgrade_name=${1:-"$UPGRADE_NAME"} + [[ -z "$upgrade_name" ]] && echo "upgrade name is required" && exit 1 + upgrade_height_interval=${2:-20} + + node_catching_up + + export NODE_HOME="/root/.fxcore" + export DAEMON="docker exec -i fxcore /root/.fxcore/cosmovisor/current/bin/fxcored" + upgrade_height=$($DAEMON status --home "$NODE_HOME" | jq -r '.SyncInfo.latest_block_height|tonumber + '"${upgrade_height_interval}"'') + readonly upgrade_height + echo "Upgrade Height = ${upgrade_height}" + + printf "Submitting proposal... \n" + deposit=$(cosmos_query gov params | jq -r '.deposit_params.min_deposit[0].amount')$STAKING_DENOM + proposal_cmd="submit-proposal" + if [[ "${upgrade_name}" =~ v[0-9]+\.[0-9]+\.* ]]; then + deposit=$(cosmos_query gov params | jq -r '.params.min_deposit[0].amount')$STAKING_DENOM + proposal_cmd="submit-legacy-proposal" + export GAS_ADJUSTMENT=1.5 + fi + cosmos_tx gov "$proposal_cmd" software-upgrade "$upgrade_name" \ + --title "$upgrade_name" \ + --deposit "${deposit}" \ + --upgrade-height "${upgrade_height}" \ + --upgrade-info "upgrade to $upgrade_name" \ + --description "upgrade to $upgrade_name" \ + --no-validate=true \ + --from "${FROM}" + + printf "Casting vote... \n" + PROPOSAL_ID=$(cosmos_query gov proposals --status=voting_period | jq -r '.proposals[0].proposal_id // .proposals[0].id') + echo "Vote ProposalID = ${PROPOSAL_ID}" + + cosmos_tx gov vote "${PROPOSAL_ID}" yes --from "${FROM}" +} + +# shellcheck source=/dev/null +. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/footer.sh" diff --git a/tests/scripts/setup-env.sh b/tests/scripts/setup-env.sh index 3c0959d57..449adf9eb 100755 --- a/tests/scripts/setup-env.sh +++ b/tests/scripts/setup-env.sh @@ -132,6 +132,7 @@ function from_18() { function gen_cosmos_genesis() { $DAEMON init --chain-id="$CHAIN_ID" local-test --home "$NODE_HOME" + $DAEMON config app.toml minimum-gas-prices "$GAS_PRICES" --home "$NODE_HOME" $DAEMON config app.toml grpc-web.enable false --home "$NODE_HOME" $DAEMON config app.toml api.enable true --home "$NODE_HOME" @@ -172,7 +173,7 @@ function gen_cosmos_genesis() { } function node_catching_up() { - local node_url=${1:-"$REST_RPC"} + local node_url=${1:-"$NODE_RPC"} local timeout=${2:-"10"} for i in $(seq "$timeout"); do sync_state=$(curl -s "$node_url/status" | jq -r '.result.sync_info.catching_up')