diff --git a/Jenkinsfile b/Jenkinsfile index 8258d88eee..4743f14703 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -64,8 +64,9 @@ def buildStages() { env.GOROOT = "/opt/go/go" + props["GO_VER"] + ".linux." + "$MARCH" env.GOPATH = "$GOPATH/bin" env.PATH = "$GOROOT/bin:$GOPATH/bin:$PATH" - // Clone fabric repository + // Clone fabric repositories fabBuildLibrary.cloneScm('fabric', '$GERRIT_BRANCH') + fabBuildLibrary.cloneScm('fabric-protos', '$GERRIT_BRANCH') // Build fabric images fabBuildLibrary.fabBuildImages('fabric', 'docker') // Clone fabric-ca repository @@ -73,7 +74,7 @@ def buildStages() { // Build fabric-ca docker images fabBuildLibrary.fabBuildImages('fabric-ca', 'docker') // Pull Docker Images from nexus3 - fabBuildLibrary.pullDockerImages(props["FAB_BASE_VERSION"], props["FAB_IMAGES_LIST"]) + fabBuildLibrary.pullDockerImages(props["FAB_BASE_VERSION"], props["FAB_IMAGES_LIST"]) // Pull Thirdparty Docker Images from hyperledger DockerHub fabBuildLibrary.pullThirdPartyImages(props["FAB_BASEIMAGE_VERSION"], props["FAB_THIRDPARTY_IMAGES_LIST"]) } else { diff --git a/fabric-protos/bundle.json b/fabric-protos/bundle.json index 39fd24eacd..7e450a8a1b 100644 --- a/fabric-protos/bundle.json +++ b/fabric-protos/bundle.json @@ -51,641 +51,12 @@ ], "isNamespace": true }, - { - "name": "token", - "fields": [], - "syntax": "proto2", - "options": { - "go_package": "github.com/hyperledger/fabric/protos/token", - "java_package": "org.hyperledger.fabric.protos.token" - }, - "messages": [ - { - "name": "TokenTransaction", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenAction", - "name": "token_action", - "id": 1, - "oneof": "action" - } - ], - "oneofs": { - "action": [ - 1 - ] - } - }, - { - "name": "TokenAction", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "Issue", - "name": "issue", - "id": 1, - "oneof": "data" - }, - { - "rule": "optional", - "type": "Transfer", - "name": "transfer", - "id": 2, - "oneof": "data" - }, - { - "rule": "optional", - "type": "Transfer", - "name": "redeem", - "id": 3, - "oneof": "data" - } - ], - "oneofs": { - "data": [ - 1, - 2, - 3 - ] - } - }, - { - "name": "TokenOwner", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "Type", - "name": "type", - "id": 1 - }, - { - "rule": "optional", - "type": "bytes", - "name": "raw", - "id": 2 - } - ], - "enums": [ - { - "name": "Type", - "syntax": "proto3", - "values": [ - { - "name": "MSP_IDENTIFIER", - "id": 0 - } - ] - } - ] - }, - { - "name": "Issue", - "syntax": "proto3", - "fields": [ - { - "rule": "repeated", - "type": "Token", - "name": "outputs", - "id": 1 - } - ] - }, - { - "name": "Transfer", - "syntax": "proto3", - "fields": [ - { - "rule": "repeated", - "type": "TokenId", - "name": "inputs", - "id": 1 - }, - { - "rule": "repeated", - "type": "Token", - "name": "outputs", - "id": 2 - } - ] - }, - { - "name": "Token", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenOwner", - "name": "owner", - "id": 1 - }, - { - "rule": "optional", - "type": "string", - "name": "type", - "id": 2 - }, - { - "rule": "optional", - "type": "string", - "name": "quantity", - "id": 3 - } - ] - }, - { - "name": "TokenId", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "string", - "name": "tx_id", - "id": 1 - }, - { - "rule": "optional", - "type": "uint32", - "name": "index", - "id": 2 - } - ] - }, - { - "name": "TokenOperation", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenOperationAction", - "name": "Action", - "id": 1, - "oneof": "Operation" - } - ], - "oneofs": { - "Operation": [ - 1 - ] - } - }, - { - "name": "TokenOperationAction", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenActionTerms", - "name": "Issue", - "id": 1, - "oneof": "Payload" - }, - { - "rule": "optional", - "type": "TokenActionTerms", - "name": "Transfer", - "id": 2, - "oneof": "Payload" - } - ], - "oneofs": { - "Payload": [ - 1, - 2 - ] - } - }, - { - "name": "TokenActionTerms", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenOwner", - "name": "Sender", - "id": 1 - }, - { - "rule": "repeated", - "type": "Token", - "name": "Outputs", - "id": 2 - } - ] - }, - { - "name": "IssueRequest", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "credential", - "id": 1 - }, - { - "rule": "repeated", - "type": "Token", - "name": "tokens_to_issue", - "id": 2 - } - ] - }, - { - "name": "RecipientShare", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenOwner", - "name": "recipient", - "id": 1 - }, - { - "rule": "optional", - "type": "string", - "name": "quantity", - "id": 2 - } - ] - }, - { - "name": "TokenTransactions", - "syntax": "proto3", - "fields": [ - { - "rule": "repeated", - "type": "TokenTransaction", - "name": "txs", - "id": 1 - } - ] - }, - { - "name": "TransferRequest", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "credential", - "id": 1 - }, - { - "rule": "repeated", - "type": "TokenId", - "name": "token_ids", - "id": 2 - }, - { - "rule": "repeated", - "type": "RecipientShare", - "name": "shares", - "id": 3 - } - ] - }, - { - "name": "RedeemRequest", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "credential", - "id": 1 - }, - { - "rule": "repeated", - "type": "TokenId", - "name": "token_ids", - "id": 2 - }, - { - "rule": "optional", - "type": "string", - "name": "quantity", - "id": 3 - } - ] - }, - { - "name": "UnspentToken", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "TokenId", - "name": "id", - "id": 1 - }, - { - "rule": "optional", - "type": "string", - "name": "type", - "id": 2 - }, - { - "rule": "optional", - "type": "string", - "name": "quantity", - "id": 3 - } - ] - }, - { - "name": "UnspentTokens", - "syntax": "proto3", - "fields": [ - { - "rule": "repeated", - "type": "UnspentToken", - "name": "tokens", - "id": 1 - } - ] - }, - { - "name": "ListRequest", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "credential", - "id": 1 - } - ] - }, - { - "name": "TokenOperationRequest", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "credential", - "id": 1 - }, - { - "rule": "repeated", - "type": "TokenOperation", - "name": "operations", - "id": 2 - }, - { - "rule": "repeated", - "type": "TokenId", - "name": "token_ids", - "id": 3 - } - ] - }, - { - "name": "Header", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "google.protobuf.Timestamp", - "name": "timestamp", - "id": 1 - }, - { - "rule": "optional", - "type": "string", - "name": "channel_id", - "id": 2 - }, - { - "rule": "optional", - "type": "bytes", - "name": "nonce", - "id": 3 - }, - { - "rule": "optional", - "type": "bytes", - "name": "creator", - "id": 4 - }, - { - "rule": "optional", - "type": "bytes", - "name": "tls_cert_hash", - "id": 5 - } - ] - }, - { - "name": "Command", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "Header", - "name": "header", - "id": 1 - }, - { - "rule": "optional", - "type": "IssueRequest", - "name": "issue_request", - "id": 2, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "TransferRequest", - "name": "transfer_request", - "id": 3, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "ListRequest", - "name": "list_request", - "id": 4, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "RedeemRequest", - "name": "redeem_request", - "id": 5, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "TokenOperationRequest", - "name": "token_operation_request", - "id": 6, - "oneof": "payload" - } - ], - "oneofs": { - "payload": [ - 2, - 3, - 4, - 5, - 6 - ] - } - }, - { - "name": "SignedCommand", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "command", - "id": 1 - }, - { - "rule": "optional", - "type": "bytes", - "name": "signature", - "id": 2 - } - ] - }, - { - "name": "CommandResponseHeader", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "google.protobuf.Timestamp", - "name": "timestamp", - "id": 1 - }, - { - "rule": "optional", - "type": "bytes", - "name": "command_hash", - "id": 2 - }, - { - "rule": "optional", - "type": "bytes", - "name": "creator", - "id": 3 - } - ] - }, - { - "name": "Error", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "string", - "name": "message", - "id": 1 - }, - { - "rule": "optional", - "type": "bytes", - "name": "payload", - "id": 2 - } - ] - }, - { - "name": "CommandResponse", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "CommandResponseHeader", - "name": "header", - "id": 1 - }, - { - "rule": "optional", - "type": "Error", - "name": "err", - "id": 2, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "TokenTransaction", - "name": "token_transaction", - "id": 3, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "UnspentTokens", - "name": "unspent_tokens", - "id": 4, - "oneof": "payload" - }, - { - "rule": "optional", - "type": "TokenTransactions", - "name": "token_transactions", - "id": 5, - "oneof": "payload" - } - ], - "oneofs": { - "payload": [ - 2, - 3, - 4, - 5 - ] - } - }, - { - "name": "SignedCommandResponse", - "syntax": "proto3", - "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "response", - "id": 1 - }, - { - "rule": "optional", - "type": "bytes", - "name": "signature", - "id": 2 - } - ] - } - ], - "services": [ - { - "name": "Prover", - "options": {}, - "rpc": { - "ProcessCommand": { - "request": "SignedCommand", - "request_stream": false, - "response": "SignedCommandResponse", - "response_stream": false, - "options": {} - } - } - } - ], - "isNamespace": true - }, { "name": "kvrwset", "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset", + "go_package": "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset", "java_package": "org.hyperledger.fabric.protos.ledger.rwset.kvrwset" }, "messages": [ @@ -987,7 +358,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/ledger/rwset", + "go_package": "github.com/hyperledger/fabric-protos-go/ledger/rwset", "java_package": "org.hyperledger.fabric.protos.ledger.rwset" }, "messages": [ @@ -1131,7 +502,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/ledger/queryresult", + "go_package": "github.com/hyperledger/fabric-protos-go/ledger/queryresult", "java_package": "org.hyperledger.fabric.protos.ledger.queryresult" }, "messages": [ @@ -1197,7 +568,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/common", + "go_package": "github.com/hyperledger/fabric-protos-go/common", "java_package": "org.hyperledger.fabric.protos.common" }, "messages": [ @@ -2293,10 +1664,6 @@ { "name": "PEER_ADMIN_OPERATION", "id": 8 - }, - { - "name": "TOKEN_TRANSACTION", - "id": 9 } ] }, @@ -2334,7 +1701,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/transientstore", + "go_package": "github.com/hyperledger/fabric-protos-go/transientstore", "java_package": "org.hyperledger.fabric.protos.transientstore" }, "messages": [ @@ -2371,7 +1738,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/gossip" + "go_package": "github.com/hyperledger/fabric-protos-go/gossip" }, "messages": [ { @@ -3317,7 +2684,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/msp", + "go_package": "github.com/hyperledger/fabric-protos-go/msp", "java_package": "org.hyperledger.fabric.protos.msp", "java_outer_classname": "MspConfigPackage" }, @@ -3660,7 +3027,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/discovery" + "go_package": "github.com/hyperledger/fabric-protos-go/discovery" }, "messages": [ { @@ -4067,7 +3434,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/orderer", + "go_package": "github.com/hyperledger/fabric-protos-go/orderer", "java_package": "org.hyperledger.fabric.protos.orderer" }, "messages": [ @@ -4622,7 +3989,7 @@ "fields": [], "syntax": "proto2", "options": { - "go_package": "github.com/hyperledger/fabric/protos/orderer/etcdraft", + "go_package": "github.com/hyperledger/fabric-protos-go/orderer/etcdraft", "java_package": "org.hyperledger.fabric.protos.orderer.etcdraft" }, "messages": [ @@ -4762,7 +4129,7 @@ "options": { "java_package": "org.hyperledger.fabric.protos.peer", "java_outer_classname": "ProposalPackage", - "go_package": "github.com/hyperledger/fabric/protos/peer" + "go_package": "github.com/hyperledger/fabric-protos-go/peer" }, "messages": [ { @@ -5077,6 +4444,25 @@ } ] }, + { + "name": "BlockAndPrivateData", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Block", + "name": "block", + "id": 1 + }, + { + "rule": "map", + "type": "rwset.TxPvtReadWriteSet", + "keytype": "uint64", + "name": "private_data_map", + "id": 2 + } + ] + }, { "name": "DeliverResponse", "syntax": "proto3", @@ -5101,13 +4487,21 @@ "name": "filtered_block", "id": 3, "oneof": "Type" + }, + { + "rule": "optional", + "type": "BlockAndPrivateData", + "name": "block_and_private_data", + "id": 4, + "oneof": "Type" } ], "oneofs": { "Type": [ 1, 2, - 3 + 3, + 4 ] } }, @@ -5306,12 +4700,6 @@ "name": "ChaincodeHeaderExtension", "syntax": "proto3", "fields": [ - { - "rule": "optional", - "type": "bytes", - "name": "payload_visibility", - "id": 1 - }, { "rule": "optional", "type": "ChaincodeID", @@ -5366,12 +4754,6 @@ "type": "ChaincodeID", "name": "chaincode_id", "id": 4 - }, - { - "rule": "repeated", - "type": "token.TokenOperation", - "name": "token_operations", - "id": 5 } ] }, @@ -6239,6 +5621,13 @@ "response": "DeliverResponse", "response_stream": true, "options": {} + }, + "DeliverWithPrivateData": { + "request": "common.Envelope", + "request_stream": true, + "response": "DeliverResponse", + "response_stream": true, + "options": {} } } }, @@ -6277,7 +5666,7 @@ "syntax": "proto2", "options": { "java_package": "org.hyperledger.fabric.protos.peer.lifecycle", - "go_package": "github.com/hyperledger/fabric/protos/peer/lifecycle" + "go_package": "github.com/hyperledger/fabric-protos-go/peer/lifecycle" }, "messages": [ { @@ -6337,6 +5726,45 @@ "type": "string", "name": "label", "id": 2 + }, + { + "rule": "map", + "type": "References", + "keytype": "string", + "name": "references", + "id": 3 + } + ], + "messages": [ + { + "name": "References", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Chaincode", + "name": "chaincodes", + "id": 1 + } + ] + }, + { + "name": "Chaincode", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + } + ] } ] }, diff --git a/fabric-protos/package.json b/fabric-protos/package.json index 869914b1c4..3115651cbc 100644 --- a/fabric-protos/package.json +++ b/fabric-protos/package.json @@ -6,9 +6,10 @@ "main": "index.js", "scripts": { "update:clean": "rimraf bundle.json protos && mkdirp protos", - "update:copy": "cpx \"${GOPATH}/src/github.com/hyperledger/fabric/protos/**/*.proto\" protos", + "update:copy": "cpx \"${GOPATH}/src/github.com/hyperledger/fabric-protos/**/*.proto\" protos", + "update:cleanup": "sed -i .bak -e '/enum HeaderType {/,/}/ {/reserved/d;}' protos/common/common.proto && rm protos/common/common.proto.bak", "update:pbjs": "pbjs -t json -p google-protos -p protos $(find google-protos protos -name \"*.proto\" -type f) -o bundle.json", - "update": "npm run update:clean && npm run update:copy && npm run update:pbjs", + "update": "npm run update:clean && npm run update:copy && npm run update:cleanup && npm run update:pbjs", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/fabric-protos/protos/common/collection.proto b/fabric-protos/protos/common/collection.proto index 16e57b556d..77283d56d6 100644 --- a/fabric-protos/protos/common/collection.proto +++ b/fabric-protos/protos/common/collection.proto @@ -1,18 +1,16 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/policies.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; +import "common/policies.proto"; + // CollectionConfigPackage represents an array of CollectionConfig // messages; the extra struct is required because repeated oneof is // forbidden by the protobuf syntax diff --git a/fabric-protos/protos/common/common.proto b/fabric-protos/protos/common/common.proto index 5e7896f3ce..1caec3f860 100644 --- a/fabric-protos/protos/common/common.proto +++ b/fabric-protos/protos/common/common.proto @@ -1,28 +1,16 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; +import "google/protobuf/timestamp.proto"; + // These status codes are intended to resemble selected HTTP status codes enum Status { UNKNOWN = 0; @@ -37,10 +25,6 @@ enum Status { } enum HeaderType { - // Prevent removed tag re-use - // Uncomment after fabric-baseimage moves to 3.5.1 - // reserved 7; - // reserved "PEER_RESOURCE_UPDATE"; MESSAGE = 0; // Used for messages which are signed but opaque CONFIG = 1; // Used for messages which express the channel config @@ -50,7 +34,6 @@ enum HeaderType { DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install PEER_ADMIN_OPERATION = 8; // Used for invoking an administrative operation on a peer - TOKEN_TRANSACTION = 9; // Used to denote transactions that invoke token management operations } // This enum enlists indexes of the block metadata array @@ -66,7 +49,7 @@ enum BlockMetadataIndex { // LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index message LastConfig { - uint64 index = 1; + uint64 index = 1; } // Metadata is a common structure to be used to encode block metadata diff --git a/fabric-protos/protos/common/configtx.proto b/fabric-protos/protos/common/configtx.proto index 45528fa997..188848e65b 100644 --- a/fabric-protos/protos/common/configtx.proto +++ b/fabric-protos/protos/common/configtx.proto @@ -1,19 +1,17 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/common.proto"; -import "common/policies.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; +import "common/common.proto"; +import "common/policies.proto"; + // ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency // on previous configuration transactions. // diff --git a/fabric-protos/protos/common/configuration.proto b/fabric-protos/protos/common/configuration.proto index 2bdc8ab74b..a60d875423 100644 --- a/fabric-protos/protos/common/configuration.proto +++ b/fabric-protos/protos/common/configuration.proto @@ -1,22 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; @@ -79,11 +67,11 @@ message Consortium { // application networks to upgrade themselves independently (with the exception of any // new capabilities defined at the /Channel level). message Capabilities { - map capabilities = 1; + map capabilities = 1; } // Capability is an empty message for the time being. It is defined as a protobuf // message rather than a constant, so that we may extend capabilities with other fields // if the need arises in the future. For the time being, a capability being in the // capabilities map requires that that capability be supported. -message Capability { } \ No newline at end of file +message Capability { } diff --git a/fabric-protos/protos/common/ledger.proto b/fabric-protos/protos/common/ledger.proto index a9b99711c3..ee5b1ba7d5 100644 --- a/fabric-protos/protos/common/ledger.proto +++ b/fabric-protos/protos/common/ledger.proto @@ -1,21 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; @@ -26,5 +15,4 @@ message BlockchainInfo { uint64 height = 1; bytes currentBlockHash = 2; bytes previousBlockHash = 3; - } diff --git a/fabric-protos/protos/common/policies.proto b/fabric-protos/protos/common/policies.proto index cef1b8ea4b..8ac81d09f1 100644 --- a/fabric-protos/protos/common/policies.proto +++ b/fabric-protos/protos/common/policies.proto @@ -1,28 +1,16 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "msp/msp_principal.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/common"; +option go_package = "github.com/hyperledger/fabric-protos-go/common"; option java_package = "org.hyperledger.fabric.protos.common"; package common; +import "msp/msp_principal.proto"; + // Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support // multiple policy engines, this is typed as a oneof for now message Policy { diff --git a/fabric-protos/protos/discovery/protocol.proto b/fabric-protos/protos/discovery/protocol.proto index be8322f5da..8b73c25550 100644 --- a/fabric-protos/protos/discovery/protocol.proto +++ b/fabric-protos/protos/discovery/protocol.proto @@ -1,17 +1,16 @@ -// Copyright IBM Corp. All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 -// -syntax = "proto3"; -import "gossip/message.proto"; -import "msp/msp_config.proto"; -import "msp/identities.proto"; +syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/discovery" ; +option go_package = "github.com/hyperledger/fabric-protos-go/discovery" ; package discovery; +import "gossip/message.proto"; +import "msp/msp_config.proto"; + // Discovery defines a service that serves information about the fabric network // like which peers, orderers, chaincodes, etc. service Discovery { @@ -231,5 +230,3 @@ message Endpoint { string host = 1; uint32 port = 2; } - - diff --git a/fabric-protos/protos/gossip/message.proto b/fabric-protos/protos/gossip/message.proto index 7f7e823b95..d506e15434 100644 --- a/fabric-protos/protos/gossip/message.proto +++ b/fabric-protos/protos/gossip/message.proto @@ -1,10 +1,10 @@ -// Copyright IBM Corp. All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 -// + syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/gossip" ; +option go_package = "github.com/hyperledger/fabric-protos-go/gossip" ; package gossip; @@ -369,4 +369,4 @@ message Chaincode { string name = 1; string version = 2; bytes metadata = 3; -} \ No newline at end of file +} diff --git a/fabric-protos/protos/ledger/queryresult/kv_query_result.proto b/fabric-protos/protos/ledger/queryresult/kv_query_result.proto index 3b8d106586..77c6471950 100644 --- a/fabric-protos/protos/ledger/queryresult/kv_query_result.proto +++ b/fabric-protos/protos/ledger/queryresult/kv_query_result.proto @@ -1,24 +1,12 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package queryresult; -option go_package = "github.com/hyperledger/fabric/protos/ledger/queryresult"; +option go_package = "github.com/hyperledger/fabric-protos-go/ledger/queryresult"; option java_package = "org.hyperledger.fabric.protos.ledger.queryresult"; import "google/protobuf/timestamp.proto"; diff --git a/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto b/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto index d1c480e897..c4f855506f 100644 --- a/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto +++ b/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset"; +option go_package = "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset"; option java_package = "org.hyperledger.fabric.protos.ledger.rwset.kvrwset"; package kvrwset; diff --git a/fabric-protos/protos/ledger/rwset/rwset.proto b/fabric-protos/protos/ledger/rwset/rwset.proto index 7f7e6c7740..d9e29c5993 100644 --- a/fabric-protos/protos/ledger/rwset/rwset.proto +++ b/fabric-protos/protos/ledger/rwset/rwset.proto @@ -1,22 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/ledger/rwset"; +option go_package = "github.com/hyperledger/fabric-protos-go/ledger/rwset"; option java_package = "org.hyperledger.fabric.protos.ledger.rwset"; package rwset; diff --git a/fabric-protos/protos/msp/identities.proto b/fabric-protos/protos/msp/identities.proto index fef457c851..46453cf3b8 100644 --- a/fabric-protos/protos/msp/identities.proto +++ b/fabric-protos/protos/msp/identities.proto @@ -1,13 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/msp"; +option go_package = "github.com/hyperledger/fabric-protos-go/msp"; option java_package = "org.hyperledger.fabric.protos.msp"; package msp; @@ -16,7 +13,7 @@ package msp; // (with its MSP identifier) to be used // to serialize it and deserialize it message SerializedIdentity { - // The identifier of the associated membership service provider + // The identifier of the associated membership service provider string mspid = 1; // the Identity, serialized according to the rules of its MPS @@ -31,19 +28,19 @@ message SerializedIdemixIdentity { // nym_x is the X-component of the pseudonym elliptic curve point. // It is a []byte representation of an amcl.BIG // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. - bytes nym_x = 1; + bytes nym_x = 1; // nym_y is the Y-component of the pseudonym elliptic curve point. // It is a []byte representation of an amcl.BIG // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. - bytes nym_y = 2; + bytes nym_y = 2; // ou contains the organizational unit of the idemix identity - bytes ou = 3; + bytes ou = 3; // role contains the role of this identity (e.g., ADMIN or MEMBER) bytes role = 4; // proof contains the cryptographic evidence that this identity is valid bytes proof = 5; -} \ No newline at end of file +} diff --git a/fabric-protos/protos/msp/msp_config.proto b/fabric-protos/protos/msp/msp_config.proto index acedcaa533..c459e3da4f 100644 --- a/fabric-protos/protos/msp/msp_config.proto +++ b/fabric-protos/protos/msp/msp_config.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/msp"; +option go_package = "github.com/hyperledger/fabric-protos-go/msp"; option java_package = "org.hyperledger.fabric.protos.msp"; option java_outer_classname = "MspConfigPackage"; @@ -210,4 +208,4 @@ message FabricNodeOUs { // OU Identifier of the orderers FabricOUIdentifier orderer_ou_identifier = 5; -} \ No newline at end of file +} diff --git a/fabric-protos/protos/msp/msp_principal.proto b/fabric-protos/protos/msp/msp_principal.proto index c9300ff353..bb9521ac4b 100644 --- a/fabric-protos/protos/msp/msp_principal.proto +++ b/fabric-protos/protos/msp/msp_principal.proto @@ -1,28 +1,14 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/msp"; +option go_package = "github.com/hyperledger/fabric-protos-go/msp"; option java_package = "org.hyperledger.fabric.protos.common"; package common; - // msp_principal.proto contains proto messages defining the generalized // MSP notion of identity called an MSPPrincipal. It is used as part of // the chain configuration, in particular as the identity parameters to @@ -48,7 +34,6 @@ package common; // identity/certificate; this would mean that the Principal bytes // message message MSPPrincipal { - enum Classification { ROLE = 0; // Represents the one of the dedicated MSP roles, the // one of a member of MSP network, and the one of an @@ -106,7 +91,6 @@ message OrganizationUnit { // field of an MSPPrincipal when it aims to define one of the // two dedicated roles within an MSP: Admin and Members. message MSPRole { - // MSPIdentifier represents the identifier of the MSP this principal // refers to string msp_identifier = 1; @@ -122,26 +106,22 @@ message MSPRole { // MSPRoleType defines which of the available, pre-defined MSP-roles // an identiy should posess inside the MSP with identifier MSPidentifier MSPRoleType role = 2; - } // MSPIdentityAnonymity can be used to enforce an identity to be anonymous or nominal. message MSPIdentityAnonymity { - enum MSPIdentityAnonymityType { NOMINAL = 0; // Represents a nominal MSP Identity ANONYMOUS = 1; // Represents an anonymous MSP Identity } MSPIdentityAnonymityType anonymity_type = 1; - } // CombinedPrincipal governs the organization of the Principal // field of a policy principal when principal_classification has // indicated that a combined form of principals is required message CombinedPrincipal { - // Principals refer to combined principals repeated MSPPrincipal principals = 1; } diff --git a/fabric-protos/protos/orderer/ab.proto b/fabric-protos/protos/orderer/ab.proto index f274b08cb6..68c43e4de8 100644 --- a/fabric-protos/protos/orderer/ab.proto +++ b/fabric-protos/protos/orderer/ab.proto @@ -1,28 +1,16 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/common.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer"; option java_package = "org.hyperledger.fabric.protos.orderer"; package orderer; +import "common/common.proto"; + message BroadcastResponse { // Status code, which may be used to programatically respond to success/failure common.Status status = 1; diff --git a/fabric-protos/protos/orderer/cluster.proto b/fabric-protos/protos/orderer/cluster.proto index 71dae0a303..8ff94b3bb4 100644 --- a/fabric-protos/protos/orderer/cluster.proto +++ b/fabric-protos/protos/orderer/cluster.proto @@ -1,18 +1,16 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/common.proto"; - -option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer"; option java_package = "org.hyperledger.fabric.protos.orderer"; package orderer; +import "common/common.proto"; + // Cluster defines communication between cluster members. service Cluster { // Step passes an implementation-specific message to another cluster member. @@ -63,4 +61,4 @@ message SubmitResponse { common.Status status = 2; // Info string which may contain additional information about the returned status. string info = 3; -} \ No newline at end of file +} diff --git a/fabric-protos/protos/orderer/configuration.proto b/fabric-protos/protos/orderer/configuration.proto index 8a15e24a42..c6faded814 100644 --- a/fabric-protos/protos/orderer/configuration.proto +++ b/fabric-protos/protos/orderer/configuration.proto @@ -1,27 +1,14 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer"; option java_package = "org.hyperledger.fabric.protos.orderer"; package orderer; - // The orderer config is specified by the following convention: // For a configuration item with key "Key" // the encoded value is a a proto message of type "Key" diff --git a/fabric-protos/protos/orderer/etcdraft/configuration.proto b/fabric-protos/protos/orderer/etcdraft/configuration.proto index b3354a1d44..3ad6037b5b 100644 --- a/fabric-protos/protos/orderer/etcdraft/configuration.proto +++ b/fabric-protos/protos/orderer/etcdraft/configuration.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/orderer/etcdraft"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer/etcdraft"; option java_package = "org.hyperledger.fabric.protos.orderer.etcdraft"; package etcdraft; @@ -29,10 +27,10 @@ message Consenter { // Options to be specified for all the etcd/raft nodes. These can be modified on a // per-channel basis. message Options { - string tick_interval = 1; // time duration format, e.g. 500ms - uint32 election_tick = 2; - uint32 heartbeat_tick = 3; - uint32 max_inflight_blocks = 4; - // Take snapshot when cumulative data exceeds certain size in bytes. - uint32 snapshot_interval_size = 5; + string tick_interval = 1; // time duration format, e.g. 500ms + uint32 election_tick = 2; + uint32 heartbeat_tick = 3; + uint32 max_inflight_blocks = 4; + // Take snapshot when cumulative data exceeds certain size in bytes. + uint32 snapshot_interval_size = 5; } diff --git a/fabric-protos/protos/orderer/etcdraft/metadata.proto b/fabric-protos/protos/orderer/etcdraft/metadata.proto index 3b94fbf18e..0cf74a1c9d 100644 --- a/fabric-protos/protos/orderer/etcdraft/metadata.proto +++ b/fabric-protos/protos/orderer/etcdraft/metadata.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/orderer/etcdraft"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer/etcdraft"; option java_package = "org.hyperledger.fabric.protos.orderer.etcdraft"; package etcdraft; diff --git a/fabric-protos/protos/orderer/kafka.proto b/fabric-protos/protos/orderer/kafka.proto index 462d157ea0..f71a79edd2 100644 --- a/fabric-protos/protos/orderer/kafka.proto +++ b/fabric-protos/protos/orderer/kafka.proto @@ -1,22 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option go_package = "github.com/hyperledger/fabric-protos-go/orderer"; option java_package = "org.hyperledger.fabric.protos.orderer"; package orderer; diff --git a/fabric-protos/protos/peer/chaincode.proto b/fabric-protos/protos/peer/chaincode.proto index d8ab0d6ccd..0f2f37406d 100644 --- a/fabric-protos/protos/peer/chaincode.proto +++ b/fabric-protos/protos/peer/chaincode.proto @@ -1,25 +1,13 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -package protos; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; +package protos; //ChaincodeID contains the path as specified by the deploy transaction //that created it as well as the hashCode that is generated by the diff --git a/fabric-protos/protos/peer/chaincode_event.proto b/fabric-protos/protos/peer/chaincode_event.proto index 14a51f737f..41f75ea7d0 100644 --- a/fabric-protos/protos/peer/chaincode_event.proto +++ b/fabric-protos/protos/peer/chaincode_event.proto @@ -1,24 +1,14 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ syntax = "proto3"; -package protos; + option java_package = "org.hyperledger.fabric.protos.peer"; option java_outer_classname = "ChaincodeEventPackage"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; +package protos; //ChaincodeEvent is used for events and registrations that are specific to chaincode //string type - "chaincode" diff --git a/fabric-protos/protos/peer/chaincode_shim.proto b/fabric-protos/protos/peer/chaincode_shim.proto index f32ffffbe6..48afbdb35d 100644 --- a/fabric-protos/protos/peer/chaincode_shim.proto +++ b/fabric-protos/protos/peer/chaincode_shim.proto @@ -1,21 +1,19 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -package protos; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; + +package protos; + import "peer/chaincode_event.proto"; import "peer/proposal.proto"; import "google/protobuf/timestamp.proto"; - message ChaincodeMessage { - enum Type { UNDEFINED = 0; REGISTER = 1; @@ -64,8 +62,8 @@ message ChaincodeMessage { // is to be fetched from the ledger. If the collection is specified, the key // would be fetched from the collection (i.e., private state) message GetState { - string key = 1; - string collection = 2; + string key = 1; + string collection = 2; } message GetStateMetadata { @@ -78,9 +76,9 @@ message GetStateMetadata { // specified, the key and value would be written to the transaction's private // write set. message PutState { - string key = 1; - bytes value = 2; - string collection = 3; + string key = 1; + bytes value = 2; + string collection = 3; } message PutStateMetadata { @@ -94,8 +92,8 @@ message PutStateMetadata { // If the collection is specified, the key needs to be recorded in the // transaction's private write set as a delete operation. message DelState { - string key = 1; - string collection = 2; + string key = 1; + string collection = 2; } // GetStateByRange is the payload of a ChaincodeMessage. It contains a start key and @@ -103,10 +101,10 @@ message DelState { // the range query needs to be executed on the private data. The metadata hold // the byte representation of QueryMetadata. message GetStateByRange { - string startKey = 1; - string endKey = 2; - string collection = 3; - bytes metadata = 4; + string startKey = 1; + string endKey = 2; + string collection = 3; + bytes metadata = 4; } // GetQueryResult is the payload of a ChaincodeMessage. It contains a query @@ -114,36 +112,36 @@ message GetStateByRange { // If the collection is specified, the query needs to be executed on the // private data. The metadata hold the byte representation of QueryMetadata. message GetQueryResult { - string query = 1; - string collection = 2; - bytes metadata = 3; + string query = 1; + string collection = 2; + bytes metadata = 3; } // QueryMetadata is the metadata of a GetStateByRange and GetQueryResult. // It contains a pageSize which denotes the number of records to be fetched // and a bookmark. message QueryMetadata { - int32 pageSize = 1; - string bookmark = 2; + int32 pageSize = 1; + string bookmark = 2; } // GetHistoryForKey is the payload of a ChaincodeMessage. It contains a key // for which the historical values need to be retrieved. message GetHistoryForKey { - string key = 1; + string key = 1; } message QueryStateNext { - string id = 1; + string id = 1; } message QueryStateClose { - string id = 1; + string id = 1; } // QueryResultBytes hold the byte representation of a record returned by the peer. message QueryResultBytes { - bytes resultBytes = 1; + bytes resultBytes = 1; } // QueryResponse is returned by the peer as a result of a GetStateByRange, @@ -152,17 +150,17 @@ message QueryResultBytes { // the peer in has_more field, transaction id in id field, and a QueryResponseMetadata // in metadata field. message QueryResponse { - repeated QueryResultBytes results = 1; - bool has_more = 2; - string id = 3; - bytes metadata = 4; + repeated QueryResultBytes results = 1; + bool has_more = 2; + string id = 3; + bytes metadata = 4; } // QueryResponseMetadata is the metadata of a QueryResponse. It contains a count // which denotes the number of records fetched from the ledger and a bookmark. message QueryResponseMetadata { - int32 fetched_records_count = 1; - string bookmark = 2; + int32 fetched_records_count = 1; + string bookmark = 2; } message StateMetadata { @@ -177,8 +175,5 @@ message StateMetadataResult { // Interface that provides support to chaincode execution. ChaincodeContext // provides the context necessary for the server to respond appropriately. service ChaincodeSupport { - - rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage); - - + rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage); } diff --git a/fabric-protos/protos/peer/configuration.proto b/fabric-protos/protos/peer/configuration.proto index 4c201088de..e9b41bc801 100644 --- a/fabric-protos/protos/peer/configuration.proto +++ b/fabric-protos/protos/peer/configuration.proto @@ -1,23 +1,11 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; @@ -29,13 +17,8 @@ message AnchorPeers { // AnchorPeer message structure which provides information about anchor peer, it includes host name, // port number and peer certificate. message AnchorPeer { - - // DNS host name of the anchor peer - string host = 1; - - // The port number - int32 port = 2; - + string host = 1; // DNS host name of the anchor peer + int32 port = 2; // The port number } // APIResource represents an API resource in the peer whose ACL diff --git a/fabric-protos/protos/peer/events.proto b/fabric-protos/protos/peer/events.proto index 78f9d2f061..522189cd84 100644 --- a/fabric-protos/protos/peer/events.proto +++ b/fabric-protos/protos/peer/events.proto @@ -1,22 +1,20 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/common.proto"; -import "google/protobuf/timestamp.proto"; -import "peer/chaincode_event.proto"; -import "peer/transaction.proto"; - option java_package = "org.hyperledger.fabric.protos.peer"; option java_outer_classname = "EventsPackage"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; +import "common/common.proto"; +import "ledger/rwset/rwset.proto"; +import "peer/chaincode_event.proto"; +import "peer/transaction.proto"; + // FilteredBlock is a minimal set of information about a block message FilteredBlock { string channel_id = 1; @@ -47,24 +45,37 @@ message FilteredChaincodeAction { ChaincodeEvent chaincode_event = 1; } +// BlockAndPrivateData contains Block and a map from tx_seq_in_block to rwset.TxPvtReadWriteSet +message BlockAndPrivateData { + common.Block block = 1; + // map from tx_seq_in_block to rwset.TxPvtReadWriteSet + map private_data_map = 2; +} + // DeliverResponse message DeliverResponse { oneof Type { common.Status status = 1; common.Block block = 2; FilteredBlock filtered_block = 3; + BlockAndPrivateData block_and_private_data = 4; } } service Deliver { - // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with // Payload data as a marshaled orderer.SeekInfo message, // then a stream of block replies is received rpc Deliver (stream common.Envelope) returns (stream DeliverResponse) { } - // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with // Payload data as a marshaled orderer.SeekInfo message, // then a stream of **filtered** block replies is received rpc DeliverFiltered (stream common.Envelope) returns (stream DeliverResponse) { } + // DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block and private data replies is received + rpc DeliverWithPrivateData (stream common.Envelope) returns (stream DeliverResponse) { + } } diff --git a/fabric-protos/protos/peer/lifecycle/chaincode_definition.proto b/fabric-protos/protos/peer/lifecycle/chaincode_definition.proto index e2241d503a..bfe01fb840 100644 --- a/fabric-protos/protos/peer/lifecycle/chaincode_definition.proto +++ b/fabric-protos/protos/peer/lifecycle/chaincode_definition.proto @@ -1,15 +1,13 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -package lifecycle; - option java_package = "org.hyperledger.fabric.protos.peer.lifecycle"; -option go_package = "github.com/hyperledger/fabric/protos/peer/lifecycle"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer/lifecycle"; + +package lifecycle; // These protos are used for encoding chaincode definitions into the statedb // in general, it should not be necessary for clients to utilize them. @@ -17,16 +15,16 @@ option go_package = "github.com/hyperledger/fabric/protos/peer/lifecycle"; // ChaincodeEndorsementInfo is (most) everything the peer needs to know in order // to execute a chaincode message ChaincodeEndorsementInfo { - string version = 1; - bool init_required = 2; - string endorsement_plugin = 3; + string version = 1; + bool init_required = 2; + string endorsement_plugin = 3; } // ValidationInfo is (most) everything the peer needs to know in order // to validate a transaction message ChaincodeValidationInfo { - string validation_plugin = 1; - bytes validation_parameter = 2; + string validation_plugin = 1; + bytes validation_parameter = 2; } // The notable omission in this file is the collection configuration info. diff --git a/fabric-protos/protos/peer/lifecycle/db.proto b/fabric-protos/protos/peer/lifecycle/db.proto index b0b9f42d6d..9adb5d511c 100644 --- a/fabric-protos/protos/peer/lifecycle/db.proto +++ b/fabric-protos/protos/peer/lifecycle/db.proto @@ -1,15 +1,13 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -package lifecycle; - option java_package = "org.hyperledger.fabric.protos.peer.lifecycle"; -option go_package = "github.com/hyperledger/fabric/protos/peer/lifecycle"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer/lifecycle"; + +package lifecycle; // These protos are used for encoding data into the statedb // in general, it should not be necessary for clients to utilize them. diff --git a/fabric-protos/protos/peer/lifecycle/lifecycle.proto b/fabric-protos/protos/peer/lifecycle/lifecycle.proto index e7442dad4b..4e48e6877b 100644 --- a/fabric-protos/protos/peer/lifecycle/lifecycle.proto +++ b/fabric-protos/protos/peer/lifecycle/lifecycle.proto @@ -1,17 +1,15 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -import "common/collection.proto"; +option java_package = "org.hyperledger.fabric.protos.peer.lifecycle"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer/lifecycle"; package lifecycle; -option java_package = "org.hyperledger.fabric.protos.peer.lifecycle"; -option go_package = "github.com/hyperledger/fabric/protos/peer/lifecycle"; +import "common/collection.proto"; // InstallChaincodeArgs is the message used as the argument to // '_lifecycle.InstallChaincode'. @@ -37,6 +35,16 @@ message QueryInstalledChaincodeArgs { message QueryInstalledChaincodeResult { string package_id = 1; string label = 2; + map references = 3; + + message References { + repeated Chaincode chaincodes = 1; + } + + message Chaincode { + string name = 1; + string version = 2; + } } // GetInstalledChaincodePackageArgs is the message used as the argument to @@ -174,8 +182,7 @@ message QueryChaincodeDefinitionResult { // QueryChaincodeDefinitionsArgs is the message used as arguments to // `_lifecycle.QueryChaincodeDefinitions`. -message QueryChaincodeDefinitionsArgs { -} +message QueryChaincodeDefinitionsArgs { } // QueryChaincodeDefinitionsResult is the message returned by // `_lifecycle.QueryChaincodeDefinitions`. diff --git a/fabric-protos/protos/peer/peer.proto b/fabric-protos/protos/peer/peer.proto index c003cc13e1..396b74afbe 100644 --- a/fabric-protos/protos/peer/peer.proto +++ b/fabric-protos/protos/peer/peer.proto @@ -1,22 +1,11 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ syntax = "proto3"; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; @@ -24,5 +13,5 @@ import "peer/proposal.proto"; import "peer/proposal_response.proto"; service Endorser { - rpc ProcessProposal(SignedProposal) returns (ProposalResponse); + rpc ProcessProposal(SignedProposal) returns (ProposalResponse); } diff --git a/fabric-protos/protos/peer/policy.proto b/fabric-protos/protos/peer/policy.proto index 5ea74ad3b7..1f67451a38 100644 --- a/fabric-protos/protos/peer/policy.proto +++ b/fabric-protos/protos/peer/policy.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; option java_package = "org.hyperledger.fabric.protos.peer"; package protos; diff --git a/fabric-protos/protos/peer/proposal.proto b/fabric-protos/protos/peer/proposal.proto index c09bf65c36..a9459467e4 100644 --- a/fabric-protos/protos/peer/proposal.proto +++ b/fabric-protos/protos/peer/proposal.proto @@ -1,22 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; option java_package = "org.hyperledger.fabric.protos.peer"; option java_outer_classname = "ProposalPackage"; @@ -24,7 +12,6 @@ package protos; import "peer/chaincode.proto"; import "peer/proposal_response.proto"; -import "token/operations.proto"; /* The flow to get a generic transaction approved goes as follows: @@ -104,13 +91,13 @@ SignedTransaction // 4. Detect replay attacks; message SignedProposal { - // The bytes of Proposal - bytes proposal_bytes = 1; + // The bytes of Proposal + bytes proposal_bytes = 1; // Signaure over proposalBytes; this signature is to be verified against // the creator identity contained in the header of the Proposal message // marshaled as proposalBytes - bytes signature = 2; + bytes signature = 2; } // A Proposal is sent to an endorser for endorsement. The proposal contains: @@ -134,17 +121,17 @@ message SignedProposal { // submitting peer model. message Proposal { - // The header of the proposal. It is the bytes of the Header - bytes header = 1; + // The header of the proposal. It is the bytes of the Header + bytes header = 1; - // The payload of the proposal as defined by the type in the proposal - // header. - bytes payload = 2; + // The payload of the proposal as defined by the type in the proposal + // header. + bytes payload = 2; - // Optional extensions to the proposal. Its content depends on the Header's - // type field. For the type CHAINCODE, it might be the bytes of a - // ChaincodeAction message. - bytes extension = 3; + // Optional extensions to the proposal. Its content depends on the Header's + // type field. For the type CHAINCODE, it might be the bytes of a + // ChaincodeAction message. + bytes extension = 3; } //-------- the Chaincode Proposal ----------- @@ -217,21 +204,11 @@ SignedTransaction // chaincode to invoke and what should appear on the ledger. message ChaincodeHeaderExtension { - // The PayloadVisibility field controls to what extent the Proposal's payload - // (recall that for the type CHAINCODE, it is ChaincodeProposalPayload - // message) field will be visible in the final transaction and in the ledger. - // Ideally, it would be configurable, supporting at least 3 main visibility - // modes: - // 1. all bytes of the payload are visible; - // 2. only a hash of the payload is visible; - // 3. nothing is visible. - // Notice that the visibility function may be potentially part of the ESCC. - // In that case it overrides PayloadVisibility field. Finally notice that - // this field impacts the content of ProposalResponsePayload.proposalHash. - bytes payload_visibility = 1; - - // The ID of the chaincode to target. - ChaincodeID chaincode_id = 2; + reserved 1; + reserved "payload_visbility"; + + // The ID of the chaincode to target. + ChaincodeID chaincode_id = 2; } // ChaincodeProposalPayload is the Proposal's payload message to be used when @@ -239,41 +216,39 @@ message ChaincodeHeaderExtension { // invocation. message ChaincodeProposalPayload { - // Input contains the arguments for this invocation. If this invocation - // deploys a new chaincode, ESCC/VSCC are part of this field. - // This is usually a marshaled ChaincodeInvocationSpec - bytes input = 1; + // Input contains the arguments for this invocation. If this invocation + // deploys a new chaincode, ESCC/VSCC are part of this field. + // This is usually a marshaled ChaincodeInvocationSpec + bytes input = 1; - // TransientMap contains data (e.g. cryptographic material) that might be used - // to implement some form of application-level confidentiality. The contents - // of this field are supposed to always be omitted from the transaction and - // excluded from the ledger. - map TransientMap = 2; + // TransientMap contains data (e.g. cryptographic material) that might be used + // to implement some form of application-level confidentiality. The contents + // of this field are supposed to always be omitted from the transaction and + // excluded from the ledger. + map TransientMap = 2; } // ChaincodeAction contains the actions the events generated by the execution // of the chaincode. message ChaincodeAction { - - // This field contains the read set and the write set produced by the - // chaincode executing this invocation. - bytes results = 1; - - // This field contains the events generated by the chaincode executing this - // invocation. - bytes events = 2; - - // This field contains the result of executing this invocation. - Response response = 3; - - // This field contains the ChaincodeID of executing this invocation. Endorser - // will set it with the ChaincodeID called by endorser while simulating proposal. - // Committer will validate the version matching with latest chaincode version. - // Adding ChaincodeID to keep version opens up the possibility of multiple - // ChaincodeAction per transaction. - ChaincodeID chaincode_id = 4; - - // This field contains the token operations requests generated by the chaincode - // executing this invocation - repeated token.TokenOperation token_operations = 5; -} \ No newline at end of file + reserved 5; + reserved "token_operations"; + + // This field contains the read set and the write set produced by the + // chaincode executing this invocation. + bytes results = 1; + + // This field contains the events generated by the chaincode executing this + // invocation. + bytes events = 2; + + // This field contains the result of executing this invocation. + Response response = 3; + + // This field contains the ChaincodeID of executing this invocation. Endorser + // will set it with the ChaincodeID called by endorser while simulating proposal. + // Committer will validate the version matching with latest chaincode version. + // Adding ChaincodeID to keep version opens up the possibility of multiple + // ChaincodeAction per transaction. + ChaincodeID chaincode_id = 4; +} diff --git a/fabric-protos/protos/peer/proposal_response.proto b/fabric-protos/protos/peer/proposal_response.proto index 6cc84493b5..4a29e9e754 100644 --- a/fabric-protos/protos/peer/proposal_response.proto +++ b/fabric-protos/protos/peer/proposal_response.proto @@ -1,22 +1,10 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; option java_package = "org.hyperledger.fabric.protos.peer"; option java_outer_classname = "ProposalResponsePackage"; @@ -33,38 +21,36 @@ import "google/protobuf/timestamp.proto"; // endorsers agree on the same action and produce signature to that effect, a // transaction can be generated and sent for ordering. message ProposalResponse { + // Version indicates message protocol version + int32 version = 1; - // Version indicates message protocol version - int32 version = 1; - - // Timestamp is the time that the message - // was created as defined by the sender - google.protobuf.Timestamp timestamp = 2; + // Timestamp is the time that the message + // was created as defined by the sender + google.protobuf.Timestamp timestamp = 2; - // A response message indicating whether the - // endorsement of the action was successful - Response response = 4; + // A response message indicating whether the + // endorsement of the action was successful + Response response = 4; - // The payload of response. It is the bytes of ProposalResponsePayload - bytes payload = 5; + // The payload of response. It is the bytes of ProposalResponsePayload + bytes payload = 5; - // The endorsement of the proposal, basically - // the endorser's signature over the payload - Endorsement endorsement = 6; + // The endorsement of the proposal, basically + // the endorser's signature over the payload + Endorsement endorsement = 6; } // A response with a representation similar to an HTTP response that can // be used within another message. message Response { + // A status code that should follow the HTTP status codes. + int32 status = 1; - // A status code that should follow the HTTP status codes. - int32 status = 1; + // A message associated with the response code. + string message = 2; - // A message associated with the response code. - string message = 2; - - // A payload that can be used to include metadata with this response. - bytes payload = 3; + // A payload that can be used to include metadata with this response. + bytes payload = 3; } // ProposalResponsePayload is the payload of a proposal response. This message @@ -73,30 +59,19 @@ message Response { // representation of the proposal (proposalHash) and a representation of the // chaincode state changes and events inside the extension field. message ProposalResponsePayload { - - // Hash of the proposal that triggered this response. The hash is used to - // link a response with its proposal, both for bookeeping purposes on an - // asynchronous system and for security reasons (accountability, - // non-repudiation). The hash usually covers the entire Proposal message - // (byte-by-byte). However this implies that the hash can only be verified - // if the entire proposal message is available when ProposalResponsePayload is - // included in a transaction or stored in the ledger. For confidentiality - // reasons, with chaincodes it might be undesirable to store the proposal - // payload in the ledger. If the type is CHAINCODE, this is handled by - // separating the proposal's header and - // the payload: the header is always hashed in its entirety whereas the - // payload can either be hashed fully, or only its hash may be hashed, or - // nothing from the payload can be hashed. The PayloadVisibility field in the - // Header's extension controls to which extent the proposal payload is - // "visible" in the sense that was just explained. - bytes proposal_hash = 1; - - // Extension should be unmarshaled to a type-specific message. The type of - // the extension in any proposal response depends on the type of the proposal - // that the client selected when the proposal was initially sent out. In - // particular, this information is stored in the type field of a Header. For - // chaincode, it's a ChaincodeAction message - bytes extension = 2; + // Hash of the proposal that triggered this response. The hash is used to + // link a response with its proposal, both for bookeeping purposes on an + // asynchronous system and for security reasons (accountability, + // non-repudiation). The hash usually covers the entire Proposal message + // (byte-by-byte). + bytes proposal_hash = 1; + + // Extension should be unmarshaled to a type-specific message. The type of + // the extension in any proposal response depends on the type of the proposal + // that the client selected when the proposal was initially sent out. In + // particular, this information is stored in the type field of a Header. For + // chaincode, it's a ChaincodeAction message + bytes extension = 2; } // An endorsement is a signature of an endorser over a proposal response. By @@ -109,11 +84,10 @@ message ProposalResponsePayload { // expected to endorse a single proposal response/action (many endorsements // over a single proposal response) message Endorsement { + // Identity of the endorser (e.g. its certificate) + bytes endorser = 1; - // Identity of the endorser (e.g. its certificate) - bytes endorser = 1; - - // Signature of the payload included in ProposalResponse concatenated with - // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) - bytes signature = 2; + // Signature of the payload included in ProposalResponse concatenated with + // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) + bytes signature = 2; } diff --git a/fabric-protos/protos/peer/query.proto b/fabric-protos/protos/peer/query.proto index d934104f04..5c25abda9b 100644 --- a/fabric-protos/protos/peer/query.proto +++ b/fabric-protos/protos/peer/query.proto @@ -1,23 +1,11 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; diff --git a/fabric-protos/protos/peer/resources.proto b/fabric-protos/protos/peer/resources.proto index 697e91fdc8..be9bdd067e 100644 --- a/fabric-protos/protos/peer/resources.proto +++ b/fabric-protos/protos/peer/resources.proto @@ -1,13 +1,11 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; diff --git a/fabric-protos/protos/peer/signed_cc_dep_spec.proto b/fabric-protos/protos/peer/signed_cc_dep_spec.proto index 6ce49509ac..05f46892d3 100644 --- a/fabric-protos/protos/peer/signed_cc_dep_spec.proto +++ b/fabric-protos/protos/peer/signed_cc_dep_spec.proto @@ -1,22 +1,11 @@ -/* -Copyright IBM Corp. 2017 All Rights Reserved. +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ syntax = "proto3"; option java_package = "org.hyperledger.fabric.protos.peer"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; package protos; @@ -24,19 +13,18 @@ import "peer/proposal_response.proto"; // SignedChaincodeDeploymentSpec carries the CDS along with endorsements message SignedChaincodeDeploymentSpec { - - // This is the bytes of the ChaincodeDeploymentSpec - bytes chaincode_deployment_spec = 1; - - // This is the instantiation policy which is identical in structure - // to endorsement policy. This policy is checked by the VSCC at commit - // time on the instantiation (all peers will get the same policy as it - // will be part of the LSCC instantation record and will be part of the - // hash as well) - bytes instantiation_policy = 2; - - // The endorsements of the above deployment spec, the owner's signature over - // chaincode_deployment_spec and Endorsement.endorser. - repeated Endorsement owner_endorsements = 3; + // This is the bytes of the ChaincodeDeploymentSpec + bytes chaincode_deployment_spec = 1; + + // This is the instantiation policy which is identical in structure + // to endorsement policy. This policy is checked by the VSCC at commit + // time on the instantiation (all peers will get the same policy as it + // will be part of the LSCC instantation record and will be part of the + // hash as well) + bytes instantiation_policy = 2; + + // The endorsements of the above deployment spec, the owner's signature over + // chaincode_deployment_spec and Endorsement.endorser. + repeated Endorsement owner_endorsements = 3; } diff --git a/fabric-protos/protos/peer/transaction.proto b/fabric-protos/protos/peer/transaction.proto index 1561a99ce1..fdffba33a8 100644 --- a/fabric-protos/protos/peer/transaction.proto +++ b/fabric-protos/protos/peer/transaction.proto @@ -1,12 +1,10 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; -option go_package = "github.com/hyperledger/fabric/protos/peer"; +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; option java_package = "org.hyperledger.fabric.protos.peer"; option java_outer_classname = "TransactionPackage"; @@ -19,15 +17,14 @@ import "common/common.proto"; // (in the signature field) over the bytes of the transaction (in the // transactionBytes field). message SignedTransaction { - - // The bytes of the Transaction. NDD - bytes transaction_bytes = 1; - - // Signature of the transactionBytes The public key of the signature is in - // the header field of TransactionAction There might be multiple - // TransactionAction, so multiple headers, but there should be same - // transactor identity (cert) in all headers - bytes signature = 2; + // The bytes of the Transaction. NDD + bytes transaction_bytes = 1; + + // Signature of the transactionBytes The public key of the signature is in + // the header field of TransactionAction There might be multiple + // TransactionAction, so multiple headers, but there should be same + // transactor identity (cert) in all headers + bytes signature = 2; } // ProcessedTransaction wraps an Envelope that includes a transaction along with an indication @@ -58,21 +55,21 @@ message ProcessedTransaction { // to ensure that they are treated atomically. message Transaction { - // The payload is an array of TransactionAction. An array is necessary to - // accommodate multiple actions per transaction - repeated TransactionAction actions = 1; + // The payload is an array of TransactionAction. An array is necessary to + // accommodate multiple actions per transaction + repeated TransactionAction actions = 1; } // TransactionAction binds a proposal to its action. The type field in the // header dictates the type of action to be applied to the ledger. message TransactionAction { - // The header of the proposal action, which is the proposal header - bytes header = 1; + // The header of the proposal action, which is the proposal header + bytes header = 1; - // The payload of the action as defined by the type in the header For - // chaincode, it's the bytes of ChaincodeActionPayload - bytes payload = 2; + // The payload of the action as defined by the type in the header For + // chaincode, it's the bytes of ChaincodeActionPayload + bytes payload = 2; } //---------- Chaincode Transaction ------------ @@ -81,69 +78,67 @@ message TransactionAction { // payload when the Header's type is set to CHAINCODE. It carries the // chaincodeProposalPayload and an endorsed action to apply to the ledger. message ChaincodeActionPayload { - - // This field contains the bytes of the ChaincodeProposalPayload message from - // the original invocation (essentially the arguments) after the application - // of the visibility function. The main visibility modes are "full" (the - // entire ChaincodeProposalPayload message is included here), "hash" (only - // the hash of the ChaincodeProposalPayload message is included) or - // "nothing". This field will be used to check the consistency of - // ProposalResponsePayload.proposalHash. For the CHAINCODE type, - // ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || - // f(ChaincodeProposalPayload)) where f is the visibility function. - bytes chaincode_proposal_payload = 1; - - // The list of actions to apply to the ledger - ChaincodeEndorsedAction action = 2; + // This field contains the bytes of the ChaincodeProposalPayload message from + // the original invocation (essentially the arguments) after the application + // of the visibility function. The main visibility modes are "full" (the + // entire ChaincodeProposalPayload message is included here), "hash" (only + // the hash of the ChaincodeProposalPayload message is included) or + // "nothing". This field will be used to check the consistency of + // ProposalResponsePayload.proposalHash. For the CHAINCODE type, + // ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || + // f(ChaincodeProposalPayload)) where f is the visibility function. + bytes chaincode_proposal_payload = 1; + + // The list of actions to apply to the ledger + ChaincodeEndorsedAction action = 2; } // ChaincodeEndorsedAction carries information about the endorsement of a // specific proposal message ChaincodeEndorsedAction { - - // This is the bytes of the ProposalResponsePayload message signed by the - // endorsers. Recall that for the CHAINCODE type, the - // ProposalResponsePayload's extenstion field carries a ChaincodeAction - bytes proposal_response_payload = 1; - - // The endorsement of the proposal, basically the endorser's signature over - // proposalResponsePayload - repeated Endorsement endorsements = 2; + // This is the bytes of the ProposalResponsePayload message signed by the + // endorsers. Recall that for the CHAINCODE type, the + // ProposalResponsePayload's extenstion field carries a ChaincodeAction + bytes proposal_response_payload = 1; + + // The endorsement of the proposal, basically the endorser's signature over + // proposalResponsePayload + repeated Endorsement endorsements = 2; } enum TxValidationCode { - VALID = 0; - NIL_ENVELOPE = 1; - BAD_PAYLOAD = 2; - BAD_COMMON_HEADER = 3; - BAD_CREATOR_SIGNATURE = 4; - INVALID_ENDORSER_TRANSACTION = 5; - INVALID_CONFIG_TRANSACTION = 6; - UNSUPPORTED_TX_PAYLOAD = 7; - BAD_PROPOSAL_TXID = 8; - DUPLICATE_TXID = 9; - ENDORSEMENT_POLICY_FAILURE = 10; - MVCC_READ_CONFLICT = 11; - PHANTOM_READ_CONFLICT = 12; - UNKNOWN_TX_TYPE = 13; - TARGET_CHAIN_NOT_FOUND = 14; - MARSHAL_TX_ERROR = 15; - NIL_TXACTION = 16; - EXPIRED_CHAINCODE = 17; - CHAINCODE_VERSION_CONFLICT = 18; - BAD_HEADER_EXTENSION = 19; - BAD_CHANNEL_HEADER = 20; - BAD_RESPONSE_PAYLOAD = 21; - BAD_RWSET = 22; - ILLEGAL_WRITESET = 23; - INVALID_WRITESET = 24; - INVALID_CHAINCODE = 25; - NOT_VALIDATED = 254; - INVALID_OTHER_REASON = 255; + VALID = 0; + NIL_ENVELOPE = 1; + BAD_PAYLOAD = 2; + BAD_COMMON_HEADER = 3; + BAD_CREATOR_SIGNATURE = 4; + INVALID_ENDORSER_TRANSACTION = 5; + INVALID_CONFIG_TRANSACTION = 6; + UNSUPPORTED_TX_PAYLOAD = 7; + BAD_PROPOSAL_TXID = 8; + DUPLICATE_TXID = 9; + ENDORSEMENT_POLICY_FAILURE = 10; + MVCC_READ_CONFLICT = 11; + PHANTOM_READ_CONFLICT = 12; + UNKNOWN_TX_TYPE = 13; + TARGET_CHAIN_NOT_FOUND = 14; + MARSHAL_TX_ERROR = 15; + NIL_TXACTION = 16; + EXPIRED_CHAINCODE = 17; + CHAINCODE_VERSION_CONFLICT = 18; + BAD_HEADER_EXTENSION = 19; + BAD_CHANNEL_HEADER = 20; + BAD_RESPONSE_PAYLOAD = 21; + BAD_RWSET = 22; + ILLEGAL_WRITESET = 23; + INVALID_WRITESET = 24; + INVALID_CHAINCODE = 25; + NOT_VALIDATED = 254; + INVALID_OTHER_REASON = 255; } // Reserved entries in the key-level metadata map enum MetaDataKeys { - VALIDATION_PARAMETER = 0; - VALIDATION_PARAMETER_V2 = 1; + VALIDATION_PARAMETER = 0; + VALIDATION_PARAMETER_V2 = 1; } diff --git a/fabric-protos/protos/token/operations.proto b/fabric-protos/protos/token/operations.proto deleted file mode 100644 index a24c823845..0000000000 --- a/fabric-protos/protos/token/operations.proto +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -syntax = "proto3"; - -option go_package = "github.com/hyperledger/fabric/protos/token"; -option java_package = "org.hyperledger.fabric.protos.token"; - -package token; - -import "token/transaction.proto"; - -// TokenOperation describes a token operation -message TokenOperation { - oneof Operation { - // Action describes a class of token operation - TokenOperationAction Action = 1; - } -} - -// TokenOperationAction lists the available operations -message TokenOperationAction { - oneof Payload { - // Issue describes a token issue operation - TokenActionTerms Issue = 1; - // Transfer describes a token transfer operation - TokenActionTerms Transfer = 2; - } -} - -// TokenActionTerms describes the expected sender and outputs of a token operation -message TokenActionTerms { - // Sender is the party who should perform the operation - TokenOwner Sender = 1; - // Outputs contains the expected outputs - repeated Token Outputs = 2; -} - diff --git a/fabric-protos/protos/token/prover.proto b/fabric-protos/protos/token/prover.proto deleted file mode 100644 index 9572662d13..0000000000 --- a/fabric-protos/protos/token/prover.proto +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -syntax = "proto3"; - -option go_package = "github.com/hyperledger/fabric/protos/token"; -option java_package = "org.hyperledger.fabric.protos.token"; - -package token; - -import "google/protobuf/timestamp.proto"; -import "token/operations.proto"; -import "token/transaction.proto"; - - - -// IssueRequest is used to request token issuance -message IssueRequest { - // Credential contains information about the party who is requesting the operation - // the content of this field depends on the charateristic of the token manager system used. - bytes credential = 1; - - // TokensToIssue contains the information about the tokens to be issued - repeated Token tokens_to_issue = 2; -} - -// RecipientShare describes how much a recipient will receive in a token transfer -message RecipientShare { - // Recipient refers to the prospective owner of a transferred token - TokenOwner recipient = 1; - - // Quantity refers to the number of token units to be transferred to the recipient. - // It is encoded as a string whose prefix determines the actual conversion base. A prefix of - // ``0x'' or ``0X'' selects base 16; the ``0'' prefix selects base 8, and a - // ``0b'' or ``0B'' prefix selects base 2. Otherwise the selected base is 10. - string quantity = 2; -} - -// TokenTransactions is a container for token transactions -message TokenTransactions { - repeated TokenTransaction txs = 1; -} - -// TransferRequest is used to request token transfers -message TransferRequest { - // Credential is the public credential of the requestor of the transfer - // The content of this field depends on the characteristic of token manager system - bytes credential = 1; - - // TokenIds identifies the tokens to be transferred - repeated TokenId token_ids = 2; - - // Shares identify the prospective recipients and the quantity of tokens that each would receive - repeated RecipientShare shares = 3; -} - -// RedeemRequest is used to request token redemption -message RedeemRequest { - // Credential is the public credential of the requestor of the redemption - // The content of this field depends on the characteristic of token manager system - bytes credential = 1; - - // TokenIds identifies the tokens to be redeemed - repeated TokenId token_ids = 2; - - // Quantity refers to the number of units of a given token needs to be redeemed. - // It is encoded as a string whose prefix determines the actual conversion base. A prefix of - // ``0x'' or ``0X'' selects base 16; the ``0'' prefix selects base 8, and a - // ``0b'' or ``0B'' prefix selects base 2. Otherwise the selected base is 10. - string quantity = 3; -} - -// UnspentToken is used to specify a token returned by ListRequest -message UnspentToken { - // Id is used to uniquely identify the token in the ledger - TokenId id = 1; - - // Type is the type of the token - string type = 2; - - // Quantity represents the number of units of Type that this unspent token holds. - // It is formatted in decimal representation - string quantity = 3; -} - -// UnspentTokens is used to hold the output of ListRequest -message UnspentTokens { - // Tokens is an array of UnspentToken - repeated UnspentToken tokens = 1; -} - -// ListRequest is used to retrieve the unspent tokens belonging to the party holding Credential -message ListRequest { - // Credential refers to the public credential of the party whose unspent tokens is to be listed - bytes credential = 1; -} - -// TokenOperationRequest is used to ask the prover peer to perform a specific -// token operation using given token ids. In this way, the prover peer can assemble -// token transactions as requested by a chaincode. -message TokenOperationRequest { - // credential contains information for the party who is requesting the operation - // The content of this field depends on the characteristic of token manager system - bytes credential = 1; - - // operations contains the token operations to be performed - repeated TokenOperation operations = 2; - - // TokenIds are the token identifiers used for the operation. It is empty, - // in the case of an issue. It must not be empty for operations like transfer or redeem. - repeated TokenId token_ids = 3; -} - -// Header is a generic replay prevention and identity message to include in a signed command -message Header { - // Timestamp is the local time when the message was created - // by the sender - google.protobuf.Timestamp timestamp = 1; - - // ChannelId identifies the channel this message is meant for - string channel_id = 2; - - // Nonce is a sufficientley long random value - // used to ensure the request has enough entropy. - bytes nonce = 3; - - // Creator of the message. - // Typically, a marshaled msp.SerializedIdentity - bytes creator = 4; - - // TlsCertHash represents the hash of the client's TLS certificate - // when mutual TLS is enabled - bytes tls_cert_hash = 5; -} - - -// Command describes the type of operation that a client is requesting. -message Command { - // Header is the header of this command - Header header = 1; - - // Payload is the payload of this command. It can assume one of the following value - oneof payload { - IssueRequest issue_request = 2; - TransferRequest transfer_request = 3; - ListRequest list_request = 4; - RedeemRequest redeem_request = 5; - TokenOperationRequest token_operation_request = 6; - } -} - -// SignedCommand is a command that carries the signature of the command's creator. -message SignedCommand { - // Command is the serialised version of a Command message - bytes command = 1; - - // Signature is the signature over command - bytes signature = 2; -} - -message CommandResponseHeader { - // Timestamp is the time that the message - // was created as defined by the sender - google.protobuf.Timestamp timestamp = 1; - - // CommandHash is the hash computed on the concatenation of the SignedCommand's command and signature fields. - // If not specified differently, SHA256 is used - // The hash is used to link a response with its request, both for bookeeping purposes on an - // asynchronous system and for security reasons (accountability, non-repudiation) - bytes command_hash = 2; - - // Creator is the identity of the party creating this message - bytes creator = 3; -} - -// Error reports an application error -message Error { - // Message associated with this response. - string message = 1; - - // Payload that can be used to include metadata with this response. - bytes payload = 2; -} - -// A CommnandResponse is returned from a prover to the command submitter. -message CommandResponse { - // Header of the response. - CommandResponseHeader header = 1; - - // Payload of the response. - oneof payload { - Error err = 2; - TokenTransaction token_transaction = 3; - UnspentTokens unspent_tokens = 4; - TokenTransactions token_transactions = 5; - } -} - -// SignedCommandResponse is a signed command response -message SignedCommandResponse { - // Response is the serialised version of a CommandResponse message - bytes response = 1; - - // Signature is the signature over command - bytes signature = 2; -} - -// Prover provides support to clients for the creation of FabToken transactions, -// and to query the ledger. -service Prover { - // ProcessCommand processes the passed command ensuring proper access control. - // The returned response allows the client to understand if the - // operation was succeffully executed and if not, the response - // reports the reason of the failure. - rpc ProcessCommand(SignedCommand) returns (SignedCommandResponse); -} diff --git a/fabric-protos/protos/token/transaction.proto b/fabric-protos/protos/token/transaction.proto deleted file mode 100644 index 423b7bb235..0000000000 --- a/fabric-protos/protos/token/transaction.proto +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright IBM Corp. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -syntax = "proto3"; - -option go_package = "github.com/hyperledger/fabric/protos/token"; -option java_package = "org.hyperledger.fabric.protos.token"; - -package token; - -// ================ Existing Fabric Transaction structure =============== -// -//In Summary, Fabric supports the following transaction structure: -// -// Envelope -// |\_ Signature (signature on the common.Payload message -// | including the transaction by the creator -// | specified in the Payload.header) -// \_ Payload -// |\_ Header (1) (the header of the proposal that requested this -// | action; containing channel header, and -// | signature header) -// \_ Data (1) (serialised Transaction message) -// \_ Transaction -// \_ TransactionAction (1...n) -// |\_ Header (1) (the header of the proposal that -// | requested this action) -// \_ ChaincodeActionPayload (1) -// -// -// -// -// =============== Changes to Existing Fabric Transaction structure =============== -// For envelopes that carry FabToken transaction we still maintain the same structure -// such that the orderers functionality is not disturbed: -// -// Envelope -// |\_ Signature (signature on the Payload message including -// | the transaction by the creator - -// | specified in the Payload.header) -// \_ Payload -// |\_ Header (1) (the header of the proposal that requested -// | this action; containing -// | channel header, and signature header) -// \_ Data (1) (serialised Transaction message) -// \_ TokenTransaction (1) -// \_ action (1) (a oneof for the different types of transactions) - - - -// TokenTransaction governs the structure of Payload.data, when -// the transaction's envelope header indicates a transaction of type -// "Token" -message TokenTransaction { - // TokenAction carries the content of this transaction. - oneof action { - TokenAction token_action = 1; - } -} - -// TokenAction specifies the structure of the action that a token undertakes -message TokenAction { - // Data carries the action to be executed - oneof data { - - // An issue action - Issue issue = 1; - - // A transfer action - Transfer transfer = 2; - - // A redeem action - Transfer redeem = 3; - } -} - -// TokenOwner holds the identity of a token owner -message TokenOwner { - enum Type { - MSP_IDENTIFIER = 0; - // more types to come .... - // for example - // CHAINCODE_ID = 1; - // MSP_OWNER_IDENTIFIER = 2; - } - - // Type is the type of the identity of the token owner - Type type = 1; - - // Raw is the serialization of the identity - bytes raw = 2; -} - -// Issue specifies an issue of one or more tokens -message Issue { - - // Outputs are the newly issued tokens - repeated Token outputs = 1; -} - -// Transfer specifies a transfer of one or more tokens -message Transfer { - - // Inputs specify the identifiers in the ledger of the tokens to be transferred - repeated TokenId inputs = 1; - - // Outputs are the new tokens resulting from the transfer - repeated Token outputs = 2; -} - -// Token is the result of issue and transfer transactions -message Token { - - // Owner is the token owner - TokenOwner owner = 1; - - // Type is the type of the token - string type = 2; - - // Quantity is the number of units of Type carried in the token. - // It is encoded as a string containing a number in base 16. The string has prefix ``0x''. - string quantity = 3; -} - -// A TokenId identifies a token as a function of the identifier of the transaction (issue, transfer) -// that created it and its index in that transaction -message TokenId { - - // TxId is the transaction ID of the transaction that created the token - string tx_id = 1; - - // Index is the index of the token in the transaction that created it - uint32 index = 2; -} diff --git a/fabric-protos/protos/transientstore/transientstore.proto b/fabric-protos/protos/transientstore/transientstore.proto index 04089a2bd0..1b6d577ee2 100644 --- a/fabric-protos/protos/transientstore/transientstore.proto +++ b/fabric-protos/protos/transientstore/transientstore.proto @@ -1,25 +1,12 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; - package transientstore; -option go_package = "github.com/hyperledger/fabric/protos/transientstore"; +option go_package = "github.com/hyperledger/fabric-protos-go/transientstore"; option java_package = "org.hyperledger.fabric.protos.transientstore"; import "ledger/rwset/rwset.proto";