diff --git a/Makefile b/Makefile index ea0b3ca..4cba587 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ HTTPS_GIT := https://github.com/hyperledger/fabric-protos.git SSH_GIT := ssh://git@github.com/hyperledger/fabric-protos.git # This controls the version of buf to install and use. -BUF_VERSION := 1.30.1 +BUF_VERSION := 1.32.2 # If true, Buf is installed from source instead of from releases BUF_INSTALL_FROM_SOURCE := false diff --git a/Makefile.apiv1 b/Makefile.apiv1 index 6cb7829..5866ad7 100644 --- a/Makefile.apiv1 +++ b/Makefile.apiv1 @@ -25,7 +25,7 @@ HTTPS_GIT := https://github.com/hyperledger/fabric-protos.git SSH_GIT := ssh://git@github.com/hyperledger/fabric-protos.git # This controls the version of buf to install and use. -BUF_VERSION := 1.1.1 +BUF_VERSION := 1.32.2 # If true, Buf is installed from source instead of from releases BUF_INSTALL_FROM_SOURCE := false diff --git a/buf.gen-apiv1.yaml b/buf.gen-apiv1.yaml index a6e40ab..b1d8bc3 100644 --- a/buf.gen-apiv1.yaml +++ b/buf.gen-apiv1.yaml @@ -1,6 +1,6 @@ -version: v1 +version: v2 plugins: - - name: go + - local: protoc-gen-go out: bindings/go-apiv1 opt: - paths=source_relative diff --git a/buf.gen.yaml b/buf.gen.yaml index 0a21a6d..e9eea4e 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,74 +1,134 @@ -version: v1 +version: v2 managed: enabled: true - go_package_prefix: - default: github.com/hyperledger/fabric-protos-go-apiv2 - java_multiple_files: true - java_package_prefix: org.hyperledger.fabric.protos override: - JAVA_OUTER_CLASSNAME: - common/configtx.proto: ConfigTxProto - ledger/queryresult/kv_query_result.proto: KVQueryResultProto - ledger/rwset/kvrwset/kv_rwset.proto: KVRWSetProto - ledger/rwset/rwset.proto: RWSetProto - msp/msp_config.proto: MSPConfigProto - msp/msp_principal.proto: MSPPrincipalProto - JAVA_PACKAGE: - google/rpc/status.proto: com.google.rpc - ledger/queryresult/kv_query_result.proto: org.hyperledger.fabric.protos.ledger.queryresult - ledger/rwset/kvrwset/kv_rwset.proto: org.hyperledger.fabric.protos.ledger.rwset.kvrwset - ledger/rwset/rwset.proto: org.hyperledger.fabric.protos.ledger.rwset - msp/msp_principal.proto: org.hyperledger.fabric.protos.common - orderer/etcdraft/configuration.proto: org.hyperledger.fabric.protos.orderer.etcdraft - orderer/etcdraft/metadata.proto: org.hyperledger.fabric.protos.orderer.etcdraft - peer/lifecycle/chaincode_definition.proto: org.hyperledger.fabric.protos.peer.lifecycle - peer/lifecycle/db.proto: org.hyperledger.fabric.protos.peer.lifecycle - peer/lifecycle/lifecycle.proto: org.hyperledger.fabric.protos.peer.lifecycle - peer/chaincode_event.proto: org.hyperledger.fabric.protos.peer - peer/chaincode_shim.proto: org.hyperledger.fabric.protos.peer - peer/chaincode.proto: org.hyperledger.fabric.protos.peer - peer/collection.proto: org.hyperledger.fabric.protos.peer - peer/configuration.proto: org.hyperledger.fabric.protos.peer - peer/events.proto: org.hyperledger.fabric.protos.peer - peer/peer.proto: org.hyperledger.fabric.protos.peer - peer/policy.proto: org.hyperledger.fabric.protos.peer - peer/proposal_response.proto: org.hyperledger.fabric.protos.peer - peer/proposal.proto: org.hyperledger.fabric.protos.peer - peer/query.proto: org.hyperledger.fabric.protos.peer - peer/resources.proto: org.hyperledger.fabric.protos.peer - peer/signed_cc_dep_spec.proto: org.hyperledger.fabric.protos.peer - peer/snapshot.proto: org.hyperledger.fabric.protos.peer - peer/transaction.proto: org.hyperledger.fabric.protos.peer + - file_option: java_multiple_files + value: true + - file_option: java_package_prefix + value: org.hyperledger.fabric.protos + - file_option: go_package_prefix + value: github.com/hyperledger/fabric-protos-go-apiv2 + - file_option: java_outer_classname + path: common/configtx.proto + value: ConfigTxProto + - file_option: java_outer_classname + path: ledger/queryresult/kv_query_result.proto + value: KVQueryResultProto + - file_option: java_outer_classname + path: ledger/rwset/kvrwset/kv_rwset.proto + value: KVRWSetProto + - file_option: java_outer_classname + path: ledger/rwset/rwset.proto + value: RWSetProto + - file_option: java_outer_classname + path: msp/msp_config.proto + value: MSPConfigProto + - file_option: java_outer_classname + path: msp/msp_principal.proto + value: MSPPrincipalProto + - file_option: java_package + path: google/rpc/status.proto + value: com.google.rpc + - file_option: java_package + path: ledger/queryresult/kv_query_result.proto + value: org.hyperledger.fabric.protos.ledger.queryresult + - file_option: java_package + path: ledger/rwset/kvrwset/kv_rwset.proto + value: org.hyperledger.fabric.protos.ledger.rwset.kvrwset + - file_option: java_package + path: ledger/rwset/rwset.proto + value: org.hyperledger.fabric.protos.ledger.rwset + - file_option: java_package + path: msp/msp_principal.proto + value: org.hyperledger.fabric.protos.common + - file_option: java_package + path: orderer/etcdraft/configuration.proto + value: org.hyperledger.fabric.protos.orderer.etcdraft + - file_option: java_package + path: orderer/etcdraft/metadata.proto + value: org.hyperledger.fabric.protos.orderer.etcdraft + - file_option: java_package + path: peer/chaincode.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/chaincode_event.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/chaincode_shim.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/collection.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/configuration.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/events.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/lifecycle/chaincode_definition.proto + value: org.hyperledger.fabric.protos.peer.lifecycle + - file_option: java_package + path: peer/lifecycle/db.proto + value: org.hyperledger.fabric.protos.peer.lifecycle + - file_option: java_package + path: peer/lifecycle/lifecycle.proto + value: org.hyperledger.fabric.protos.peer.lifecycle + - file_option: java_package + path: peer/peer.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/policy.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/proposal.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/proposal_response.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/query.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/resources.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/signed_cc_dep_spec.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/snapshot.proto + value: org.hyperledger.fabric.protos.peer + - file_option: java_package + path: peer/transaction.proto + value: org.hyperledger.fabric.protos.peer plugins: - - name: doc + - local: protoc-gen-doc out: docs opt: - markdown - protos.md strategy: all - - name: go + - local: protoc-gen-go out: bindings/go-apiv2 opt: paths=source_relative - - name: go-grpc + - local: protoc-gen-go-grpc out: bindings/go-apiv2 opt: - paths=source_relative - require_unimplemented_servers=false - - name: java + - protoc_builtin: java out: bindings/java/src/main/java - - name: grpc-java + - local: protoc-gen-grpc-java out: bindings/java/src/main/java - - name: js + - protoc_builtin: js out: bindings/node/src opt: - import_style=commonjs - binary - - name: js-grpc - path: grpc_tools_node_protoc_plugin + - local: grpc_tools_node_protoc_plugin out: bindings/node/src - opt: - - grpc_js - - name: ts + opt: grpc_js + - local: protoc-gen-ts out: bindings/node/src opt: - service=grpc-node diff --git a/buf.yaml b/buf.yaml index 193c7ee..ae38fa4 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,11 +1,14 @@ -version: v1 -build: - excludes: - - bindings +version: v2 +modules: + - path: . + excludes: + - bindings lint: use: - DEFAULT except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE - PACKAGE_VERSION_SUFFIX ignore: - google @@ -123,12 +126,16 @@ lint: - gateway/gateway.proto - gossip/message.proto - orderer/ab.proto - - orderer/cluster.proto - orderer/blockattestation.proto + - orderer/cluster.proto - peer/chaincode_shim.proto - peer/events.proto - peer/peer.proto - peer/snapshot.proto + disallow_comment_ignores: true breaking: use: - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT