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

(WIP)feat: sdk-47 #174

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a60e149
feat: clean v1beta3
troian May 3, 2024
29696a3
feat: sdk-47
troian May 7, 2024
594933f
feat: set go package name to pkg.akt.dev/go
troian May 23, 2024
307d4c0
feat: add sdl parser
troian May 23, 2024
fd6d7d0
fix(go): set up tests for go modules
troian May 26, 2024
22a65d2
fix: match replace modules with upstream version of cosmos-sdk
troian May 26, 2024
4794505
fix: unify register of proto fixes for grpc reflection
troian May 26, 2024
6f127f0
chore: bump dependencies
troian May 26, 2024
717e7e2
chore: .gitignore go.work.sum
troian May 26, 2024
e1ae271
refactor: add cli rip off
troian Jun 27, 2024
197aeda
refactor(market): remove legacy events
troian Jul 9, 2024
01d2268
fix(market): use filter from v1beta5 api
troian Jul 9, 2024
3d9d1c3
fix: use gogoproto tag for old regen fork
troian Jul 10, 2024
d4521fc
feat: migrate params to dedicated stores
troian Jul 17, 2024
46650f2
fix(go/cli): split deposit detection
troian Jul 17, 2024
1c1756b
feat: allocate cli flags to own package
troian Jul 18, 2024
33adf70
feat(proto): put enums into messages
troian Jul 18, 2024
1cd13de
fix(go/client): ensure key name is set to tx factory after loaing fro…
troian Jul 18, 2024
32ebe3a
fix(go/cli): use flags from new flags module
troian Jul 18, 2024
daf2b4a
fix(go): bump cometbft and cosmos-sdk
troian Jul 18, 2024
424a9a8
refactor: use flags wrapper for test cli helpers
troian Jul 24, 2024
699c4b3
feat(cli): add trace flag
troian Aug 1, 2024
5311f5c
fix(sdk): move grpc reflection server to v1
troian Aug 1, 2024
08bcffa
fix(sdk): register v1beta3 deployment authorization for migration helper
troian Aug 1, 2024
244993d
fix(sdk): add provider store prefix
troian Aug 1, 2024
2151f9a
docs(sdk): add deprecation notice to params table
troian Aug 1, 2024
ed1112b
fix(sdk): make params keys public for take module
troian Aug 1, 2024
d33da45
fix(sdk): add agov params table for sdk 0.47 migration
troian Aug 1, 2024
1477532
fix(sdk): remove testutil network
troian Aug 1, 2024
3697080
refactor: fix lint issues for go and proto
troian Aug 1, 2024
2867d33
fix(sdk): set mod readonly for go tests
troian Aug 2, 2024
18e6e73
refactor(go): make cli package part of pkg.akt.dev/go
troian Aug 3, 2024
9ba85f0
fix: bump legacy akash-api version
troian Aug 5, 2024
cdc8630
refactor: run lint on go/cli
troian Aug 5, 2024
943e1a3
fix: pin gogoproto version
troian Aug 5, 2024
24b6f67
refactor: put go/cli into dedicated module
troian Aug 5, 2024
25b4a3e
feat: move migrations into dedicated module
troian Aug 6, 2024
5a55693
fix: remove legacy event parser
troian Aug 8, 2024
50bb74a
fix: make separate message for audit store
troian Aug 8, 2024
40f1706
fix: bump go package version
troian Aug 8, 2024
19fa682
fix(go/sdl): bump go package version
troian Aug 8, 2024
304e61e
fix(go/cli): bump go and sdl versions
troian Aug 8, 2024
c53d252
fix(go/migrate): bump go version
troian Aug 8, 2024
f0925c5
fix: deployment tests with updated audit types
troian Aug 8, 2024
b0665cf
fix(go/node/migrate): add exp replace
troian Aug 8, 2024
081f106
fix(script): print test module name
troian Aug 8, 2024
7f85866
feat: add make command to bump module version
troian Aug 9, 2024
7d3e39c
fix(go/sdl): bump go lib version
troian Aug 9, 2024
833578b
fix(go/cli): bump go and sdl versions
troian Aug 9, 2024
d37a995
fix(go/migrate): bump go lib version
troian Aug 9, 2024
f69d397
fix(script): shellscrip lint
troian Aug 9, 2024
f9f2644
fix: protogen split args check
troian Aug 9, 2024
c25abe6
feat: update ts codegen
troian Aug 9, 2024
5a0e572
fix(scripts): add legacy semver parser
troian Aug 23, 2024
48941fa
chore: bump tools versions
troian Aug 23, 2024
74cedf1
fix(scripts): arg check count for protocgen
troian Aug 23, 2024
b1bdbb4
fix(proto): doc generation
troian Aug 23, 2024
fdde415
fix: golang lint
troian Aug 23, 2024
c8b48a3
fix: go modules lint
troian Sep 3, 2024
dcf9143
feat: add client query utils
troian Sep 6, 2024
cadfb6d
fix(go/client): add legacy gov
troian Sep 6, 2024
7df231a
fix(go/sdkutil): pin uakt as default token
troian Sep 6, 2024
ca833df
fix(client/go): add generate only case
troian Sep 8, 2024
13f27c6
feat(go/cli): pull all cosmos-sdk commands into repo
troian Sep 8, 2024
a9ab9d7
refactor: run golintci
troian Sep 9, 2024
2b33a46
refactor(go): imports
troian Sep 9, 2024
310d99f
chore: bump api package for sdl
troian Sep 9, 2024
edcffe1
chore: bump min go version to v1.23.0
troian Sep 9, 2024
20a2fb6
chore(go/cli): bump api version
troian Sep 9, 2024
a6a363e
chore: run golangci-lint
troian Sep 9, 2024
a0f1570
chore: increase timeout for golangci-lint
troian Sep 9, 2024
79de572
chore: list direct-aux in help message
troian Sep 9, 2024
47faeed
feat(go/cli): add crisis tests
troian Sep 9, 2024
d823349
feat: adjust ts codegen to sdk-47
ygrishajev Sep 9, 2024
82869fd
feat: add cli tests
troian Sep 10, 2024
bcb2271
fix(go/cli): dist tests
troian Sep 10, 2024
9d45efc
chore: refactor gowork detection
troian Sep 10, 2024
d5ca789
feat: port canonical pubsub
troian Sep 30, 2024
000b748
feat: port canonical runner
troian Sep 30, 2024
1597538
chore: backport path parsers
troian Sep 30, 2024
be7df00
build(golangci): remove legacy codegen paths
troian Sep 30, 2024
0f825cc
fix(go/proto): register legacy deployment deposit message
troian Oct 28, 2024
459d52d
refactor: run go lint
troian Oct 28, 2024
99026dd
fix: set default gas mode to auto and adjustment to 1.5
troian Oct 28, 2024
cec29f5
refactor: import cosmos sdk server flags
troian Oct 29, 2024
5ed8e83
chore: bump go client
troian Oct 29, 2024
58879dd
chore: bump grpc
troian Oct 29, 2024
7fe522f
fix: disable gas auto for gentx cmd
troian Oct 29, 2024
1255814
fix(go): implement GetSignBytes for MsgDepositDeployment (#177)
troian Nov 15, 2024
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
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AKASH_TS_ROOT=${AKASH_ROOT}/ts
AKASH_TS_PACKAGE_FILE=${AKASH_TS_ROOT}/package.json
AKASH_TS_NODE_MODULES=${AKASH_TS_ROOT}/node_modules
AKASH_TS_NODE_BIN=${AKASH_TS_NODE_MODULES}/.bin
AKASH_DEVCACHE_TS_TMP=${AKASH_DEVCACHE_BASE}/tmp/ts
AKASH_DEVCACHE_TS_TMP_GRPC_JS=${AKASH_DEVCACHE_TS_TMP}/generated-grpc-js
AKASH_DEVCACHE_TS_TMP_PATCHES=${AKASH_DEVCACHE_TS_TMP}/patches
AKASH_DEVCACHE_TMP=${AKASH_DEVCACHE_BASE}/tmp
AKASH_DEVCACHE_TMP_TS=${AKASH_DEVCACHE_TMP}/ts
AKASH_DEVCACHE_TMP_TS_GRPC_JS=${AKASH_DEVCACHE_TMP_TS}/generated-grpc-js
AKASH_DEVCACHE_TMP_TS_PATCHES=${AKASH_DEVCACHE_TMP_TS}/patches
10 changes: 9 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ AKASH_ROOT=$(pwd)
export AKASH_ROOT

dotenv
dotenv_if_exists dev.env

TOOLS=${AKASH_ROOT}/script/tools.sh
SEMVER=${AKASH_ROOT}/script/semver.sh
Expand All @@ -19,6 +18,15 @@ fi

AKASH_DIRENV_SET=1

dotenv_if_exists dev.env

if [[ ${GOWORK} != "off" ]] && [[ -f go.work ]]; then
GOWORK=${AKASH_ROOT}/go.work
else
GOWORK=off
fi

export TOOLS
export SEMVER
export GOTOOLCHAIN
export GOTOOLCHAIN_SEMVER
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
vendor/

# Go workspace file
go.work
go.work*

# coverage
coverage.txt
Expand Down
9 changes: 3 additions & 6 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ issues:

# Skip generated k8s code
run:
skip-dirs:
- "^go/node/types/v1beta1"
- "^go/node/types/v1beta2"
- "^go/node/market/v1beta3"
skip-files:
exclude-dirs:
exclude-files:
- "\\.pb\\.go$"
- "\\.pb\\.gw\\.go$"
# Skip vendor/ etc
Expand All @@ -29,7 +26,7 @@ linters:
- staticcheck
- revive
- gosec
- exportloopref
- copyloopvar
- prealloc
linters-settings:
gocritic:
Expand Down
69 changes: 52 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
UNAME_OS := $(shell uname -s)
UNAME_ARCH := $(shell uname -m)
PROTO_LEGACY ?= true

ifeq (0, $(shell id -u))
$(warning "make was started with superuser privileges. it may cause issues with direnv")
Expand All @@ -24,23 +23,52 @@ ifeq (, $(GOTOOLCHAIN))
$(error "GOTOOLCHAIN is not set")
endif

ifeq ($(GO111MODULE),off)
else
GOMOD=readonly
endif

ifneq ($(GOWORK),off)
ifeq ($(shell test -e ${AKASH_ROOT}/go/go.work && echo -n yes),yes)
GOWORK=${AKASH_ROOT}/go/go.work
else
GOWORK=off
endif
endif

ifneq ($(GOWORK),off)
ifeq ($(GOMOD),$(filter $(GOMOD),mod ""))
$(error '-mod may only be set to readonly or vendor when in workspace mode, but it is set to ""')
endif
endif

ifeq ($(GOMOD),vendor)
ifneq ($(wildcard ./vendor/.),)
$(error "go -mod is in vendor mode but vendor dir has not been found. consider to run go mod vendor")
endif
endif

GO_ROOT := go
TS_ROOT := $(AKASH_TS_ROOT)

BUMP_MOD ?=

GO := GO111MODULE=$(GO111MODULE) go
GO_MOD_NAME := $(shell go list -m 2>/dev/null)

BUF_VERSION ?= 1.28.1
PROTOC_VERSION ?= 21.12
GOGOPROTO_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/gogoproto)
# TODO https://github.com/akash-network/support/issues/77
PROTOC_GEN_GOCOSMOS_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/regen-network/cosmos-proto)
PROTOC_GEN_GO_PULSAR_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/cosmos-proto)
PROTOC_GEN_GO_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' google.golang.org/protobuf)
PROTOC_GEN_GRPC_GATEWAY_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
PROTOC_GEN_DOC_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/pseudomuto/protoc-gen-doc)
GO_MOD_NAME := $(shell cd $(GO_ROOT); GOWORK=off go list -m 2>/dev/null)

BUF_VERSION ?= 1.38.0
PROTOC_VERSION ?= 26.1
GOGOPROTO_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/gogoproto)
PROTOC_GEN_GOCOSMOS_VERSION ?= $(GOGOPROTO_VERSION)
PROTOC_GEN_GO_PULSAR_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/cosmos/cosmos-proto)
PROTOC_GEN_GO_VERSION ?= $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' google.golang.org/protobuf)
PROTOC_GEN_GRPC_GATEWAY_VERSION := $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
PROTOC_GEN_DOC_VERSION := $(shell cd $(GO_ROOT); $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/pseudomuto/protoc-gen-doc)

PROTOC_GEN_SWAGGER_VERSION := $(PROTOC_GEN_GRPC_GATEWAY_VERSION)
MODVENDOR_VERSION ?= v0.5.0
MOCKERY_VERSION ?= 2.42.0
GOLANGCI_LINT_VERSION ?= v1.56.1
MOCKERY_VERSION ?= 2.45.0
GOLANGCI_LINT_VERSION ?= v1.60.3

BUF_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/buf/$(BUF_VERSION)
PROTOC_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/protoc/$(PROTOC_VERSION)
Expand All @@ -58,8 +86,8 @@ GOLANGCI_LINT_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/golangci-lint

BUF := $(AKASH_DEVCACHE_BIN)/buf
PROTOC := $(AKASH_DEVCACHE_BIN)/protoc
# TODO https://github.com/akash-network/support/issues/77
PROTOC_GEN_GOCOSMOS := $(AKASH_DEVCACHE_BIN)/legacy/protoc-gen-gocosmos
PROTOC_GEN_GOCOSMOS := $(AKASH_DEVCACHE_BIN)/protoc-gen-gocosmos
GOGOPROTO := $(AKASH_DEVCACHE_BIN)/gogoproto
PROTOC_GEN_GO_PULSAR := $(AKASH_DEVCACHE_BIN)/protoc-gen-go-pulsar
PROTOC_GEN_GO := $(AKASH_DEVCACHE_BIN)/protoc-gen-go
PROTOC_GEN_GRPC_GATEWAY := $(AKASH_DEVCACHE_BIN)/protoc-gen-grpc-gateway
Expand All @@ -72,11 +100,14 @@ MOCKERY := $(AKASH_DEVCACHE_BIN)/mockery
GOLANGCI_LINT := $(AKASH_DEVCACHE_BIN)/golangci-lint

GOLANGCI_LINT_RUN := $(GOLANGCI_LINT) run
GOLINT := $(GOLANGCI_LINT_RUN) ./... --disable-all --deadline=5m --enable
GOLINT := $(GOLANGCI_LINT_RUN) ./... --disable-all --deadline=10m --enable

DOCKER_RUN := docker run --rm -v $(shell pwd):/workspace -w /workspace
DOCKER_BUF := $(DOCKER_RUN) bufbuild/buf:$(BUF_VERSION)

GO_MODULES ?= $(shell find * -name go.mod -exec dirname {} \;)
GO_TEST_DIRS ?= ./...

include $(AKASH_ROOT)/make/setup-cache.mk
include $(AKASH_ROOT)/make/mod.mk
include $(AKASH_ROOT)/make/test.mk
Expand All @@ -85,6 +116,10 @@ include $(AKASH_ROOT)/make/lint.mk
include $(AKASH_ROOT)/make/release-ts.mk
include $(AKASH_ROOT)/make/code-style.mk

.PHONY: bump-%
bump-%:
@./script/tools.sh bump "$*" "$(BUMP_MOD)"

.PHONY: clean
clean:
rm -rf $(AKASH_DEVCACHE)
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions buf.gen.ts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: v1
plugins:
- name: ts
strategy: all
path: ./ts/node_modules/.bin/protoc-gen-ts_proto
out: ./ts/src/generated
opt: "esModuleInterop=true,forceLong=long,outputTypeRegistry=true,useExactTypes=false,outputIndex=true"
- name: grpc-gateway-ts
path: ./ts/node_modules/.bin/protoc-gen-ts_proto
out: ./.cache/tmp/ts/generated-grpc-js
opt: "esModuleInterop=true,forceLong=long,outputTypeRegistry=true,useExactTypes=false,outputServices=grpc-js"
2 changes: 0 additions & 2 deletions buf.work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ directories:
- proto/node
- proto/provider
- .cache/include
- vendor/github.com/cosmos/cosmos-sdk/proto
- vendor/github.com/cosmos/cosmos-sdk/third_party/proto
28 changes: 20 additions & 8 deletions docs/config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
---
swagger: '2.0'
info:
title: "AKASH - gRPC Gateway docs"
description: "A REST interface for state queries"
version: "1.0.0"
apis:
- url: "./.cache/tmp/swagger-gen/akash/audit/v1beta3/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/cert/v1beta3/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/deployment/v1beta3/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/deployment/v1beta3/service.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/market/v1beta3/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/market/v1beta3/service.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/provider/v1beta3/query.swagger.json"
- url: "./vendor/github.com/cosmos/cosmos-sdk/client/docs/swagger-ui/swagger.yaml"
- url: "./.cache/tmp/swagger-gen/akash/audit/v1/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/cert/v1/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/deployment/v1beta4/query.swagger.json"
operationIds:
rename:
Params: DeploymentParams
- url: "./.cache/tmp/swagger-gen/akash/deployment/v1beta4/service.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/market/v1beta5/query.swagger.json"
operationIds:
rename:
Params: MarketParams
- url: "./.cache/tmp/swagger-gen/akash/market/v1beta5/service.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/provider/v1beta4/query.swagger.json"
- url: "./.cache/tmp/swagger-gen/akash/take/v1/query.swagger.json"
operationIds:
rename:
Params: TakeParams
- url: "./.cache/tmp/swagger-gen/akash/take/v1/service.swagger.json"
- url: "./go/vendor/github.com/cosmos/cosmos-sdk/client/docs/swagger-ui/swagger.yaml"
dereference:
circular: "ignore"
Loading
Loading