-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
1,142 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated by "buf config migrate-v1beta1". Edit as necessary, and | ||
# remove this comment when you're finished. | ||
# | ||
# This workspace file points to the roots found in your | ||
# previous "buf.yaml" configuration. | ||
version: v1 | ||
directories: | ||
- proto | ||
- thirdparty/proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Maintaining Cosmos SDK Proto Files | ||
|
||
All of the Cosmos SDK proto files are defined here. This folder should | ||
be synced regularly with buf.build/cosmos/cosmos-sdk regularly by | ||
a maintainer by running `buf push` in this folder. | ||
|
||
User facing documentation should not be placed here but instead goes in | ||
`buf.md` and in each protobuf package following the guidelines in | ||
https://docs.buf.build/bsr/documentation. | ||
|
||
## SDK x Buf | ||
|
||
| Cosmos SDK Version | Buf Commit Version | | ||
| ------------------ | ------------------------------------------------------------------------------------------------------------- | | ||
| Prior v0.46.0 | [Unavailable](https://github.com/bufbuild/buf/issues/1415) | | ||
| v0.46.x | [8cb30a2c4de74dc9bd8d260b1e75e176](https://buf.build/cosmos/cosmos-sdk/docs/8cb30a2c4de74dc9bd8d260b1e75e176) | | ||
| v0.47.x | [v0.47.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.47.0) | | ||
| Next | [latest on buf](https://buf.build/cosmos/cosmos-sdk/commits/main) | | ||
|
||
## Generate | ||
|
||
To get the Cosmos SDK proto given a commit, run: | ||
|
||
```bash | ||
buf export buf.build/cosmos/cosmos-sdk:${commit} --output . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: v1 | ||
plugins: | ||
- name: gocosmos | ||
out: .. | ||
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types | ||
- name: grpc-gateway | ||
out: .. | ||
opt: logtostderr=true,allow_colon_final_segments=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: v1 | ||
managed: | ||
enabled: true | ||
go_package_prefix: | ||
default: cosmossdk.io/api | ||
except: | ||
- buf.build/googleapis/googleapis | ||
- buf.build/cosmos/gogo-proto | ||
- buf.build/cosmos/cosmos-proto | ||
override: | ||
plugins: | ||
- name: go-pulsar | ||
out: ../api | ||
opt: paths=source_relative | ||
- name: go-grpc | ||
out: ../api | ||
opt: paths=source_relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: v1 | ||
plugins: | ||
- name: swagger | ||
out: ../tmp-swagger-gen | ||
opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: cosmos | ||
repository: cosmos-proto | ||
commit: 1935555c206d4afb9e94615dfd0fad31 | ||
- remote: buf.build | ||
owner: cosmos | ||
repository: gogo-proto | ||
commit: 34d970b699f84aa382f3c29773a60836 | ||
- remote: buf.build | ||
owner: googleapis | ||
repository: googleapis | ||
commit: 75b4300737fb4efca0831636be94e517 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Protobufs | ||
|
||
This is the public protocol buffers API for the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This module represents buf.build/cosmos/cosmos-sdk | ||
version: v1 | ||
name: buf.build/cosmos/cosmos-sdk | ||
deps: | ||
- buf.build/cosmos/cosmos-proto | ||
- buf.build/cosmos/gogo-proto | ||
- buf.build/googleapis/googleapis | ||
breaking: | ||
use: | ||
- FILE | ||
lint: | ||
use: | ||
- DEFAULT | ||
- COMMENTS | ||
- FILE_LOWER_SNAKE_CASE | ||
except: | ||
- UNARY_RPC | ||
- COMMENT_FIELD | ||
- SERVICE_SUFFIX | ||
- PACKAGE_VERSION_SUFFIX | ||
- RPC_REQUEST_STANDARD_NAME | ||
ignore: | ||
- tendermint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
mkdir -p ./tmp-swagger-gen | ||
cd proto | ||
proto_dirs=$(find ./cosmos -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) | ||
for dir in $proto_dirs; do | ||
# generate swagger files (filter query files) | ||
query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \)) | ||
if [[ ! -z "$query_file" ]]; then | ||
buf generate --template buf.gen.swagger.yaml $query_file | ||
fi | ||
done | ||
|
||
cd .. | ||
# combine swagger files | ||
# uses nodejs package `swagger-combine`. | ||
# all the individual swagger files need to be configured in `config.json` for merging | ||
swagger-combine ./client/docs/config.json -o ./client/docs/swagger-ui/swagger.yaml -f yaml --continueOnConflictingPaths true --includeDefinitions true | ||
|
||
# clean swagger files | ||
rm -rf ./tmp-swagger-gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# this script is for generating protobuf files for the new google.golang.org/protobuf API | ||
|
||
set -eo pipefail | ||
|
||
protoc_install_gopulsar() { | ||
go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
} | ||
|
||
protoc_install_gopulsar | ||
|
||
echo "Cleaning API directory" | ||
(cd api; find ./ -type f \( -iname \*.pulsar.go -o -iname \*.pb.go -o -iname \*.cosmos_orm.go -o -iname \*.pb.gw.go \) -delete; find . -empty -type d -delete; cd ..) | ||
|
||
echo "Generating API module" | ||
(cd proto; buf generate --template buf.gen.pulsar.yaml) | ||
|
||
echo "Generate Pulsar Test Data" | ||
(cd testutil/testdata; buf generate --template buf.gen.pulsar.yaml) |
Oops, something went wrong.