-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: continue sdk upgrade with krypton logic
- Loading branch information
Showing
56 changed files
with
1,872 additions
and
8,723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
uses: strangelove-ventures/[email protected] | ||
with: | ||
registry: "" # empty registry, image only shared for e2e testing | ||
tag: local # emulate local environment for consistency in interchaintest cases | ||
tag: local # emulate local environment for consistency in e2e cases | ||
tar-export-path: ${{ env.TAR_PATH }} # export a tarball that can be uploaded as an artifact for the e2e jobs | ||
platform: linux/amd64 # test runner architecture only | ||
git-ref: ${{ github.head_ref }} # source code ref | ||
|
@@ -85,4 +85,4 @@ jobs: | |
run: docker image load -i ${{ env.TAR_PATH }} | ||
|
||
- name: run test | ||
run: cd interchaintest && go test -race -v -timeout 30m -run ^${{ matrix.test }}$ . | ||
run: cd e2e && go test -race -v -timeout 30m -run ^${{ matrix.test }}$ . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
vue/node_modules | ||
vue/dist | ||
release/ | ||
.idea/ | ||
.vscode/ | ||
.DS_Store | ||
play_sh/ | ||
/heighliner* | ||
bin/ | ||
.duke | ||
.idea | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,56 @@ | ||
#!/usr/bin/make -f | ||
|
||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD) | ||
COMMIT := $(shell git log -1 --format='%H') | ||
DOCKER := $(shell which docker) | ||
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf | ||
|
||
# don't override user values | ||
ifeq (,$(VERSION)) | ||
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') | ||
# if VERSION is empty, then populate it with branch's name and raw commit hash | ||
VERSION := $(shell git describe --exact-match 2>/dev/null) | ||
ifeq (,$(VERSION)) | ||
VERSION := $(BRANCH)-$(COMMIT) | ||
endif | ||
endif | ||
|
||
CHAIN_NAME = noble | ||
DAEMON_NAME = nobled | ||
|
||
LEDGER_ENABLED ?= true | ||
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') | ||
BUILDDIR ?= $(CURDIR)/build | ||
|
||
export GO111MODULE = on | ||
|
||
# process build tags | ||
|
||
build_tags = netgo | ||
ifeq ($(LEDGER_ENABLED),true) | ||
ifeq ($(OS),Windows_NT) | ||
GCCEXE = $(shell where gcc.exe 2> NUL) | ||
ifeq ($(GCCEXE),) | ||
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
ifeq ($(shell git status --porcelain),) | ||
VERSION := $(BRANCH) | ||
else | ||
build_tags += ledger | ||
endif | ||
else | ||
UNAME_S = $(shell uname -s) | ||
ifeq ($(UNAME_S),OpenBSD) | ||
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) | ||
else | ||
GCC = $(shell command -v gcc 2> /dev/null) | ||
ifeq ($(GCC),) | ||
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
else | ||
build_tags += ledger | ||
endif | ||
VERSION := $(BRANCH):dirty | ||
endif | ||
endif | ||
endif | ||
|
||
build_tags += $(BUILD_TAGS) | ||
build_tags := $(strip $(build_tags)) | ||
|
||
whitespace := | ||
whitespace += $(whitespace) | ||
comma := , | ||
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) | ||
|
||
# process linker flags | ||
|
||
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(CHAIN_NAME) \ | ||
-X github.com/cosmos/cosmos-sdk/version.AppName=$(DAEMON_NAME) \ | ||
-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)" \ | ||
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TM_VERSION) | ||
|
||
ldflags += $(LDFLAGS) | ||
ldflags := $(LDFLAGS) | ||
ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=noble \ | ||
-X github.com/cosmos/cosmos-sdk/version.AppName=nobled \ | ||
-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=netgo,ledger | ||
ldflags := $(strip $(ldflags)) | ||
|
||
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' | ||
|
||
BUILD_FLAGS := -tags 'netgo ledger' -ldflags '$(ldflags)' | ||
|
||
############################################################################### | ||
### Building / Install ### | ||
### Build ### | ||
############################################################################### | ||
|
||
all: install | ||
|
||
install: go.sum | ||
go install -mod=readonly $(BUILD_FLAGS) ./cmd/nobled | ||
|
||
build: | ||
go build $(BUILD_FLAGS) -o bin/nobled ./cmd/nobled | ||
|
||
@go build -mod=readonly $(BUILD_FLAGS) -o $(PWD)/bin/ ./cmd/nobled | ||
|
||
############################################################################### | ||
### Linting ### | ||
### Formatting & Linting ### | ||
############################################################################### | ||
|
||
lint: | ||
@echo "--> Running linter" | ||
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m | ||
|
||
|
||
|
||
############################################################################### | ||
### INTERCHAINTEST (ictest) ### | ||
############################################################################### | ||
|
||
test: | ||
go test -v -race ./... | ||
|
||
############################################################################### | ||
### Build Image ### | ||
############################################################################### | ||
get-heighliner: | ||
git clone https://github.com/strangelove-ventures/heighliner.git | ||
cd heighliner && go install | ||
gofumpt_cmd=mvdan.cc/gofumpt | ||
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
local-image: | ||
ifeq (,$(shell which heighliner)) | ||
echo 'heighliner' binary not found. Consider running `make get-heighliner` | ||
else | ||
heighliner build -c noble --local -f ./chains.yaml | ||
endif | ||
format: | ||
@echo "π€ Running formatter..." | ||
@go run $(gofumpt_cmd) -l -w . | ||
@echo "β Completed formatting!" | ||
|
||
.PHONY: all build-linux install lint test \ | ||
go-mod-cache build interchaintest get-heighliner local-image \ | ||
lint: | ||
@echo "π€ Running linter..." | ||
@go run $(golangci_lint_cmd) run --timeout=10m | ||
@echo "β Completed linting!" | ||
|
||
############################################################################### | ||
### Protobuf ### | ||
### Testing ### | ||
############################################################################### | ||
|
||
BUF_VERSION=1.30.0 | ||
BUILDER_VERSION=0.14.0 | ||
|
||
proto-all: proto-format proto-lint proto-gen | ||
|
||
proto-format: | ||
@echo "π€ Running protobuf formatter..." | ||
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ | ||
bufbuild/buf:$(BUF_VERSION) format --diff --write | ||
@echo "β Completed protobuf formatting!" | ||
|
||
proto-gen: | ||
@echo "π€ Generating code from protobuf..." | ||
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ | ||
ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./proto/generate.sh | ||
@echo "β Completed code generation!" | ||
|
||
proto-lint: | ||
@echo "π€ Running protobuf linter..." | ||
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ | ||
bufbuild/buf:$(BUF_VERSION) lint | ||
@echo "β Completed protobuf linting!" | ||
# TODO(@john): Add "local-image" command! |
Oops, something went wrong.