Skip to content

Commit

Permalink
Merge pull request ComposableFi#442 from tungle-notional/test/upgrade…
Browse files Browse the repository at this point in the history
…chain

test: upgrade chain from v6 to v7
  • Loading branch information
hoank101 authored Feb 2, 2024
2 parents 99f3426 + cdcb77d commit 9e38eda
Show file tree
Hide file tree
Showing 11 changed files with 838 additions and 1 deletion.
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
BUILDDIR ?= $(CURDIR)/build
HTTPS_GIT := https://github.com/notional-labs/composable-centauri.git
TESTNET_NVAL := 6
TESTNET_CHAINID := test-1

export GO111MODULE = on

Expand Down Expand Up @@ -160,3 +162,47 @@ ictest-push-wasm:
cd tests/interchaintest && go test -race -v -run TestPushWasmClientCode .

.PHONY: ictest-start-cosmos ictest-start-polkadot ictest-ibc ictest-push-wasm ictest-all

###############################################################################
### Localnet ###
###############################################################################

build-linux:
mkdir -p $(BUILDDIR)
docker build --platform linux/amd64 --tag centaurid ./
docker create --platform linux/amd64 --name temp centaurid:latest
docker cp temp:/bin/centaurid $(BUILDDIR)/
docker rm temp

localnet-start: localnet-stop
@if ! [ -f build/node0/$(BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/centauri:Z centaurid testnet init-files --chain-id ${TESTNET_CHAINID} --v ${TESTNET_NVAL} -o /centauri --keyring-backend=test --starting-ip-address 192.168.0.2; fi

localnet-stop:
docker-compose down
rm -rf build/node*
rm -rf build/gentxs.

###############################################################################
### Upgrade ###
###############################################################################
build-cosmovisor-linux:
@if [ -z "$(docker images -q centauri/centauri.cosmovisor-binary 2> /dev/null)" ]; then \
$(MAKE) -C contrib/updates build-cosmovisor-linux BUILDDIR=$(BUILDDIR); \
fi

build-centaurid-env:
@if [ -z "$(docker images -q centauri/centaurid-upgrade-env 2> /dev/null)" ]; then \
$(MAKE) -C contrib/centaurid-env centaurid-upgrade-env; \
fi

## Presiquites: build-cosmovisor-linux build-linux build-centaurid-env
localnet-start-upgrade: localnet-upgrade-stop build-cosmovisor-linux build-linux build-centaurid-env
bash contrib/updates/prepare_cosmovisor.sh $(BUILDDIR) ${TESTNET_NVAL} ${TESTNET_CHAINID}
docker-compose -f ./contrib/updates/docker-compose.yml up -d
@./contrib/updates/upgrade-test.sh
$(MAKE) localnet-upgrade-stop

localnet-upgrade-stop:
docker-compose -f contrib/updates/docker-compose.yml down
rm -rf build
rm -rf _build
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ func NewComposableApp(
interfaceRegistry: interfaceRegistry,
invCheckPeriod: invCheckPeriod,
}

app.InitSpecialKeepers(
appCodec,
cdc,
Expand Down
1 change: 1 addition & 0 deletions cmd/centaurid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) {
AddGenesisAccountCmd(app.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
addDebugCommands(debug.Cmd()),
NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator),
debug.Cmd(),
config.Cmd(),
CovertPrefixAddr(),
Expand Down
Loading

0 comments on commit 9e38eda

Please sign in to comment.