mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-18 21:26:20 +00:00
proto: update proto generation to use buf (#7975)
* Hard-code go_package option for .proto files Signed-off-by: Thane Thomson <connect@thanethomson.com> * Automatically relocate generated ABCI types after proto-gen Signed-off-by: Thane Thomson <connect@thanethomson.com> * Skip building gogoproto (i.e. only build our types) Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unnecessary proto generation scripts Signed-off-by: Thane Thomson <connect@thanethomson.com> * Upgrade buf config from v1beta1 to v1 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add simple proto generation script Signed-off-by: Thane Thomson <connect@thanethomson.com> * Replace buf-based protobuf generation with simple protoc-based approach Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove custom buf-based Docker image generation config and Dockerfile Signed-off-by: Thane Thomson <connect@thanethomson.com> * Adopt Cosmos SDK's approach to Protobuf linting and breakage checking in CI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Suppress command echo when running proto checks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix proto-check workflow YAML indentation Signed-off-by: Thane Thomson <connect@thanethomson.com> * Restore proto-format target Signed-off-by: Thane Thomson <connect@thanethomson.com> * Replace custom BASH script with make equivalent Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove proto linting/breaking changes CI checks after discussion today Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove dangling reference to CI workflow that no longer exists Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update contributing guidelines relating to protos Signed-off-by: Thane Thomson <connect@thanethomson.com> * Use buf instead for generating protos Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unused buf config for gogoprotobuf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add reminder for if we migrate fully to buf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Restore protopackage script for #8065 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix permissions on protopackage script Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update contributing guidelines to show building of protos using buf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix breaking changes check and add disclaimer Signed-off-by: Thane Thomson <connect@thanethomson.com> * Expand on contributing guidelines for clarity Signed-off-by: Thane Thomson <connect@thanethomson.com> * Re-remove old proto workflows Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add buf-based proto linting workflow in CI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Superficially reorder proto targets Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix proto lints Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix GA workflow YAML indentation Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily use forked version of mlc Use forked version of markdown-link-check until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/126 lands. Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily disable markdown link checker Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove gogo protos - superseded by version from buf registry Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
# This Dockerfile defines an image containing tools for linting, formatting,
|
||||
# and compiling the Tendermint protos.
|
||||
FROM golang:1.17-alpine
|
||||
|
||||
# Install a commonly used set of programs for use with our protos.
|
||||
# clang-extra-tools is included here because it provides clang-format,
|
||||
# used to format the .proto files.
|
||||
RUN apk add --no-cache build-base clang-extra-tools curl git
|
||||
|
||||
ENV GOLANG_PROTOBUF_VERSION=1.3.1 \
|
||||
GOGO_PROTOBUF_VERSION=1.3.2
|
||||
|
||||
# Retrieve the go protoc programs and copy them into the PATH
|
||||
RUN go install github.com/golang/protobuf/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogo@v${GOGO_PROTOBUF_VERSION} && \
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogofaster@v${GOGO_PROTOBUF_VERSION} && \
|
||||
mv "$(go env GOPATH)"/bin/* /usr/local/bin/
|
||||
|
||||
# Copy the 'buf' program out of the buildbuf/buf container.
|
||||
COPY --from=bufbuild/buf:latest /usr/local/bin/* /usr/local/bin/
|
||||
@@ -0,0 +1,7 @@
|
||||
# Generated by buf. DO NOT EDIT.
|
||||
version: v1
|
||||
deps:
|
||||
- remote: buf.build
|
||||
owner: gogo
|
||||
repository: protobuf
|
||||
commit: 4df00b267f944190a229ce3695781e99
|
||||
@@ -0,0 +1,11 @@
|
||||
version: v1
|
||||
deps:
|
||||
- buf.build/gogo/protobuf
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
lint:
|
||||
use:
|
||||
- BASIC
|
||||
- FILE_LOWER_SNAKE_CASE
|
||||
- UNARY_RPC
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.blocksync;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/blocksync";
|
||||
|
||||
import "tendermint/types/block.proto";
|
||||
|
||||
// BlockRequest requests a block for a specific height
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.consensus;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
import "tendermint/libs/bits/types.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.consensus;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/consensus";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/consensus/types.proto";
|
||||
import "tendermint/types/events.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.crypto;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
// PublicKey defines the keys available for use with Tendermint Validators
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.crypto;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
message Proof {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.libs.bits;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits";
|
||||
|
||||
message BitArray {
|
||||
int64 bits = 1;
|
||||
repeated uint64 elems = 2;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.mempool;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/mempool";
|
||||
|
||||
message Txs {
|
||||
repeated bytes txs = 1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/crypto/keys.proto";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
message PexAddress {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.statesync;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/statesync";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
import "tendermint/types/params.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
import "tendermint/types/evidence.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
message EventDataRoundState {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "tendermint/types/types.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/types";
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "tendermint/crypto/keys.proto";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.version;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/tendermint/version";
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
// Consensus captures the consensus rules for processing a block in the
|
||||
|
||||
Reference in New Issue
Block a user