1
1
# !/usr/bin/make -f
2
2
3
3
include scripts/makefiles/build.mk
4
+ include scripts/makefiles/docker.mk
4
5
include scripts/makefiles/e2e.mk
5
6
include scripts/makefiles/hl.mk
6
- include scripts/makefiles/docker.mk
7
+ include scripts/makefiles/proto.mk
8
+ include scripts/makefiles/localnet.mk
7
9
include contrib/devtools/Makefile
8
10
9
11
.DEFAULT_GOAL := help
14
16
@echo " make [command]"
15
17
@echo " "
16
18
@echo " make build Build Bitsong node binary"
17
- @echo " make install Install Bitsong node binary"
18
- @echo " make hl Show available docker commands (via Strangelove's Heighliner Tooling)"
19
+ @echo " make docker Show available docker related commands"
19
20
@echo " make e2e Show available e2e commands"
21
+ @echo " make hl Show available docker commands (via Strangelove's Heighliner Tooling)"
22
+ @echo " make install Install Bitsong node binary"
23
+ @echo " make localnet Show available localnet commands"
20
24
@echo " "
21
25
@echo " Run 'make [subcommand]' to see the available commands for each subcommand."
22
26
@@ -39,8 +43,6 @@ TENDERMINT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.
39
43
DOCKER := $(shell which docker)
40
44
DOCKER_BUF := $(DOCKER ) run --rm -v $(CURDIR ) :/workspace --workdir /workspace bufbuild/buf
41
45
42
- E2E_UPGRADE_VERSION := "v0.18.0"
43
-
44
46
GO_MODULE := $(shell cat go.mod | grep "module " | cut -d ' ' -f 2)
45
47
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
46
48
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
@@ -98,7 +100,6 @@ comma := ,
98
100
build_tags_comma_sep := $(subst $(whitespace ) ,$(comma ) ,$(build_tags ) )
99
101
100
102
# process linker flags
101
-
102
103
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=go-bitsong \
103
104
-X github.com/cosmos/cosmos-sdk/version.AppName=bitsongd \
104
105
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION ) \
@@ -116,59 +117,18 @@ endif
116
117
ldflags += $(LDFLAGS )
117
118
ldflags := $(strip $(ldflags ) )
118
119
119
- BUILD_FLAGS := -tags "$(build_tags ) " -ldflags '$(ldflags ) ' -trimpath
120
-
121
- all : install tools lint
120
+ BUILD_FLAGS := -tags "$(build_tags ) " -ldflags '$(ldflags ) '
122
121
123
122
build : go.sum
124
123
ifeq ($(OS ) ,Windows_NT)
125
124
go build -mod=readonly $(BUILD_FLAGS) -o build/bitsongd.exe ./cmd/bitsongd
126
125
else
127
- go build $(BUILD_FLAGS) -o bin /bitsongd ./cmd/bitsongd
126
+ go build $(BUILD_FLAGS) -o build /bitsongd ./cmd/bitsongd
128
127
endif
129
128
130
- build-linux : go.sum
131
- go build $(BUILD_FLAGS )
132
-
133
129
install : go.sum
134
130
go install -mod=readonly $(BUILD_FLAGS ) ./cmd/bitsongd
135
131
136
- # update-swagger-docs: statik
137
- # $(BINDIR)/statik -src=swagger/swagger-ui -dest=swagger -f -m
138
- # @if [ -n "$(git status --porcelain)" ]; then \
139
- # echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
140
- # exit 1;\
141
- # else \
142
- # echo "\033[92mSwagger docs are in sync\033[0m";\
143
- # fi
144
-
145
- # ##############################################################################
146
- # ## Localnet ###
147
- # ##############################################################################
148
-
149
- build-docker-go-bitsong :
150
- $(MAKE ) -C contrib/localnet
151
-
152
- # Run a 4-node testnet locally
153
- localnet-start : build-linux build-docker-bitsongdnode
154
- @if ! [ -f build/node0/bitsongd/config/genesis.json ]; \
155
- then docker run --rm -v $(CURDIR ) /build:/bitsongd:Z bitsongofficial/bitsongdnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; \
156
- fi
157
- docker-compose up -d
158
-
159
- # Stop testnet
160
- localnet-stop :
161
- docker-compose down
162
-
163
- test-docker :
164
- @docker build -f contrib/Dockerfile.test -t ${TEST_DOCKER_REPO} :$(shell git rev-parse --short HEAD) .
165
- @docker tag ${TEST_DOCKER_REPO} :$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO} :$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
166
- @docker tag ${TEST_DOCKER_REPO} :$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO} :latest
167
-
168
- test-docker-push : test-docker
169
- @docker push ${TEST_DOCKER_REPO} :$(shell git rev-parse --short HEAD)
170
- @docker push ${TEST_DOCKER_REPO} :$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
171
- @docker push ${TEST_DOCKER_REPO} :latest
172
132
173
133
174
134
# #######################################
@@ -193,76 +153,6 @@ clean:
193
153
distclean : clean
194
154
rm -rf vendor/
195
155
196
- # ##############################################################################
197
- # ## Protobuf ###
198
- # ##############################################################################
199
-
200
- containerProtoVer =v0.2
201
- containerProtoImage =tendermintdev/sdk-proto-gen:$(containerProtoVer )
202
- containerProtoGen =cosmos-sdk-proto-gen-$(containerProtoVer )
203
- containerProtoGenSwagger =cosmos-sdk-proto-gen-swagger-$(containerProtoVer )
204
- containerProtoFmt =cosmos-sdk-proto-fmt-$(containerProtoVer )
205
-
206
- proto-all : proto-format proto-lint proto-gen
207
-
208
- proto-gen :
209
- @echo " Generating Protobuf files"
210
- $(DOCKER ) run --rm --name $(containerProtoGen ) \
211
- -v $(CURDIR ) :/workspace \
212
- --workdir /workspace \
213
- $(containerProtoImage ) sh ./scripts/protocgen.sh
214
-
215
- # This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
216
- proto-gen-any :
217
- @echo " Generating Protobuf Any"
218
- $(DOCKER ) run --rm -v $(CURDIR ) :/workspace --workdir /workspace $(containerProtoImage ) sh ./scripts/protocgen-any.sh
219
-
220
- # proto-swagger-gen:
221
- # @echo "Generating Protobuf Swagger"
222
- # $(DOCKER) run --rm --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protoc-swagger-gen.sh
223
-
224
- proto-format :
225
- @echo " Formatting Protobuf files"
226
- $(DOCKER ) run --rm --name $(containerProtoFmt ) \
227
- --user $(shell id -u) :$(shell id -g) \
228
- -v $(CURDIR ) :/workspace \
229
- --workdir /workspace \
230
- tendermintdev/docker-build-proto find ./ -not -path " ./third_party/*" -name * .proto -exec clang-format -i {} \;
231
-
232
- proto-lint :
233
- @$(DOCKER_BUF ) lint --error-format=json
234
-
235
- proto-check-breaking :
236
- @$(DOCKER_BUF ) breaking --against $(HTTPS_GIT ) # branch=master
237
-
238
- GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
239
- GOOGLE_PROTO_URL = https://raw.githubusercontent.com/googleapis/googleapis/master
240
- REGEN_COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
241
- COSMOS_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.4/proto/cosmos
242
-
243
- GOGO_PROTO_TYPES = third_party/proto/gogoproto
244
- GOOGLE_PROTO_TYPES = third_party/proto/google
245
- REGEN_COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
246
- COSMOS_PROTO_TYPES = third_party/proto/cosmos
247
-
248
- proto-update-deps :
249
- @mkdir -p $(GOGO_PROTO_TYPES )
250
- @curl -sSL $(GOGO_PROTO_URL ) /gogoproto/gogo.proto > $(GOGO_PROTO_TYPES ) /gogo.proto
251
-
252
- @mkdir -p $(GOOGLE_PROTO_TYPES)/api/
253
- @curl -sSL $(GOOGLE_PROTO_URL)/google/api/annotations.proto > $(GOOGLE_PROTO_TYPES)/api/annotations.proto
254
- @curl -sSL $(GOOGLE_PROTO_URL)/google/api/http.proto > $(GOOGLE_PROTO_TYPES)/api/http.proto
255
-
256
- @mkdir -p $(REGEN_COSMOS_PROTO_TYPES)
257
- @curl -sSL $(REGEN_COSMOS_PROTO_URL)/cosmos.proto > $(REGEN_COSMOS_PROTO_TYPES)/cosmos.proto
258
-
259
- @mkdir -p $(COSMOS_PROTO_TYPES)/base/v1beta1/
260
- @curl -sSL $(COSMOS_PROTO_URL)/base/v1beta1/coin.proto > $(COSMOS_PROTO_TYPES)/base/v1beta1/coin.proto
261
-
262
- @mkdir -p $(COSMOS_PROTO_TYPES)/base/query/v1beta1/
263
- @curl -sSL $(COSMOS_PROTO_URL)/base/query/v1beta1/pagination.proto > $(COSMOS_PROTO_TYPES)/base/query/v1beta1/pagination.proto
264
-
265
- .PHONY : proto-all proto-gen proto-lint proto-check-breaking proto-update-deps
266
156
267
157
# #######################################
268
158
# ## Testing
0 commit comments