Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Migration Review - DO NOT MERGE] Base (isolated) #380

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ localnet/*/config/*.json
# Frontend utils
ts-client/

# Proto artifacts
**/*.pb.go
**/*.pb.gw.go

# Mock
**/*_mock.go

Expand Down
31 changes: 23 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ install_ci_deps: ## Installs `mockgen` and other go tools
go install "github.com/golang/mock/[email protected]" && mockgen --version
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && golangci-lint --version
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/mikefarah/yq/v4@latest

########################
### Makefile Helpers ###
Expand Down Expand Up @@ -140,6 +141,13 @@ proto_regen: ## Delete existing protobuf artifacts and regenerate them
find . \( -name "*.pb.go" -o -name "*.pb.gw.go" \) | xargs --no-run-if-empty rm
ignite generate proto-go --yes

.PHONY: proto_clean_pulsar
proto_clean_pulsar: ## TODO: explain...
@find ./ -name "*.go" | xargs --no-run-if-empty sed -i -E 's,(^[[:space:]_[:alnum:]]+"github.com/pokt-network/poktroll/api.+"),///\1,'
find ./ -name "*.pulsar.go" | xargs --no-run-if-empty rm
ignite generate proto-go --yes
find ./ -name "*.go" | xargs --no-run-if-empty sed -i -E 's,^///([[:space:]_[:alnum:]]+"github.com/pokt-network/poktroll/api.+"),\1,'

#######################
### Docker Helpers ###
#######################
Expand Down Expand Up @@ -173,6 +181,13 @@ localnet_regenesis: ## Regenerate the localnet genesis file
cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME)
cp ${HOME}/.poktroll/config/*_key.json $(POKTROLLD_HOME)/config/
cp ${HOME}/.poktroll/config/genesis.json $(POKTROLLD_HOME)/config/
ADDRESS=$$(jq -r '.address' $(POKTROLLD_HOME)/config/priv_validator_key.json); \
PUB_KEY=$$(jq -r '.pub_key' $(POKTROLLD_HOME)/config/priv_validator_key.json); \
# NB: Currently the stake => power calculation is constant; however, cosmos-sdk \
# intends to make this parameterizable in the future. \
POWER=$$(yq ".validators[0].bonded" ./config.yml | sed 's,000000upokt,,'); \
NAME=$$(yq ".validators[0].name" ./config.yml); \
jq --argjson pubKey "$$PUB_KEY" '.consensus["validators"]=[{"address": "'$$ADDRESS'", "pub_key": $$pubKey, "power": "'$$POWER'", "name": "'$$NAME'"}]' $(POKTROLLD_HOME)/config/genesis.json > temp.json && mv temp.json $(POKTROLLD_HOME)/config/genesis.json

# TODO_BLOCKER(@okdas): Figure out how to copy these over w/ a functional state.
# cp ${HOME}/.poktroll/config/app.toml $(POKTROLLD_HOME)/config/app.toml
Expand Down Expand Up @@ -224,12 +239,12 @@ itest: check_go_version ## Run tests iteratively (see usage for more)
.PHONY: go_mockgen
go_mockgen: ## Use `mockgen` to generate mocks used for testing purposes of all the modules.
find . -name "*_mock.go" | xargs --no-run-if-empty rm
go generate ./x/application/types/
go generate ./x/gateway/types/
go generate ./x/supplier/types/
go generate ./x/session/types/
go generate ./x/service/types/
go generate ./x/tokenomics/types/
# go generate ./x/application/types/
# go generate ./x/gateway/types/
# go generate ./x/supplier/types/
# go generate ./x/session/types/
# go generate ./x/service/types/
# go generate ./x/tokenomics/types/
go generate ./pkg/client/interface.go
go generate ./pkg/miner/interface.go
go generate ./pkg/relayer/interface.go
Expand All @@ -250,7 +265,7 @@ go_develop: proto_regen go_mockgen ## Generate protos and mocks
go_develop_and_test: go_develop go_test ## Generate protos, mocks and run all tests

.PHONY: load_test_simple
load_test_simple: ## Runs the simpliest load test through the whole stack (appgate -> relayminer -> anvil)
load_test_simple: ## Runs the simplest load test through the whole stack (appgate -> relayminer -> anvil)
k6 run load-testing/tests/appGateServerEtherium.js

#############
Expand Down Expand Up @@ -644,4 +659,4 @@ act_list: check_act ## List all github actions that can be executed locally with
act_reviewdog: check_act check_gh ## Run the reviewdog workflow locally like so: `GITHUB_TOKEN=$(gh auth token) make act_reviewdog`
$(eval CONTAINER_ARCH := $(shell make -s detect_arch))
@echo "Detected architecture: $(CONTAINER_ARCH)"
act -v -s GITHUB_TOKEN=$(GITHUB_TOKEN) -W .github/workflows/reviewdog.yml --container-architecture $(CONTAINER_ARCH)
act -v -s GITHUB_TOKEN=$(GITHUB_TOKEN) -W .github/workflows/reviewdog.yml --container-architecture $(CONTAINER_ARCH)
Loading