diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 376dfb957554..937e29564a99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -938,6 +938,7 @@ jobs: test-x-accounts-base: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/Makefile b/Makefile index f08a41402ded..8a446fc01fe1 100644 --- a/Makefile +++ b/Makefile @@ -329,13 +329,8 @@ proto-update-deps: # Run a 4-node testnet locally localnet-start: build-linux localnet-stop $(if $(shell $(DOCKER) inspect -f '{{ .Id }}' cosmossdk/simd-env 2>/dev/null),$(info found image cosmossdk/simd-env),$(MAKE) -C contrib/images simd-env) - if ! [ -f build/node0/simd/config/genesis.json ]; then $(DOCKER) run --rm \ - --user $(shell id -u):$(shell id -g) \ - -v $(BUILDDIR):/simd:Z \ - -v /etc/group:/etc/group:ro \ - -v /etc/passwd:/etc/passwd:ro \ - -v /etc/shadow:/etc/shadow:ro \ - cosmossdk/simd-env testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi + $(DOCKER) run --rm -v $(CURDIR)/localnet:/data cosmossdk/simd-env \ + testnet init-files --v 4 -o /data --starting-ip-address 192.168.10.2 --keyring-backend=test docker-compose up -d localnet-stop: diff --git a/contrib/images/Makefile b/contrib/images/Makefile index 9fd1c11c12af..b28ade5b795b 100644 --- a/contrib/images/Makefile +++ b/contrib/images/Makefile @@ -1,7 +1,7 @@ all: simd-env -simd-env: simd-rmi - docker build --tag cosmossdk/simd -f simd-env/Dockerfile \ +simd-env: + docker build --tag cosmossdk/simd-env -f simd-env/Dockerfile \ $(shell git rev-parse --show-toplevel) simd-dlv: simd-rmi diff --git a/contrib/images/simd-env/Dockerfile b/contrib/images/simd-env/Dockerfile index 8ff6675b0379..b4443cdc8a8e 100644 --- a/contrib/images/simd-env/Dockerfile +++ b/contrib/images/simd-env/Dockerfile @@ -1,49 +1,21 @@ -FROM golang:1.23-alpine AS build - +FROM golang:1.17-alpine AS build RUN apk add build-base git linux-headers - WORKDIR /work COPY go.mod go.sum /work/ -COPY math/go.mod math/go.sum /work/math/ -COPY api/go.mod api/go.sum /work/api/ -COPY log/go.mod log/go.sum /work/log/ -COPY core/go.mod core/go.sum /work/core/ -COPY collections/go.mod collections/go.sum /work/collections/ -COPY store/go.mod store/go.sum /work/store/ -COPY depinject/go.mod depinject/go.sum /work/depinject/ -COPY x/tx/go.mod x/tx/go.sum /work/x/tx/ -COPY x/protocolpool/go.mod x/protocolpool/go.sum /work/x/protocolpool/ -COPY x/gov/go.mod x/gov/go.sum /work/x/gov/ -COPY x/distribution/go.mod x/distribution/go.sum /work/x/distribution/ -COPY x/slashing/go.mod x/slashing/go.sum /work/x/slashing/ -COPY x/staking/go.mod x/staking/go.sum /work/x/staking/ -COPY x/auth/go.mod x/auth/go.sum /work/x/auth/ -COPY x/authz/go.mod x/authz/go.sum /work/x/authz/ -COPY x/bank/go.mod x/bank/go.sum /work/x/bank/ -COPY x/mint/go.mod x/mint/go.sum /work/x/mint/ -COPY x/consensus/go.mod x/consensus/go.sum /work/x/consensus/ -COPY x/accounts/go.mod x/accounts/go.sum /work/x/accounts/ -COPY runtime/v2/go.mod runtime/v2/go.sum /work/runtime/v2/ -COPY server/v2/go.mod server/v2/go.sum /work/server/v2/ -COPY server/v2/appmanager/go.mod server/v2/appmanager/go.sum /work/server/v2/appmanager/ -COPY server/v2/stf/go.mod server/v2/stf/go.sum /work/server/v2/stf/ -COPY server/v2/cometbft/go.mod server/v2/cometbft/go.sum /work/server/v2/cometbft/ -COPY core/testing/go.mod core/testing/go.sum /work/core/testing/ - +COPY db/go.mod db/go.sum /work/db/ RUN go mod download - COPY ./ /work RUN LEDGER_ENABLED=false make clean build - -FROM alpine AS run +FROM alpine:3.14 AS run RUN apk add bash curl jq +COPY contrib/images/simd-env/wrapper.sh /usr/bin/wrapper.sh + +VOLUME /simd +COPY --from=build /work/build/simd /simd/ +WORKDIR /simd + EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/wrapper.sh"] CMD ["start", "--log_format", "plain"] STOPSIGNAL SIGTERM -VOLUME /simd -WORKDIR /simd - -COPY contrib/images/simd-env/wrapper.sh /usr/bin/wrapper.sh -COPY --from=build /work/build/simd /simd/ diff --git a/docker-compose.yml b/docker-compose.yml index 13851c894e9f..0ca715d3731e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: - "9090:9090" - "2345:2345" volumes: - - ./.testnets:/data:Z + - ./localnet:/data:Z networks: localnet: ipv4_address: 192.168.10.2 @@ -40,7 +40,7 @@ services: - "9091:9090" - "2346:2345" volumes: - - ./.testnets:/data:Z + - ./localnet:/data:Z networks: localnet: ipv4_address: 192.168.10.3 @@ -62,7 +62,7 @@ services: - "9092:9090" - "2347:2345" volumes: - - ./.testnets:/data:Z + - ./localnet:/data:Z networks: localnet: ipv4_address: 192.168.10.4 @@ -84,7 +84,7 @@ services: - "9093:9090" - "2348:2345" volumes: - - ./.testnets:/data:Z + - ./localnet:/data:Z networks: localnet: ipv4_address: 192.168.10.5