-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
103 lines (73 loc) · 2.74 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/make -f
DOCKER := $(shell which docker)
export GO111MODULE = on
###############################################################################
### e2e ###
###############################################################################
ictest-basic:
@echo "Running basic integration tests"
@cd interchaintest && go test -race -v -run TestBasicChain .
###############################################################################
### Docker ###
###############################################################################
get-heighliner:
git clone https://github.com/strangelove-ventures/heighliner.git
cd heighliner && go install
local-image:
ifeq (,$(shell which heighliner))
echo 'heighliner' binary not found. Consider running `make get-heighliner`
else
heighliner build -c rollchain --local -f chains.yaml --go-version 1.22.1
endif
###################
### Protobuf ####
###################
protoVer=0.13.2
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "Generating protobuf files..."
@$(protoImage) sh ./scripts/protocgen.sh
@go mod tidy
proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
proto-lint:
@$(protoImage) buf lint
.PHONY: proto-all proto-gen proto-format proto-lint
##################
### Linting ####
##################
golangci_lint_cmd=golangci-lint
golangci_version=v1.55.2
lint:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --timeout 15m
lint-fix:
@echo "--> Running linter and fixing issues"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
.PHONY: lint lint-fix
GO := go
TARGET := availd
BINDIR ?= $(GOPATH)/bin
.PHONY: all build install clean
all: build
build:
$(GO) build -o build/$(TARGET)
install: build
@echo "Installing build/$(TARGET) to $(BINDIR)"
@cp build/$(TARGET) $(BINDIR)
clean:
@echo "Cleaning up"
rm -f $(TARGET)
###############################################################################
### testnet ###
###############################################################################
# Run this before testnet keys are added
# chainid-1 is used in the testnet.json
set-testnet-configs:
availd config set client chain-id chainid-1
availd config set client keyring-backend test
availd config set client output text