Skip to content

Commit 22c4828

Browse files
authored
chore: use ignite v28.7.x (#11)
* chore: use ignite v28.7.x * ignite chain serve * fix
1 parent 6a01070 commit 22c4828

File tree

9 files changed

+826
-117
lines changed

9 files changed

+826
-117
lines changed

.github/workflows/release.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow is useful if you want to automate the process of:
2+
#
3+
# a) Creating a new prelease when you push a new tag with a "v" prefix (version).
4+
#
5+
# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases.
6+
# After the prerelease is created, you need to make your changes on the release page at the relevant
7+
# Github page and publish your release.
8+
#
9+
# b) Creating/updating the "latest" prerelease when you push to your default branch.
10+
#
11+
# This type of prelease is useful to make your bleeding-edge binaries available to advanced users.
12+
#
13+
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
14+
# default branch.
15+
on: push
16+
17+
jobs:
18+
might_release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Prepare Release Variables
27+
id: vars
28+
uses: ignite/cli/actions/release/vars@main
29+
30+
- name: Issue Release Assets
31+
uses: ignite/cli/actions/cli@main
32+
if: ${{ steps.vars.outputs.should_release == 'true' }}
33+
with:
34+
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 -y
35+
env:
36+
DO_NOT_TRACK: 1
37+
38+
- name: Delete the "latest" Release
39+
uses: dev-drprasad/[email protected]
40+
if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }}
41+
with:
42+
tag_name: ${{ steps.vars.outputs.tag_name }}
43+
delete_release: true
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Publish the Release
48+
uses: softprops/action-gh-release@v1
49+
if: ${{ steps.vars.outputs.should_release == 'true' }}
50+
with:
51+
tag_name: ${{ steps.vars.outputs.tag_name }}
52+
files: release/*
53+
prerelease: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
2+
COMMIT := $(shell git log -1 --format='%H')
3+
APPNAME := example
4+
5+
# don't override user values
6+
ifeq (,$(VERSION))
7+
VERSION := $(shell git describe --exact-match 2>/dev/null)
8+
# if VERSION is empty, then populate it with branch's name and raw commit hash
9+
ifeq (,$(VERSION))
10+
VERSION := $(BRANCH)-$(COMMIT)
11+
endif
12+
endif
13+
14+
# Update the ldflags with the app, client & server names
15+
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(APPNAME) \
16+
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME)d \
17+
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
18+
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
19+
20+
BUILD_FLAGS := -ldflags '$(ldflags)'
21+
22+
##############
23+
### Test ###
24+
##############
25+
26+
test-unit:
27+
@echo Running unit tests...
28+
@go test -mod=readonly -v -timeout 30m ./...
29+
30+
test-race:
31+
@echo Running unit tests with race condition reporting...
32+
@go test -mod=readonly -v -race -timeout 30m ./...
33+
34+
test-cover:
35+
@echo Running unit tests and creating coverage report...
36+
@go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic ./...
37+
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
38+
@rm $(COVER_FILE)
39+
40+
bench:
41+
@echo Running unit tests with benchmarking...
42+
@go test -mod=readonly -v -timeout 30m -bench=. ./...
43+
44+
test: govet govulncheck test-unit
45+
46+
.PHONY: test test-unit test-race test-cover bench
47+
48+
#################
49+
### Install ###
50+
#################
51+
52+
all: install
53+
54+
install:
55+
@echo "--> ensure dependencies have not been modified"
56+
@go mod verify
57+
@echo "--> installing $(APPNAME)d"
58+
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/$(APPNAME)d
59+
60+
.PHONY: all install
61+
62+
##################
63+
### Protobuf ###
64+
##################
65+
66+
# Use this proto-image if you do not want to use Ignite for generating proto files
67+
protoVer=0.15.1
68+
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
69+
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
70+
71+
proto-gen:
72+
@echo "Generating protobuf files..."
73+
@ignite generate proto-go --yes
74+
75+
.PHONY: proto-gen
76+
77+
#################
78+
### Linting ###
79+
#################
80+
81+
golangci_lint_cmd=golangci-lint
82+
golangci_version=v1.61.0
83+
84+
lint:
85+
@echo "--> Running linter"
86+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
87+
@$(golangci_lint_cmd) run ./... --timeout 15m
88+
89+
lint-fix:
90+
@echo "--> Running linter and fixing issues"
91+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
92+
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
93+
94+
.PHONY: lint lint-fix
95+
96+
###################
97+
### Development ###
98+
###################
99+
100+
govet:
101+
@echo Running go vet...
102+
@go vet ./...
103+
104+
govulncheck:
105+
@echo Running govulncheck...
106+
@go install golang.org/x/vuln/cmd/govulncheck@latest
107+
@govulncheck ./...
108+
109+
.PHONY: govet govulncheck

cmd/exampled/cmd/commands.go

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
servertypes "github.com/cosmos/cosmos-sdk/server/types"
1919
"github.com/cosmos/cosmos-sdk/types/module"
2020
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
21+
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2122
"github.com/cosmos/cosmos-sdk/x/crisis"
2223
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
2324
"github.com/spf13/cobra"
@@ -34,6 +35,7 @@ func initRootCmd(
3435
rootCmd.AddCommand(
3536
genutilcli.InitCmd(basicManager, app.DefaultNodeHome),
3637
NewInPlaceTestnetCmd(addModuleInitFlags),
38+
NewTestnetMultiNodeCmd(basicManager, banktypes.GenesisBalancesIterator{}),
3739
debug.Cmd(),
3840
confixcmd.ConfigCommand(),
3941
pruning.Cmd(newApp, app.DefaultNodeHome),

0 commit comments

Comments
 (0)