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] Gateway module #374

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
# TODO_TECHDEBT: upgrade to the latest Ignite (the latest at the moment of creating a note is 0.28). Need to downgrade to fix CI pipelines. Might be done in scope of #240.
run: |
# curl https://get.ignite.com/cli! | bash
wget https://github.com/ignite/cli/releases/download/v0.27.2/ignite_0.27.2_linux_amd64.tar.gz
tar -xzf ignite_0.27.2_linux_amd64.tar.gz
wget https://github.com/ignite/cli/releases/download/v28.2.0/ignite_28.2.0_linux_amd64.tar.gz
tar -xzf ignite_28.2.0_linux_amd64.tar.gz
sudo mv ignite /usr/local/bin/ignite
ignite version

Expand All @@ -29,7 +29,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.10"
go-version: "1.21.6"

- name: Install CI dependencies
run: make install_ci_deps
Expand Down Expand Up @@ -103,11 +103,11 @@ jobs:
sparse-checkout: |
.github

- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: '${{ secrets.GKE_PROTOCOL_US_CENTRAL }}'
credentials_json: "${{ secrets.GKE_PROTOCOL_US_CENTRAL }}"

- uses: google-github-actions/get-gke-credentials@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
# TODO_TECHDEBT: upgrade to the latest Ignite (the latest at the moment of creating a note is 0.28). Need to downgrade to fix CI pipelines. Might be done in scope of #240.
run: |
# curl https://get.ignite.com/cli! | bash
wget https://github.com/ignite/cli/releases/download/v0.27.2/ignite_0.27.2_linux_amd64.tar.gz
tar -xzf ignite_0.27.2_linux_amd64.tar.gz
wget https://github.com/ignite/cli/releases/download/v28.2.0/ignite_28.2.0_linux_amd64.tar.gz
tar -xzf ignite_28.2.0_linux_amd64.tar.gz
sudo mv ignite /usr/local/bin/ignite
ignite version

Expand All @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.10"
go-version: "1.21.6"

- name: Install CI dependencies
run: make install_ci_deps
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Run `asdf plugin add golang` and `asdf install` to install the dependencies,
# and `asdf current` to switch to the versions of dependencies listed below
golang 1.20.10
go 1.20.10
golang 1.21.6
go 1.21.6
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This Dockerfile is used to build container image for development purposes.
# It intentionally contains no security features, ships with code and troubleshooting tools.

FROM golang:1.20 as base
FROM golang:1.21.6 as base

RUN apt update && \
apt-get install -y \
ca-certificates net-tools kubernetes-client \
curl jq make vim less dnsutils
ca-certificates net-tools kubernetes-client \
curl jq make vim less dnsutils

# enable faster module downloading.
ENV GOPROXY https://proxy.golang.org
Expand Down
43 changes: 27 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ POCKET_ADDR_PREFIX = pokt
####################

# TODO: Add other dependencies (ignite, docker, k8s, etc) here
# TODO(@okdas): bump `golangci-lint` when we upgrade golang to 1.21+
.PHONY: install_ci_deps
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@v1.53.3 && golangci-lint --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 @@ -51,8 +51,8 @@ check_go_version:
MAJOR_VERSION=$$(echo $$GO_VERSION | cut -d "." -f 1) && \
MINOR_VERSION=$$(echo $$GO_VERSION | cut -d "." -f 2) && \
\
if [ "$$MAJOR_VERSION" -ne 1 ] || [ "$$MINOR_VERSION" -ge 21 ] || [ "$$MINOR_VERSION" -le 18 ] ; then \
echo "Invalid Go version. Expected 1.19.x or 1.20.x but found $$GO_VERSION"; \
if [ "$$MAJOR_VERSION" -ne 1 ] || [ "$$MINOR_VERSION" -le 20 ] ; then \
echo "Invalid Go version. Expected 1.21.x or newer but found $$GO_VERSION"; \
exit 1; \
fi

Expand Down Expand Up @@ -165,16 +165,27 @@ localnet_up: ## Starts localnet
.PHONY: localnet_down
localnet_down: ## Delete resources created by localnet
tilt down
kubectl delete secret celestia-secret || exit 1

.PHONY: localnet_regenesis
localnet_regenesis: acc_initialize_pubkeys_warn_message ## Regenerate the localnet genesis file
# NOTE: intentionally not using --home <dir> flag to avoid overwriting the test keyring
ignite chain init
mkdir -p $(POKTROLLD_HOME)/config/
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/
# TODO_TECHDEBT: Currently the stake => power calculation is constant; however, cosmos-sdk
# intends to make this parameterizable in the future.
@echo "Initializing chain..."
@set -e ;\
ignite chain init ;\
mkdir -p $(POKTROLLD_HOME)/config/ ;\
cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME) ;\
cp ${HOME}/.poktroll/config/*_key.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) ;\
POWER=$$(yq -r ".validators[0].bonded" ./config.yml | sed 's,000000upokt,,') ;\
NAME=$$(yq -r ".validators[0].name" ./config.yml) ;\
echo "Regenerating genesis file with new validator..." ;\
jq --argjson pubKey "$$PUB_KEY" '.consensus["validators"]=[{"address": "'$$ADDRESS'", "pub_key": $$pubKey, "power": "'$$POWER'", "name": "'$$NAME'"}]' ${HOME}/.poktroll/config/genesis.json > temp.json ;\
mv temp.json ${HOME}/.poktroll/config/genesis.json ;\
cp ${HOME}/.poktroll/config/genesis.json $(POKTROLLD_HOME)/config/ ;\


# 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 @@ -226,12 +237,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/application/types/
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
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/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 @@ -252,7 +263,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
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ local_resource(
docker_build_with_restart(
"poktrolld",
".",
dockerfile_contents="""FROM golang:1.20.8
dockerfile_contents="""FROM golang:1.21.6
RUN apt-get -q update && apt-get install -qyy curl jq less
RUN go install github.com/go-delve/delve/cmd/dlv@latest
COPY bin/poktrolld /usr/local/bin/poktrolld
Expand Down
Loading
Loading