@@ -58,7 +58,7 @@ go_staticcheck: ## Run `go staticcheck` on all files in the current project
58
58
go_doc :
59
59
{ \
60
60
if command -v godoc > /dev/null; then \
61
- echo " Visit http://localhost:6060/pocket" ; \
61
+ echo " Visit http://localhost:6060/pkg/github.com/pokt-network/ pocket" ; \
62
62
godoc -http=localhost:6060 -goroot=${PWD} /..; \
63
63
else \
64
64
echo " Install with 'go install golang.org/x/tools/cmd/godoc@latest'" ; \
@@ -89,7 +89,7 @@ go_clean_deps: ## Runs `go mod tidy` && `go mod vendor`
89
89
90
90
.PHONY : go_lint
91
91
go_lint : # # Run all linters that are triggered by the CI pipeline
92
- golangci-lint run ./...
92
+ docker run -t --rm -v $( shell pwd) :/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run -v --timeout 2m
93
93
94
94
.PHONY : gofmt
95
95
gofmt : # # Format all the .go files in the project in place.
@@ -222,15 +222,15 @@ mockgen: clean_mocks ## Use `mockgen` to generate mocks used for testing purpose
222
222
$(eval modules_dir = "shared/modules")
223
223
go generate ./${modules_dir}
224
224
echo " Mocks generated in ${modules_dir} /mocks"
225
-
225
+
226
226
$(eval DIRS = p2p libp2p persistence)
227
227
for dir in $(DIRS); do \
228
228
echo "Processing $$dir mocks..."; \
229
229
find $$dir/types/mocks -type f ! -name "mocks.go" -exec rm {} \;; \
230
230
go generate ./${dir_name}/...; \
231
231
echo "$$dir mocks generated in $$dir/types/mocks"; \
232
232
done
233
-
233
+
234
234
# TODO(team): Tested locally with `protoc` version `libprotoc 3.19.4`. In the near future, only the Dockerfiles will be used to compile protos.
235
235
236
236
.PHONY : protogen_show
@@ -248,9 +248,10 @@ PROTOC_SHARED = $(PROTOC) -I=./shared
248
248
.PHONY : protogen_local
249
249
protogen_local : go_protoc-go-inject-tag # # Generate go structures for all of the protobufs
250
250
# Shared
251
- $(PROTOC ) -I=./shared/core/types/proto --go_out=./shared/core/types ./shared/core/types/proto/* .proto
252
- $(PROTOC ) -I=./shared/messaging/proto --go_out=./shared/messaging ./shared/messaging/proto/* .proto
253
- $(PROTOC ) -I=./shared/codec/proto --go_out=./shared/codec ./shared/codec/proto/* .proto
251
+ $(PROTOC ) -I=./shared/core/types/proto --go_out=./shared/core/types ./shared/core/types/proto/* .proto
252
+ $(PROTOC ) -I=./shared/modules/types/proto --go_out=./shared/modules/types ./shared/modules/types/proto/* .proto
253
+ $(PROTOC ) -I=./shared/messaging/proto --go_out=./shared/messaging ./shared/messaging/proto/* .proto
254
+ $(PROTOC ) -I=./shared/codec/proto --go_out=./shared/codec ./shared/codec/proto/* .proto
254
255
255
256
# Runtime
256
257
$(PROTOC) -I=./runtime/configs/types/proto --go_out=./runtime/configs/types ./runtime/configs/types/proto/*.proto
@@ -260,8 +261,6 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the
260
261
261
262
# Persistence
262
263
$(PROTOC_SHARED) -I=./persistence/indexer/proto --go_out=./persistence/indexer ./persistence/indexer/proto/*.proto
263
- $(PROTOC_SHARED) -I=./persistence/proto --go_out=./persistence/types ./persistence/proto/*.proto
264
- protoc-go-inject-tag -input="./persistence/types/*.pb.go"
265
264
266
265
# Utility
267
266
$(PROTOC_SHARED) -I=./utility/types/proto --go_out=./utility/types ./utility/types/proto/*.proto
@@ -305,6 +304,11 @@ generate_cli_commands_docs: ## (Re)generates the CLI commands docs (this is mean
305
304
cd app/client/cli/docgen && go run .
306
305
echo " CLI commands docs generated in ${cli_docs_dir} "
307
306
307
+ .PHONY : generate_node_state_machine_diagram
308
+ generate_node_state_machine_diagram : # # (Re)generates the Node State Machine diagram
309
+ go run ./state_machine/visualizer/main.go
310
+ echo " Node State Machine diagram generated in state_machine/docs/state-machine.diagram.md"
311
+
308
312
.PHONY : test_all
309
313
test_all : # # Run all go unit tests
310
314
go test -p 1 -count=1 ./...
@@ -411,9 +415,10 @@ benchmark_p2p_addrbook: ## Benchmark all P2P addr book related tests
411
415
# DEPRECATE - Code that should be removed in the future
412
416
# RESEARCH - A non-trivial action item that requires deep research and investigation being next steps can be taken
413
417
# DOCUMENT - A comment that involves the creation of a README or other documentation
418
+ # BUG - There is a known existing bug in this code
414
419
# DISCUSS_IN_THIS_COMMIT - SHOULD NEVER BE COMMITTED TO MASTER. It is a way for the reviewer of a PR to start / reply to a discussion.
415
420
# TODO_IN_THIS_COMMIT - SHOULD NEVER BE COMMITTED TO MASTER. It is a way to start the review process while non-critical changes are still in progress
416
- TODO_KEYWORDS = -e "TODO" -e "TECHDEBT" -e "IMPROVE" -e "DISCUSS" -e "INCOMPLETE" -e "INVESTIGATE" -e "CLEANUP" -e "HACK" -e "REFACTOR" -e "CONSIDERATION" -e "TODO_IN_THIS_COMMIT" -e "DISCUSS_IN_THIS_COMMIT" -e "CONSOLIDATE" -e "DEPRECATE" -e "ADDTEST" -e "RESEARCH"
421
+ TODO_KEYWORDS = -e "TODO" -e "TECHDEBT" -e "IMPROVE" -e "DISCUSS" -e "INCOMPLETE" -e "INVESTIGATE" -e "CLEANUP" -e "HACK" -e "REFACTOR" -e "CONSIDERATION" -e "TODO_IN_THIS_COMMIT" -e "DISCUSS_IN_THIS_COMMIT" -e "CONSOLIDATE" -e "DEPRECATE" -e "ADDTEST" -e "RESEARCH" -e "BUG"
417
422
418
423
# How do I use TODOs?
419
424
# 1. <KEYWORD>: <Description of follow up work>;
@@ -458,11 +463,11 @@ localnet_up: ## Starts up a k8s LocalNet with all necessary dependencies (tl;dr
458
463
459
464
.PHONY : localnet_client_debug
460
465
localnet_client_debug : # # Opens a `client debug` cli to interact with blockchain (e.g. change pacemaker mode, reset to genesis, etc). Though the node binary updates automatiacally on every code change (i.e. hot reloads), if client is already open you need to re-run this command to execute freshly compiled binary.
461
- kubectl exec -it deploy/pocket-v1-cli-client -- client debug
466
+ kubectl exec -it deploy/pocket-v1-cli-client --container pocket -- client debug
462
467
463
468
.PHONY : localnet_shell
464
469
localnet_shell : # # Opens a shell in the pod that has the `client` cli available. The binary updates automatically whenever the code changes (i.e. hot reloads).
465
- kubectl exec -it deploy/pocket-v1-cli-client -- /bin/bash
470
+ kubectl exec -it deploy/pocket-v1-cli-client --container pocket -- /bin/bash
466
471
467
472
.PHONY : localnet_logs_validators
468
473
localnet_logs_validators : # # Outputs logs from all validators
@@ -477,6 +482,11 @@ localnet_down: ## Stops LocalNet and cleans up dependencies (tl;dr `tilt down` +
477
482
tilt down --file=build/localnet/Tiltfile
478
483
kubectl delete pvc --ignore-not-found=true data-dependencies-postgresql-0
479
484
485
+ .PHONY : localnet_db_cli
486
+ localnet_db_cli : # # Open a CLI to the local containerized postgres instancedb_cli:
487
+ echo " View schema by running 'SELECT schema_name FROM information_schema.schemata;'"
488
+ kubectl exec -it services/dependencies-postgresql -- bash -c " psql postgresql://postgres:LocalNetPassword@localhost"
489
+
480
490
.PHONY : check_cross_module_imports
481
491
check_cross_module_imports : # # Lists cross-module imports
482
492
$(eval exclude_common=--exclude=Makefile --exclude-dir=shared --exclude-dir=app --exclude-dir=runtime)
@@ -497,3 +507,7 @@ check_cross_module_imports: ## Lists cross-module imports
497
507
echo " -----------------------"
498
508
echo " runtime:\n"
499
509
grep ${exclude_common} --exclude-dir=runtime -r " github.com/pokt-network/pocket/runtime" || echo " ✅ OK!"
510
+
511
+ .PHONY : send_local_tx
512
+ send_local_tx : # # A hardcoded send tx to make LocalNet debugging easier
513
+ go run app/client/* .go Account Send 00104055c00bed7c983a48aac7dc6335d7c607a7 00204737d2a165ebe4be3a7d5b0af905b0ea91d8 1000
0 commit comments