39
39
@go build -o build/ ${LDFLAGS} ./cmd/celestia
40
40
.PHONY : build
41
41
42
- # # build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB instead of Go's native one
42
+ # # build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB.
43
43
build-jemalloc : jemalloc
44
44
@echo " --> Building Celestia with jemalloc"
45
45
@go build -o build/ ${LDFLAGS} -tags jemalloc ./cmd/celestia
@@ -51,14 +51,14 @@ clean:
51
51
@rm -rf build/*
52
52
.PHONY : clean
53
53
54
- # # cover: generate to code coverage report.
54
+ # # cover: Generate code coverage report.
55
55
cover :
56
56
@echo " --> Generating Code Coverage"
57
57
@go install github.com/ory/go-acc@latest
58
58
@go-acc -o coverage.txt ` go list ./... | grep -v nodebuilder/tests` -- -v
59
59
.PHONY : cover
60
60
61
- # # deps: install dependencies.
61
+ # # deps: Install dependencies.
62
62
deps :
63
63
@echo " --> Installing Dependencies"
64
64
@go mod download
73
73
endif
74
74
.PHONY : install
75
75
76
- # # install-global: Install the celestia-node binary (only for systems that support GNU coreutils, i.e. Linux).
76
+ # # install-global: Install the celestia-node binary (only for systems that support GNU coreutils like Linux).
77
77
install-global :
78
78
@echo " --> Installing Celestia"
79
79
@install -v ./build/* -t ${PREFIX} /bin
@@ -109,7 +109,8 @@ install-key:
109
109
@go install ./cmd/cel-key
110
110
.PHONY : install-key
111
111
112
- # # fmt: Formats only *.go (excluding *.pb.go *pb_test.go). Runs `gofmt & goimports` internally.
112
+ # # fmt: Formats only *.go (excluding *.pb.go *pb_test.go).
113
+ # Runs `gofmt & goimports` internally.
113
114
fmt : sort-imports
114
115
@find . -name ' *.go' -type f -not -path " *.git*" -not -name ' *.pb.go' -not -name ' *pb_test.go' | xargs gofmt -w -s
115
116
@go mod tidy -compat=1.20
@@ -118,39 +119,40 @@ fmt: sort-imports
118
119
@markdownlint --fix --quiet --config .markdownlint.yaml .
119
120
.PHONY : fmt
120
121
121
- # # lint: Linting *.go files using golangci-lint. Look for .golangci.yml for the list of linters. Also lint *.md files using markdownlint.
122
+ # # lint: Lint *.go files with golangci-lint and *.md files with markdownlint.
123
+ # Look at .golangci.yml for the list of linters.
122
124
lint : lint-imports
123
125
@echo " --> Running linter"
124
126
@golangci-lint run
125
127
@markdownlint --config .markdownlint.yaml ' **/*.md'
126
128
@cfmt --m=120 ./...
127
129
.PHONY : lint
128
130
129
- # # test-unit: Running unit tests
131
+ # # test-unit: Run unit tests.
130
132
test-unit :
131
133
@echo " --> Running unit tests"
132
134
@go test $(VERBOSE ) -covermode=atomic -coverprofile=coverage.txt ` go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER )
133
135
.PHONY : test-unit
134
136
135
- # # test-unit-race: Running unit tests with data race detector
137
+ # # test-unit-race: Run unit tests with data race detector.
136
138
test-unit-race :
137
139
@echo " --> Running unit tests with data race detector"
138
140
@go test $(VERBOSE ) -race -covermode=atomic -coverprofile=coverage.txt ` go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER )
139
141
.PHONY : test-unit-race
140
142
141
- # # test-integration: Running / integration tests located in nodebuilder/tests
143
+ # # test-integration: Run integration tests located in nodebuilder/tests.
142
144
test-integration :
143
145
@echo " --> Running integrations tests $( VERBOSE) -tags=$( TAGS) $( INTEGRATION_RUN_LENGTH) "
144
146
@go test $(VERBOSE ) -tags=$(TAGS ) $(INTEGRATION_RUN_LENGTH ) ./nodebuilder/tests
145
147
.PHONY : test-integration
146
148
147
- # # test-integration-race: Running integration tests with data race detector located in node /tests
149
+ # # test-integration-race: Run integration tests with data race detector located in nodebuilder /tests.
148
150
test-integration-race :
149
151
@echo " --> Running integration tests with data race detector -tags=$( TAGS) "
150
152
@go test -race -tags=$(TAGS ) ./nodebuilder/tests
151
153
.PHONY : test-integration-race
152
154
153
- # # benchmark: Running all benchmarks
155
+ # # benchmark: Run all benchmarks.
154
156
benchmark :
155
157
@echo " --> Running benchmarks"
156
158
@go test -run=" none" -bench=. -benchtime=100x -benchmem ./...
@@ -173,14 +175,14 @@ pb-gen:
173
175
done ;
174
176
.PHONY : pb-gen
175
177
176
- # # openrpc-gen: Generate OpenRPC spec for Celestia-Node 's RPC api
178
+ # # openrpc-gen: Generate OpenRPC spec for celestia-node 's RPC API.
177
179
openrpc-gen :
178
180
@go run ${LDFLAGS} ./cmd/celestia docgen
179
181
.PHONY : openrpc-gen
180
182
181
183
# # lint-imports: Lint only Go imports.
182
- # # flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
183
184
lint-imports :
185
+ # flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
184
186
@echo "--> Running imports linter"
185
187
@for file in `find . -type f -name '*.go'`; \
186
188
do goimports-reviser -list-diff -set-exit-status -company-prefixes "github.com/celestiaorg" -project-name "github.com/celestiaorg/celestia-node" -output stdout $$file \
@@ -199,13 +201,13 @@ adr-gen:
199
201
@curl -sSL https://raw.githubusercontent.com/celestiaorg/.github/main/adr-template.md > docs/architecture/adr-$(NUM ) -$(TITLE ) .md
200
202
.PHONY : adr-gen
201
203
202
- # # telemetry-infra-up: launches local telemetry infrastructure. This includes grafana, jaeger, loki, pyroscope, and an otel-collector.
203
- # # you can access the grafana instance at localhost:3000 and login with admin:admin.
204
+ # # telemetry-infra-up: Launch local telemetry infra ( grafana, jaeger, loki, pyroscope, and otel-collector) .
205
+ # You can access the grafana instance at localhost:3000 and login with admin:admin.
204
206
telemetry-infra-up :
205
207
PWD=" ${DIR_FULLPATH} /docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml up
206
208
.PHONY : telemetry-infra-up
207
209
208
- # # telemetry-infra-down: tears the telemetry infrastructure down. The stores for grafana, prometheus, and loki will persist .
210
+ # # telemetry-infra-down: Tears the telemetry infra down. Persists the stores for grafana, prometheus, and loki.
209
211
telemetry-infra-down :
210
212
PWD=" ${DIR_FULLPATH} /docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml down
211
213
.PHONY : telemetry-infra-down
@@ -222,7 +224,8 @@ goreleaser-build:
222
224
goreleaser build --snapshot --clean --single-target
223
225
.PHONY : goreleaser-build
224
226
225
- # # goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml. This requires there be a git tag for the release in the local git history.
227
+ # # goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml.
228
+ # This requires there be a git tag for the release in the local git history.
226
229
goreleaser-release :
227
230
goreleaser release --clean --fail-fast --skip-publish
228
231
.PHONY : goreleaser-release
@@ -232,7 +235,7 @@ USER_ID = $(shell id -u)
232
235
HAS_JEMALLOC = $(shell test -f /usr/local/lib/libjemalloc.a && echo "jemalloc")
233
236
JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"
234
237
235
- # # jemalloc installs jemalloc allocator
238
+ # # jemalloc: Install jemalloc allocator.
236
239
jemalloc :
237
240
@if [ -z " $( HAS_JEMALLOC) " ] ; then \
238
241
mkdir -p /tmp/jemalloc-temp && cd /tmp/jemalloc-temp ; \
0 commit comments