Skip to content

Commit

Permalink
Migration chain from Banksy to Centauri (#140)
Browse files Browse the repository at this point in the history
* rename

* go.mod go.sum

* add prefix migration

* proto file change

* lint

* down version golang-ci

* go mod

---------

Co-authored-by: vuong <[email protected]>
  • Loading branch information
anhductn2001 and vuong177 authored Jun 8, 2023
1 parent 1353129 commit 6a4e878
Show file tree
Hide file tree
Showing 75 changed files with 952 additions and 567 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/notional-labs/banksy-ictest:latest
ghcr.io/notional-labs/centauri-ictest:latest
test-start-cosmos-chain:
runs-on: ubuntu-latest
needs: build-and-push-image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.52.2
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
args: --timeout 15m
16 changes: 8 additions & 8 deletions .github/workflows/push_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow pushes new banksy docker images on every new tag.
# This workflow pushes new centauri docker images on every new tag.
#
# On every new `vX.Y.Z` tag the following images are pushed:
#
# notional-labs/banksy:X.Y.Z # is pushed
# notional-labs/banksy:X.Y # is updated to X.Y.Z
# notional-labs/banksy:X # is updated to X.Y.Z
# notional-labs/banksy:latest # is updated to X.Y.Z
# notional-labs/centauri:X.Y.Z # is pushed
# notional-labs/centauri:X.Y # is updated to X.Y.Z
# notional-labs/centauri:X # is updated to X.Y.Z
# notional-labs/centauri:latest # is updated to X.Y.Z
#
# All the images above have support for linux/amd64 and linux/arm64.
#
Expand Down Expand Up @@ -61,6 +61,6 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/notional-labs/banksy:${{ env.MAJOR_VERSION }}
ghcr.io/notional-labs/banksy:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/notional-labs/banksy:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /banksy
WORKDIR /centauri
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
Expand All @@ -35,32 +35,32 @@ RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) &&
# Copy the remaining files
COPY . .

# Build banksyd binary
# Build centaurid binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="banksy" \
-X github.com/cosmos/cosmos-sdk/version.AppName="banksyd" \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /banksy/build/banksyd \
/banksy/cmd/banksyd/main.go
-o /centauri/build/centaurid \
/centauri/cmd/centaurid/main.go

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /banksy/build/banksyd /bin/banksyd
COPY --from=builder /centauri/build/centaurid /bin/centaurid

ENV HOME /banksy
ENV HOME /centauri
WORKDIR $HOME

# rest server
Expand All @@ -71,4 +71,4 @@ EXPOSE 26656
EXPOSE 26657
# grpc
EXPOSE 9090
ENTRYPOINT ["banksyd"]
ENTRYPOINT ["centaurid"]
18 changes: 9 additions & 9 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /banksy
WORKDIR /centauri
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
Expand All @@ -35,36 +35,36 @@ RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) &&
# Copy the remaining files
COPY . .

# Build banksyd binary
# Build centaurid binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="banksy" \
-X github.com/cosmos/cosmos-sdk/version.AppName="banksyd" \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /banksy/build/banksyd \
/banksy/cmd/banksyd/main.go
-o /centauri/build/centaurid \
/centauri/cmd/centaurid/main.go

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /banksy/build/banksyd /bin/banksyd
COPY --from=builder /centauri/build/centaurid /bin/centaurid

ENV HOME /banksy
ENV HOME /centauri

WORKDIR $HOME

COPY scripts/* /banksy
COPY scripts/* /centauri
# rest server
EXPOSE 1317
# tendermint p2p
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
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/banksy/.git
HTTPS_GIT := https://github.com/notional-labs/composable-testnet/.git

export GO111MODULE = on

Expand Down Expand Up @@ -58,8 +58,8 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=banksy \
-X github.com/cosmos/cosmos-sdk/version.AppName=banksyd \
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=centauri \
-X github.com/cosmos/cosmos-sdk/version.AppName=centaurid \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
Expand All @@ -86,13 +86,13 @@ endif
all: install

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/banksyd
go install -mod=readonly $(BUILD_FLAGS) ./cmd/centaurid

build:
go build $(BUILD_FLAGS) -o bin/banksyd ./cmd/banksyd
go build $(BUILD_FLAGS) -o bin/centaurid ./cmd/centaurid

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t banksy:debug -f Dockerfile .
@DOCKER_BUILDKIT=1 docker build -t centauri:debug -f Dockerfile .

###############################################################################
### Proto ###
Expand Down Expand Up @@ -127,15 +127,15 @@ proto-check-breaking:

# Executes start chain tests via interchaintest
ictest-start-cosmos:
cd tests/interchaintest && go test -race -v -run TestStartBanksy .
cd tests/interchaintest && go test -race -v -run TestStartCentauri .

# Executes start chain tests via interchaintest
ictest-start-polkadot:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestPolkadotComposableChainStart .

# Executes IBC tests via interchaintest
ictest-ibc:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestBanksyPicassoIBCTransfer .
cd tests/interchaintest && go test -timeout=25m -race -v -run TestCentauriPicassoIBCTransfer .

# Executes all tests via interchaintest after compling a local image as juno:local
ictest-all: ictest-start-cosmos ictest-start-polkadot ictest-ibc
Expand Down
Loading

0 comments on commit 6a4e878

Please sign in to comment.