diff --git a/.gitignore b/.gitignore index 962adebc5d..f47d260372 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,7 @@ fabric-network/OUTSTA* #fabric common items fabric-common/node_modules/* fabric-common/.nyc_output + +#fabric protos items +fabric-protos/node_modules/* +fabric-protos/.nyc_output diff --git a/build/tasks/eslint.js b/build/tasks/eslint.js index 579216fa6f..d5becafa0b 100644 --- a/build/tasks/eslint.js +++ b/build/tasks/eslint.js @@ -23,6 +23,7 @@ gulp.task('eslint', () => { '!node_modules/**', '!test/typescript/**/*.js', '!tmp/**', + '!fabric-protos/**', ]).pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); diff --git a/fabric-protos/bundle.json b/fabric-protos/bundle.json new file mode 100644 index 0000000000..3e351f21bd --- /dev/null +++ b/fabric-protos/bundle.json @@ -0,0 +1,7113 @@ +{ + "package": null, + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/idemix" + }, + "messages": [ + { + "name": "TokenTransaction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PlainTokenAction", + "name": "plain_action", + "id": 1, + "oneof": "action" + } + ], + "oneofs": { + "action": [ + 1 + ] + } + }, + { + "name": "PlainTokenAction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PlainImport", + "name": "plain_import", + "id": 1, + "oneof": "data" + }, + { + "rule": "optional", + "type": "PlainTransfer", + "name": "plain_transfer", + "id": 2, + "oneof": "data" + }, + { + "rule": "optional", + "type": "PlainTransfer", + "name": "plain_redeem", + "id": 3, + "oneof": "data" + }, + { + "rule": "optional", + "type": "PlainApprove", + "name": "plain_approve", + "id": 4, + "oneof": "data" + }, + { + "rule": "optional", + "type": "PlainTransferFrom", + "name": "plain_transfer_From", + "id": 5, + "oneof": "data" + } + ], + "oneofs": { + "data": [ + 1, + 2, + 3, + 4, + 5 + ] + } + }, + { + "name": "PlainImport", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "PlainOutput", + "name": "outputs", + "id": 1 + } + ] + }, + { + "name": "PlainTransfer", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "InputId", + "name": "inputs", + "id": 1 + }, + { + "rule": "repeated", + "type": "PlainOutput", + "name": "outputs", + "id": 2 + } + ] + }, + { + "name": "PlainApprove", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "InputId", + "name": "inputs", + "id": 1 + }, + { + "rule": "repeated", + "type": "PlainDelegatedOutput", + "name": "delegated_outputs", + "id": 2 + }, + { + "rule": "optional", + "type": "PlainOutput", + "name": "output", + "id": 3 + } + ] + }, + { + "name": "PlainTransferFrom", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "InputId", + "name": "inputs", + "id": 1 + }, + { + "rule": "repeated", + "type": "PlainOutput", + "name": "outputs", + "id": 2 + }, + { + "rule": "optional", + "type": "PlainDelegatedOutput", + "name": "delegated_output", + "id": 3 + } + ] + }, + { + "name": "PlainOutput", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "owner", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 3 + } + ] + }, + { + "name": "InputId", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "index", + "id": 2 + } + ] + }, + { + "name": "PlainDelegatedOutput", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "owner", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "delegatees", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "type", + "id": 3 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 4 + } + ] + }, + { + "name": "ECP", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "x", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "y", + "id": 2 + } + ] + }, + { + "name": "ECP2", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "xa", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "xb", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "ya", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "yb", + "id": 4 + } + ] + }, + { + "name": "IssuerPublicKey", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "string", + "name": "attribute_names", + "id": 1 + }, + { + "rule": "optional", + "type": "ECP", + "name": "h_sk", + "id": 2 + }, + { + "rule": "optional", + "type": "ECP", + "name": "h_rand", + "id": 3 + }, + { + "rule": "repeated", + "type": "ECP", + "name": "h_attrs", + "id": 4 + }, + { + "rule": "optional", + "type": "ECP2", + "name": "w", + "id": 5 + }, + { + "rule": "optional", + "type": "ECP", + "name": "bar_g1", + "id": 6 + }, + { + "rule": "optional", + "type": "ECP", + "name": "bar_g2", + "id": 7 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_c", + "id": 8 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s", + "id": 9 + }, + { + "rule": "optional", + "type": "bytes", + "name": "hash", + "id": 10 + } + ] + }, + { + "name": "IssuerKey", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "isk", + "id": 1 + }, + { + "rule": "optional", + "type": "IssuerPublicKey", + "name": "ipk", + "id": 2 + } + ] + }, + { + "name": "Credential", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ECP", + "name": "a", + "id": 1 + }, + { + "rule": "optional", + "type": "ECP", + "name": "b", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "e", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "s", + "id": 4 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "attrs", + "id": 5 + } + ] + }, + { + "name": "CredRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ECP", + "name": "nym", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "issuer_nonce", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_c", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s", + "id": 4 + } + ] + }, + { + "name": "Signature", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ECP", + "name": "a_prime", + "id": 1 + }, + { + "rule": "optional", + "type": "ECP", + "name": "a_bar", + "id": 2 + }, + { + "rule": "optional", + "type": "ECP", + "name": "b_prime", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_c", + "id": 4 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_sk", + "id": 5 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_e", + "id": 6 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_r2", + "id": 7 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_r3", + "id": 8 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_s_prime", + "id": 9 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "proof_s_attrs", + "id": 10 + }, + { + "rule": "optional", + "type": "bytes", + "name": "nonce", + "id": 11 + }, + { + "rule": "optional", + "type": "ECP", + "name": "nym", + "id": 12 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_r_nym", + "id": 13 + }, + { + "rule": "optional", + "type": "ECP2", + "name": "revocation_epoch_pk", + "id": 14 + }, + { + "rule": "optional", + "type": "bytes", + "name": "revocation_pk_sig", + "id": 15 + }, + { + "rule": "optional", + "type": "int64", + "name": "epoch", + "id": 16 + }, + { + "rule": "optional", + "type": "NonRevocationProof", + "name": "non_revocation_proof", + "id": 17 + } + ] + }, + { + "name": "NonRevocationProof", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "revocation_alg", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "non_revocation_proof", + "id": 2 + } + ] + }, + { + "name": "NymSignature", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "proof_c", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_sk", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof_s_r_nym", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "nonce", + "id": 4 + } + ] + }, + { + "name": "CredentialRevocationInformation", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int64", + "name": "epoch", + "id": 1 + }, + { + "rule": "optional", + "type": "ECP2", + "name": "epoch_pk", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "epoch_pk_sig", + "id": 3 + }, + { + "rule": "optional", + "type": "int32", + "name": "revocation_alg", + "id": 4 + }, + { + "rule": "optional", + "type": "bytes", + "name": "revocation_data", + "id": 5 + } + ] + }, + { + "name": "google", + "fields": [], + "syntax": "proto2", + "messages": [ + { + "name": "protobuf", + "fields": [], + "syntax": "proto2", + "options": { + "csharp_namespace": "Google.Protobuf.WellKnownTypes", + "cc_enable_arenas": true, + "java_package": "com.google.protobuf", + "java_outer_classname": "EmptyProto", + "java_multiple_files": true, + "java_generate_equals_and_hash": true, + "objc_class_prefix": "GPB", + "go_package": "github.com/golang/protobuf/ptypes/empty" + }, + "messages": [ + { + "name": "Timestamp", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int64", + "name": "seconds", + "id": 1 + }, + { + "rule": "optional", + "type": "int32", + "name": "nanos", + "id": 2 + } + ] + }, + { + "name": "Empty", + "syntax": "proto3", + "fields": [] + } + ], + "isNamespace": true + } + ], + "isNamespace": true + }, + { + "name": "protos", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/peer", + "java_package": "org.hyperledger.fabric.protos.peer", + "java_outer_classname": "AdminPackage" + }, + "messages": [ + { + "name": "TokenExpectation", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PlainExpectation", + "name": "plain_expectation", + "id": 1, + "oneof": "Expectation" + } + ], + "oneofs": { + "Expectation": [ + 1 + ] + } + }, + { + "name": "PlainExpectation", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PlainTokenExpectation", + "name": "import_expectation", + "id": 1, + "oneof": "payload" + }, + { + "rule": "optional", + "type": "PlainTokenExpectation", + "name": "transfer_expectation", + "id": 2, + "oneof": "payload" + } + ], + "oneofs": { + "payload": [ + 1, + 2 + ] + } + }, + { + "name": "PlainTokenExpectation", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "PlainOutput", + "name": "outputs", + "id": 1 + } + ] + }, + { + "name": "TokenToIssue", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "recipient", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 3 + } + ] + }, + { + "name": "RecipientTransferShare", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "recipient", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 2 + } + ] + }, + { + "name": "TokenOutput", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "id", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 3 + } + ] + }, + { + "name": "UnspentTokens", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "TokenOutput", + "name": "tokens", + "id": 1 + } + ] + }, + { + "name": "ListRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + } + ] + }, + { + "name": "ImportRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + }, + { + "rule": "repeated", + "type": "TokenToIssue", + "name": "tokens_to_issue", + "id": 2 + } + ] + }, + { + "name": "TransferRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "token_ids", + "id": 2 + }, + { + "rule": "repeated", + "type": "RecipientTransferShare", + "name": "shares", + "id": 3 + } + ] + }, + { + "name": "RedeemRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "token_ids", + "id": 2 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity_to_redeem", + "id": 3 + } + ] + }, + { + "name": "AllowanceRecipientShare", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "recipient", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "quantity", + "id": 2 + } + ] + }, + { + "name": "ApproveRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + }, + { + "rule": "repeated", + "type": "AllowanceRecipientShare", + "name": "allowance_shares", + "id": 2 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "token_ids", + "id": 3 + } + ] + }, + { + "name": "ExpectationRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "credential", + "id": 1 + }, + { + "rule": "optional", + "type": "TokenExpectation", + "name": "expectation", + "id": 2 + }, + { + "rule": "repeated", + "type": "bytes", + "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": "ImportRequest", + "name": "import_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": "ApproveRequest", + "name": "approve_request", + "id": 6, + "oneof": "payload" + }, + { + "rule": "optional", + "type": "TransferRequest", + "name": "transfer_from_request", + "id": 7, + "oneof": "payload" + }, + { + "rule": "optional", + "type": "ExpectationRequest", + "name": "expectation_request", + "id": 8, + "oneof": "payload" + } + ], + "oneofs": { + "payload": [ + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ] + } + }, + { + "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" + } + ], + "oneofs": { + "payload": [ + 2, + 3, + 4 + ] + } + }, + { + "name": "SignedCommandResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "response", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "ChaincodeEvent", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "chaincode_id", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "event_name", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 4 + } + ] + }, + { + "name": "ProposalResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "version", + "id": 1 + }, + { + "rule": "optional", + "type": "google.protobuf.Timestamp", + "name": "timestamp", + "id": 2 + }, + { + "rule": "optional", + "type": "Response", + "name": "response", + "id": 4 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 5 + }, + { + "rule": "optional", + "type": "Endorsement", + "name": "endorsement", + "id": 6 + } + ] + }, + { + "name": "Response", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "status", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "message", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 3 + } + ] + }, + { + "name": "ProposalResponsePayload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "proposal_hash", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "extension", + "id": 2 + } + ] + }, + { + "name": "Endorsement", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "endorser", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "SignedTransaction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "transaction_bytes", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "ProcessedTransaction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Envelope", + "name": "transactionEnvelope", + "id": 1 + }, + { + "rule": "optional", + "type": "int32", + "name": "validationCode", + "id": 2 + } + ] + }, + { + "name": "TokenEndorserTransaction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "TransactionAction", + "name": "transaction_action", + "id": 1 + }, + { + "rule": "optional", + "type": "TokenTransaction", + "name": "token_transaction", + "id": 2 + } + ] + }, + { + "name": "Transaction", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "TransactionAction", + "name": "actions", + "id": 1 + } + ] + }, + { + "name": "TransactionAction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 2 + } + ] + }, + { + "name": "ChaincodeActionPayload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "chaincode_proposal_payload", + "id": 1 + }, + { + "rule": "optional", + "type": "ChaincodeEndorsedAction", + "name": "action", + "id": 2 + } + ] + }, + { + "name": "ChaincodeEndorsedAction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "proposal_response_payload", + "id": 1 + }, + { + "rule": "repeated", + "type": "Endorsement", + "name": "endorsements", + "id": 2 + } + ] + }, + { + "name": "FilteredBlock", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel_id", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "number", + "id": 2 + }, + { + "rule": "repeated", + "type": "FilteredTransaction", + "name": "filtered_transactions", + "id": 4 + } + ] + }, + { + "name": "FilteredTransaction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "txid", + "id": 1 + }, + { + "rule": "optional", + "type": "common.HeaderType", + "name": "type", + "id": 2 + }, + { + "rule": "optional", + "type": "TxValidationCode", + "name": "tx_validation_code", + "id": 3 + }, + { + "rule": "optional", + "type": "FilteredTransactionActions", + "name": "transaction_actions", + "id": 4, + "oneof": "Data" + } + ], + "oneofs": { + "Data": [ + 4 + ] + } + }, + { + "name": "FilteredTransactionActions", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "FilteredChaincodeAction", + "name": "chaincode_actions", + "id": 1 + } + ] + }, + { + "name": "FilteredChaincodeAction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ChaincodeEvent", + "name": "chaincode_event", + "id": 1 + } + ] + }, + { + "name": "DeliverResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Status", + "name": "status", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "common.Block", + "name": "block", + "id": 2, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "FilteredBlock", + "name": "filtered_block", + "id": 3, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2, + 3 + ] + } + }, + { + "name": "ChaincodeID", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "path", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 3 + } + ] + }, + { + "name": "ChaincodeInput", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "bytes", + "name": "args", + "id": 1 + }, + { + "rule": "map", + "type": "bytes", + "keytype": "string", + "name": "decorations", + "id": 2 + } + ] + }, + { + "name": "ChaincodeSpec", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Type", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "ChaincodeID", + "name": "chaincode_id", + "id": 2 + }, + { + "rule": "optional", + "type": "ChaincodeInput", + "name": "input", + "id": 3 + }, + { + "rule": "optional", + "type": "int32", + "name": "timeout", + "id": 4 + } + ], + "enums": [ + { + "name": "Type", + "syntax": "proto3", + "values": [ + { + "name": "UNDEFINED", + "id": 0 + }, + { + "name": "GOLANG", + "id": 1 + }, + { + "name": "NODE", + "id": 2 + }, + { + "name": "CAR", + "id": 3 + }, + { + "name": "JAVA", + "id": 4 + } + ] + } + ] + }, + { + "name": "ChaincodeDeploymentSpec", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ChaincodeSpec", + "name": "chaincode_spec", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "code_package", + "id": 3 + }, + { + "rule": "optional", + "type": "ExecutionEnvironment", + "name": "exec_env", + "id": 4 + } + ], + "enums": [ + { + "name": "ExecutionEnvironment", + "syntax": "proto3", + "values": [ + { + "name": "DOCKER", + "id": 0 + }, + { + "name": "SYSTEM", + "id": 1 + } + ] + } + ] + }, + { + "name": "ChaincodeInvocationSpec", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ChaincodeSpec", + "name": "chaincode_spec", + "id": 1 + } + ] + }, + { + "name": "LifecycleEvent", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "chaincode_name", + "id": 1 + } + ] + }, + { + "name": "SignedProposal", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "proposal_bytes", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "Proposal", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "extension", + "id": 3 + } + ] + }, + { + "name": "ChaincodeHeaderExtension", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload_visibility", + "id": 1 + }, + { + "rule": "optional", + "type": "ChaincodeID", + "name": "chaincode_id", + "id": 2 + } + ] + }, + { + "name": "ChaincodeProposalPayload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "input", + "id": 1 + }, + { + "rule": "map", + "type": "bytes", + "keytype": "string", + "name": "TransientMap", + "id": 2 + } + ] + }, + { + "name": "ChaincodeAction", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "results", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "events", + "id": 2 + }, + { + "rule": "optional", + "type": "Response", + "name": "response", + "id": 3 + }, + { + "rule": "optional", + "type": "ChaincodeID", + "name": "chaincode_id", + "id": 4 + }, + { + "rule": "optional", + "type": "TokenExpectation", + "name": "token_expectation", + "id": 5 + } + ] + }, + { + "name": "ChaincodeMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Type", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "google.protobuf.Timestamp", + "name": "timestamp", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 3 + }, + { + "rule": "optional", + "type": "string", + "name": "txid", + "id": 4 + }, + { + "rule": "optional", + "type": "SignedProposal", + "name": "proposal", + "id": 5 + }, + { + "rule": "optional", + "type": "ChaincodeEvent", + "name": "chaincode_event", + "id": 6 + }, + { + "rule": "optional", + "type": "string", + "name": "channel_id", + "id": 7 + } + ], + "enums": [ + { + "name": "Type", + "syntax": "proto3", + "values": [ + { + "name": "UNDEFINED", + "id": 0 + }, + { + "name": "REGISTER", + "id": 1 + }, + { + "name": "REGISTERED", + "id": 2 + }, + { + "name": "INIT", + "id": 3 + }, + { + "name": "READY", + "id": 4 + }, + { + "name": "TRANSACTION", + "id": 5 + }, + { + "name": "COMPLETED", + "id": 6 + }, + { + "name": "ERROR", + "id": 7 + }, + { + "name": "GET_STATE", + "id": 8 + }, + { + "name": "PUT_STATE", + "id": 9 + }, + { + "name": "DEL_STATE", + "id": 10 + }, + { + "name": "INVOKE_CHAINCODE", + "id": 11 + }, + { + "name": "RESPONSE", + "id": 13 + }, + { + "name": "GET_STATE_BY_RANGE", + "id": 14 + }, + { + "name": "GET_QUERY_RESULT", + "id": 15 + }, + { + "name": "QUERY_STATE_NEXT", + "id": 16 + }, + { + "name": "QUERY_STATE_CLOSE", + "id": 17 + }, + { + "name": "KEEPALIVE", + "id": 18 + }, + { + "name": "GET_HISTORY_FOR_KEY", + "id": 19 + }, + { + "name": "GET_STATE_METADATA", + "id": 20 + }, + { + "name": "PUT_STATE_METADATA", + "id": 21 + }, + { + "name": "GET_PRIVATE_DATA_HASH", + "id": 22 + } + ] + } + ] + }, + { + "name": "GetState", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 2 + } + ] + }, + { + "name": "GetStateMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 2 + } + ] + }, + { + "name": "PutState", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 3 + } + ] + }, + { + "name": "PutStateMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 3 + }, + { + "rule": "optional", + "type": "StateMetadata", + "name": "metadata", + "id": 4 + } + ] + }, + { + "name": "DelState", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 2 + } + ] + }, + { + "name": "GetStateByRange", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "startKey", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "endKey", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 4 + } + ] + }, + { + "name": "GetQueryResult", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "query", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 3 + } + ] + }, + { + "name": "QueryMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "pageSize", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "bookmark", + "id": 2 + } + ] + }, + { + "name": "GetHistoryForKey", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + } + ] + }, + { + "name": "QueryStateNext", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + } + ] + }, + { + "name": "QueryStateClose", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + } + ] + }, + { + "name": "QueryResultBytes", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "resultBytes", + "id": 1 + } + ] + }, + { + "name": "QueryResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "QueryResultBytes", + "name": "results", + "id": 1 + }, + { + "rule": "optional", + "type": "bool", + "name": "has_more", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "id", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 4 + } + ] + }, + { + "name": "QueryResponseMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "fetched_records_count", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "bookmark", + "id": 2 + } + ] + }, + { + "name": "StateMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "metakey", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + } + ] + }, + { + "name": "StateMetadataResult", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "StateMetadata", + "name": "entries", + "id": 1 + } + ] + }, + { + "name": "ChaincodeIdentifier", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "hash", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + } + ] + }, + { + "name": "ChaincodeValidation", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "argument", + "id": 2 + } + ] + }, + { + "name": "VSCCArgs", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "endorsement_policy_ref", + "id": 1 + } + ] + }, + { + "name": "ChaincodeEndorsement", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + } + ] + }, + { + "name": "ConfigTree", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Config", + "name": "channel_config", + "id": 1 + }, + { + "rule": "optional", + "type": "common.Config", + "name": "resources_config", + "id": 2 + } + ] + }, + { + "name": "AnchorPeers", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "AnchorPeer", + "name": "anchor_peers", + "id": 1 + } + ] + }, + { + "name": "AnchorPeer", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "host", + "id": 1 + }, + { + "rule": "optional", + "type": "int32", + "name": "port", + "id": 2 + } + ] + }, + { + "name": "APIResource", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "policy_ref", + "id": 1 + } + ] + }, + { + "name": "ACLs", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "APIResource", + "keytype": "string", + "name": "acls", + "id": 1 + } + ] + }, + { + "name": "PeerID", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + } + ] + }, + { + "name": "PeerEndpoint", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PeerID", + "name": "id", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "address", + "id": 2 + } + ] + }, + { + "name": "ChaincodeQueryResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "ChaincodeInfo", + "name": "chaincodes", + "id": 1 + } + ] + }, + { + "name": "ChaincodeInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "path", + "id": 3 + }, + { + "rule": "optional", + "type": "string", + "name": "input", + "id": 4 + }, + { + "rule": "optional", + "type": "string", + "name": "escc", + "id": 5 + }, + { + "rule": "optional", + "type": "string", + "name": "vscc", + "id": 6 + }, + { + "rule": "optional", + "type": "bytes", + "name": "id", + "id": 7 + } + ] + }, + { + "name": "ChannelQueryResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "ChannelInfo", + "name": "channels", + "id": 1 + } + ] + }, + { + "name": "ChannelInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel_id", + "id": 1 + } + ] + }, + { + "name": "SignedChaincodeDeploymentSpec", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "chaincode_deployment_spec", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "instantiation_policy", + "id": 2 + }, + { + "rule": "repeated", + "type": "Endorsement", + "name": "owner_endorsements", + "id": 3 + } + ] + }, + { + "name": "ServerStatus", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "StatusCode", + "name": "status", + "id": 1 + } + ], + "enums": [ + { + "name": "StatusCode", + "syntax": "proto3", + "values": [ + { + "name": "UNDEFINED", + "id": 0 + }, + { + "name": "STARTED", + "id": 1 + }, + { + "name": "STOPPED", + "id": 2 + }, + { + "name": "PAUSED", + "id": 3 + }, + { + "name": "ERROR", + "id": 4 + }, + { + "name": "UNKNOWN", + "id": 5 + } + ] + } + ] + }, + { + "name": "LogLevelRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "log_module", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "log_level", + "id": 2 + } + ] + }, + { + "name": "LogLevelResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "log_module", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "log_level", + "id": 2 + } + ] + }, + { + "name": "LogSpecRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "log_spec", + "id": 1 + } + ] + }, + { + "name": "LogSpecResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "log_spec", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "error", + "id": 2 + } + ] + }, + { + "name": "AdminOperation", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "LogLevelRequest", + "name": "logReq", + "id": 1, + "oneof": "content" + }, + { + "rule": "optional", + "type": "LogSpecRequest", + "name": "logSpecReq", + "id": 2, + "oneof": "content" + } + ], + "oneofs": { + "content": [ + 1, + 2 + ] + } + } + ], + "enums": [ + { + "name": "TxValidationCode", + "syntax": "proto3", + "values": [ + { + "name": "VALID", + "id": 0 + }, + { + "name": "NIL_ENVELOPE", + "id": 1 + }, + { + "name": "BAD_PAYLOAD", + "id": 2 + }, + { + "name": "BAD_COMMON_HEADER", + "id": 3 + }, + { + "name": "BAD_CREATOR_SIGNATURE", + "id": 4 + }, + { + "name": "INVALID_ENDORSER_TRANSACTION", + "id": 5 + }, + { + "name": "INVALID_CONFIG_TRANSACTION", + "id": 6 + }, + { + "name": "UNSUPPORTED_TX_PAYLOAD", + "id": 7 + }, + { + "name": "BAD_PROPOSAL_TXID", + "id": 8 + }, + { + "name": "DUPLICATE_TXID", + "id": 9 + }, + { + "name": "ENDORSEMENT_POLICY_FAILURE", + "id": 10 + }, + { + "name": "MVCC_READ_CONFLICT", + "id": 11 + }, + { + "name": "PHANTOM_READ_CONFLICT", + "id": 12 + }, + { + "name": "UNKNOWN_TX_TYPE", + "id": 13 + }, + { + "name": "TARGET_CHAIN_NOT_FOUND", + "id": 14 + }, + { + "name": "MARSHAL_TX_ERROR", + "id": 15 + }, + { + "name": "NIL_TXACTION", + "id": 16 + }, + { + "name": "EXPIRED_CHAINCODE", + "id": 17 + }, + { + "name": "CHAINCODE_VERSION_CONFLICT", + "id": 18 + }, + { + "name": "BAD_HEADER_EXTENSION", + "id": 19 + }, + { + "name": "BAD_CHANNEL_HEADER", + "id": 20 + }, + { + "name": "BAD_RESPONSE_PAYLOAD", + "id": 21 + }, + { + "name": "BAD_RWSET", + "id": 22 + }, + { + "name": "ILLEGAL_WRITESET", + "id": 23 + }, + { + "name": "INVALID_WRITESET", + "id": 24 + }, + { + "name": "NOT_VALIDATED", + "id": 254 + }, + { + "name": "INVALID_OTHER_REASON", + "id": 255 + } + ] + }, + { + "name": "MetaDataKeys", + "syntax": "proto3", + "values": [ + { + "name": "VALIDATION_PARAMETER", + "id": 0 + } + ] + }, + { + "name": "ConfidentialityLevel", + "syntax": "proto3", + "values": [ + { + "name": "PUBLIC", + "id": 0 + }, + { + "name": "CONFIDENTIAL", + "id": 1 + } + ] + } + ], + "services": [ + { + "name": "Prover", + "options": {}, + "rpc": { + "ProcessCommand": { + "request": "SignedCommand", + "request_stream": false, + "response": "SignedCommandResponse", + "response_stream": false, + "options": {} + } + } + }, + { + "name": "Deliver", + "options": {}, + "rpc": { + "Deliver": { + "request": "common.Envelope", + "request_stream": true, + "response": "DeliverResponse", + "response_stream": true, + "options": {} + }, + "DeliverFiltered": { + "request": "common.Envelope", + "request_stream": true, + "response": "DeliverResponse", + "response_stream": true, + "options": {} + } + } + }, + { + "name": "ChaincodeSupport", + "options": {}, + "rpc": { + "Register": { + "request": "ChaincodeMessage", + "request_stream": true, + "response": "ChaincodeMessage", + "response_stream": true, + "options": {} + } + } + }, + { + "name": "Endorser", + "options": {}, + "rpc": { + "ProcessProposal": { + "request": "SignedProposal", + "request_stream": false, + "response": "ProposalResponse", + "response_stream": false, + "options": {} + } + } + }, + { + "name": "Admin", + "options": {}, + "rpc": { + "GetStatus": { + "request": "common.Envelope", + "request_stream": false, + "response": "ServerStatus", + "response_stream": false, + "options": {} + }, + "StartServer": { + "request": "common.Envelope", + "request_stream": false, + "response": "ServerStatus", + "response_stream": false, + "options": {} + }, + "GetModuleLogLevel": { + "request": "common.Envelope", + "request_stream": false, + "response": "LogLevelResponse", + "response_stream": false, + "options": {} + }, + "SetModuleLogLevel": { + "request": "common.Envelope", + "request_stream": false, + "response": "LogLevelResponse", + "response_stream": false, + "options": {} + }, + "RevertLogLevels": { + "request": "common.Envelope", + "request_stream": false, + "response": "google.protobuf.Empty", + "response_stream": false, + "options": {} + }, + "GetLogSpec": { + "request": "common.Envelope", + "request_stream": false, + "response": "LogSpecResponse", + "response_stream": false, + "options": {} + }, + "SetLogSpec": { + "request": "common.Envelope", + "request_stream": false, + "response": "LogSpecResponse", + "response_stream": false, + "options": {} + } + } + } + ], + "isNamespace": true + }, + { + "name": "kvrwset", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset", + "java_package": "org.hyperledger.fabric.protos.ledger.rwset.kvrwset" + }, + "messages": [ + { + "name": "KVRWSet", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "KVRead", + "name": "reads", + "id": 1 + }, + { + "rule": "repeated", + "type": "RangeQueryInfo", + "name": "range_queries_info", + "id": 2 + }, + { + "rule": "repeated", + "type": "KVWrite", + "name": "writes", + "id": 3 + }, + { + "rule": "repeated", + "type": "KVMetadataWrite", + "name": "metadata_writes", + "id": 4 + } + ] + }, + { + "name": "HashedRWSet", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "KVReadHash", + "name": "hashed_reads", + "id": 1 + }, + { + "rule": "repeated", + "type": "KVWriteHash", + "name": "hashed_writes", + "id": 2 + }, + { + "rule": "repeated", + "type": "KVMetadataWriteHash", + "name": "metadata_writes", + "id": 3 + } + ] + }, + { + "name": "KVRead", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "Version", + "name": "version", + "id": 2 + } + ] + }, + { + "name": "KVWrite", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "optional", + "type": "bool", + "name": "is_delete", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 3 + } + ] + }, + { + "name": "KVMetadataWrite", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 1 + }, + { + "rule": "repeated", + "type": "KVMetadataEntry", + "name": "entries", + "id": 2 + } + ] + }, + { + "name": "KVReadHash", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "key_hash", + "id": 1 + }, + { + "rule": "optional", + "type": "Version", + "name": "version", + "id": 2 + } + ] + }, + { + "name": "KVWriteHash", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "key_hash", + "id": 1 + }, + { + "rule": "optional", + "type": "bool", + "name": "is_delete", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value_hash", + "id": 3 + } + ] + }, + { + "name": "KVMetadataWriteHash", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "key_hash", + "id": 1 + }, + { + "rule": "repeated", + "type": "KVMetadataEntry", + "name": "entries", + "id": 2 + } + ] + }, + { + "name": "KVMetadataEntry", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + } + ] + }, + { + "name": "Version", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "block_num", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "tx_num", + "id": 2 + } + ] + }, + { + "name": "RangeQueryInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "start_key", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "end_key", + "id": 2 + }, + { + "rule": "optional", + "type": "bool", + "name": "itr_exhausted", + "id": 3 + }, + { + "rule": "optional", + "type": "QueryReads", + "name": "raw_reads", + "id": 4, + "oneof": "reads_info" + }, + { + "rule": "optional", + "type": "QueryReadsMerkleSummary", + "name": "reads_merkle_hashes", + "id": 5, + "oneof": "reads_info" + } + ], + "oneofs": { + "reads_info": [ + 4, + 5 + ] + } + }, + { + "name": "QueryReads", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "KVRead", + "name": "kv_reads", + "id": 1 + } + ] + }, + { + "name": "QueryReadsMerkleSummary", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint32", + "name": "max_degree", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "max_level", + "id": 2 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "max_level_hashes", + "id": 3 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "rwset", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/ledger/rwset", + "java_package": "org.hyperledger.fabric.protos.ledger.rwset" + }, + "messages": [ + { + "name": "TxReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "DataModel", + "name": "data_model", + "id": 1 + }, + { + "rule": "repeated", + "type": "NsReadWriteSet", + "name": "ns_rwset", + "id": 2 + } + ], + "enums": [ + { + "name": "DataModel", + "syntax": "proto3", + "values": [ + { + "name": "KV", + "id": 0 + } + ] + } + ] + }, + { + "name": "NsReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "rwset", + "id": 2 + }, + { + "rule": "repeated", + "type": "CollectionHashedReadWriteSet", + "name": "collection_hashed_rwset", + "id": 3 + } + ] + }, + { + "name": "CollectionHashedReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "collection_name", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "hashed_rwset", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "pvt_rwset_hash", + "id": 3 + } + ] + }, + { + "name": "TxPvtReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "TxReadWriteSet.DataModel", + "name": "data_model", + "id": 1 + }, + { + "rule": "repeated", + "type": "NsPvtReadWriteSet", + "name": "ns_pvt_rwset", + "id": 2 + } + ] + }, + { + "name": "NsPvtReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 1 + }, + { + "rule": "repeated", + "type": "CollectionPvtReadWriteSet", + "name": "collection_pvt_rwset", + "id": 2 + } + ] + }, + { + "name": "CollectionPvtReadWriteSet", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "collection_name", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "rwset", + "id": 2 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "queryresult", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/ledger/queryresult", + "java_package": "org.hyperledger.fabric.protos.ledger.queryresult" + }, + "messages": [ + { + "name": "KV", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "key", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 3 + } + ] + }, + { + "name": "KeyModification", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + }, + { + "rule": "optional", + "type": "google.protobuf.Timestamp", + "name": "timestamp", + "id": 3 + }, + { + "rule": "optional", + "type": "bool", + "name": "is_delete", + "id": 4 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "common", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/common", + "java_package": "org.hyperledger.fabric.protos.common" + }, + "messages": [ + { + "name": "MSPPrincipal", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Classification", + "name": "principal_classification", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "principal", + "id": 2 + } + ], + "enums": [ + { + "name": "Classification", + "syntax": "proto3", + "values": [ + { + "name": "ROLE", + "id": 0 + }, + { + "name": "ORGANIZATION_UNIT", + "id": 1 + }, + { + "name": "IDENTITY", + "id": 2 + }, + { + "name": "ANONYMITY", + "id": 3 + }, + { + "name": "COMBINED", + "id": 4 + } + ] + } + ] + }, + { + "name": "OrganizationUnit", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "msp_identifier", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "organizational_unit_identifier", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "certifiers_identifier", + "id": 3 + } + ] + }, + { + "name": "MSPRole", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "msp_identifier", + "id": 1 + }, + { + "rule": "optional", + "type": "MSPRoleType", + "name": "role", + "id": 2 + } + ], + "enums": [ + { + "name": "MSPRoleType", + "syntax": "proto3", + "values": [ + { + "name": "MEMBER", + "id": 0 + }, + { + "name": "ADMIN", + "id": 1 + }, + { + "name": "CLIENT", + "id": 2 + }, + { + "name": "PEER", + "id": 3 + } + ] + } + ] + }, + { + "name": "MSPIdentityAnonymity", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "MSPIdentityAnonymityType", + "name": "anonymity_type", + "id": 1 + } + ], + "enums": [ + { + "name": "MSPIdentityAnonymityType", + "syntax": "proto3", + "values": [ + { + "name": "NOMINAL", + "id": 0 + }, + { + "name": "ANONYMOUS", + "id": 1 + } + ] + } + ] + }, + { + "name": "CombinedPrincipal", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "MSPPrincipal", + "name": "principals", + "id": 1 + } + ] + }, + { + "name": "Policy", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + } + ], + "enums": [ + { + "name": "PolicyType", + "syntax": "proto3", + "values": [ + { + "name": "UNKNOWN", + "id": 0 + }, + { + "name": "SIGNATURE", + "id": 1 + }, + { + "name": "MSP", + "id": 2 + }, + { + "name": "IMPLICIT_META", + "id": 3 + } + ] + } + ] + }, + { + "name": "SignaturePolicyEnvelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "version", + "id": 1 + }, + { + "rule": "optional", + "type": "SignaturePolicy", + "name": "rule", + "id": 2 + }, + { + "rule": "repeated", + "type": "MSPPrincipal", + "name": "identities", + "id": 3 + } + ] + }, + { + "name": "SignaturePolicy", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "signed_by", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "NOutOf", + "name": "n_out_of", + "id": 2, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2 + ] + }, + "messages": [ + { + "name": "NOutOf", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "n", + "id": 1 + }, + { + "rule": "repeated", + "type": "SignaturePolicy", + "name": "rules", + "id": 2 + } + ] + } + ] + }, + { + "name": "ImplicitMetaPolicy", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "sub_policy", + "id": 1 + }, + { + "rule": "optional", + "type": "Rule", + "name": "rule", + "id": 2 + } + ], + "enums": [ + { + "name": "Rule", + "syntax": "proto3", + "values": [ + { + "name": "ANY", + "id": 0 + }, + { + "name": "ALL", + "id": 1 + }, + { + "name": "MAJORITY", + "id": 2 + } + ] + } + ] + }, + { + "name": "CollectionConfigPackage", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "CollectionConfig", + "name": "config", + "id": 1 + } + ] + }, + { + "name": "CollectionConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "StaticCollectionConfig", + "name": "static_collection_config", + "id": 1, + "oneof": "payload" + } + ], + "oneofs": { + "payload": [ + 1 + ] + } + }, + { + "name": "StaticCollectionConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "CollectionPolicyConfig", + "name": "member_orgs_policy", + "id": 2 + }, + { + "rule": "optional", + "type": "int32", + "name": "required_peer_count", + "id": 3 + }, + { + "rule": "optional", + "type": "int32", + "name": "maximum_peer_count", + "id": 4 + }, + { + "rule": "optional", + "type": "uint64", + "name": "block_to_live", + "id": 5 + }, + { + "rule": "optional", + "type": "bool", + "name": "member_only_read", + "id": 6 + }, + { + "rule": "optional", + "type": "bool", + "name": "member_only_write", + "id": 7 + } + ] + }, + { + "name": "CollectionPolicyConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "SignaturePolicyEnvelope", + "name": "signature_policy", + "id": 1, + "oneof": "payload" + } + ], + "oneofs": { + "payload": [ + 1 + ] + } + }, + { + "name": "CollectionCriteria", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 3 + }, + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 4 + } + ] + }, + { + "name": "LastConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "index", + "id": 1 + } + ] + }, + { + "name": "Metadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 1 + }, + { + "rule": "repeated", + "type": "MetadataSignature", + "name": "signatures", + "id": 2 + } + ] + }, + { + "name": "MetadataSignature", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "signature_header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "Header", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "channel_header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature_header", + "id": 2 + } + ] + }, + { + "name": "ChannelHeader", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "int32", + "name": "version", + "id": 2 + }, + { + "rule": "optional", + "type": "google.protobuf.Timestamp", + "name": "timestamp", + "id": 3 + }, + { + "rule": "optional", + "type": "string", + "name": "channel_id", + "id": 4 + }, + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 5 + }, + { + "rule": "optional", + "type": "uint64", + "name": "epoch", + "id": 6 + }, + { + "rule": "optional", + "type": "bytes", + "name": "extension", + "id": 7 + }, + { + "rule": "optional", + "type": "bytes", + "name": "tls_cert_hash", + "id": 8 + } + ] + }, + { + "name": "SignatureHeader", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "creator", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "nonce", + "id": 2 + } + ] + }, + { + "name": "Payload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Header", + "name": "header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "data", + "id": 2 + } + ] + }, + { + "name": "Envelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "Block", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "BlockHeader", + "name": "header", + "id": 1 + }, + { + "rule": "optional", + "type": "BlockData", + "name": "data", + "id": 2 + }, + { + "rule": "optional", + "type": "BlockMetadata", + "name": "metadata", + "id": 3 + } + ] + }, + { + "name": "BlockHeader", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "number", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "previous_hash", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "data_hash", + "id": 3 + } + ] + }, + { + "name": "BlockData", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "bytes", + "name": "data", + "id": 1 + } + ] + }, + { + "name": "BlockMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "bytes", + "name": "metadata", + "id": 1 + } + ] + }, + { + "name": "ConfigEnvelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Config", + "name": "config", + "id": 1 + }, + { + "rule": "optional", + "type": "Envelope", + "name": "last_update", + "id": 2 + } + ] + }, + { + "name": "ConfigGroupSchema", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "ConfigGroupSchema", + "keytype": "string", + "name": "groups", + "id": 1 + }, + { + "rule": "map", + "type": "ConfigValueSchema", + "keytype": "string", + "name": "values", + "id": 2 + }, + { + "rule": "map", + "type": "ConfigPolicySchema", + "keytype": "string", + "name": "policies", + "id": 3 + } + ] + }, + { + "name": "ConfigValueSchema", + "syntax": "proto3", + "fields": [] + }, + { + "name": "ConfigPolicySchema", + "syntax": "proto3", + "fields": [] + }, + { + "name": "Config", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "sequence", + "id": 1 + }, + { + "rule": "optional", + "type": "ConfigGroup", + "name": "channel_group", + "id": 2 + } + ] + }, + { + "name": "ConfigUpdateEnvelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "config_update", + "id": 1 + }, + { + "rule": "repeated", + "type": "ConfigSignature", + "name": "signatures", + "id": 2 + } + ] + }, + { + "name": "ConfigUpdate", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel_id", + "id": 1 + }, + { + "rule": "optional", + "type": "ConfigGroup", + "name": "read_set", + "id": 2 + }, + { + "rule": "optional", + "type": "ConfigGroup", + "name": "write_set", + "id": 3 + }, + { + "rule": "map", + "type": "bytes", + "keytype": "string", + "name": "isolated_data", + "id": 5 + } + ] + }, + { + "name": "ConfigGroup", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "version", + "id": 1 + }, + { + "rule": "map", + "type": "ConfigGroup", + "keytype": "string", + "name": "groups", + "id": 2 + }, + { + "rule": "map", + "type": "ConfigValue", + "keytype": "string", + "name": "values", + "id": 3 + }, + { + "rule": "map", + "type": "ConfigPolicy", + "keytype": "string", + "name": "policies", + "id": 4 + }, + { + "rule": "optional", + "type": "string", + "name": "mod_policy", + "id": 5 + } + ] + }, + { + "name": "ConfigValue", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "version", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "value", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "mod_policy", + "id": 3 + } + ] + }, + { + "name": "ConfigPolicy", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "version", + "id": 1 + }, + { + "rule": "optional", + "type": "Policy", + "name": "policy", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "mod_policy", + "id": 3 + } + ] + }, + { + "name": "ConfigSignature", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "signature_header", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "BlockchainInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "height", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "currentBlockHash", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "previousBlockHash", + "id": 3 + } + ] + }, + { + "name": "HashingAlgorithm", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + } + ] + }, + { + "name": "BlockDataHashingStructure", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint32", + "name": "width", + "id": 1 + } + ] + }, + { + "name": "OrdererAddresses", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "string", + "name": "addresses", + "id": 1 + } + ] + }, + { + "name": "Consortium", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + } + ] + }, + { + "name": "Capabilities", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "Capability", + "keytype": "string", + "name": "capabilities", + "id": 1 + } + ] + }, + { + "name": "Capability", + "syntax": "proto3", + "fields": [] + } + ], + "enums": [ + { + "name": "Status", + "syntax": "proto3", + "values": [ + { + "name": "UNKNOWN", + "id": 0 + }, + { + "name": "SUCCESS", + "id": 200 + }, + { + "name": "BAD_REQUEST", + "id": 400 + }, + { + "name": "FORBIDDEN", + "id": 403 + }, + { + "name": "NOT_FOUND", + "id": 404 + }, + { + "name": "REQUEST_ENTITY_TOO_LARGE", + "id": 413 + }, + { + "name": "INTERNAL_SERVER_ERROR", + "id": 500 + }, + { + "name": "NOT_IMPLEMENTED", + "id": 501 + }, + { + "name": "SERVICE_UNAVAILABLE", + "id": 503 + } + ] + }, + { + "name": "HeaderType", + "syntax": "proto3", + "values": [ + { + "name": "MESSAGE", + "id": 0 + }, + { + "name": "CONFIG", + "id": 1 + }, + { + "name": "CONFIG_UPDATE", + "id": 2 + }, + { + "name": "ENDORSER_TRANSACTION", + "id": 3 + }, + { + "name": "ORDERER_TRANSACTION", + "id": 4 + }, + { + "name": "DELIVER_SEEK_INFO", + "id": 5 + }, + { + "name": "CHAINCODE_PACKAGE", + "id": 6 + }, + { + "name": "PEER_ADMIN_OPERATION", + "id": 8 + }, + { + "name": "TOKEN_TRANSACTION", + "id": 9 + }, + { + "name": "TOKEN_ENDORSER_TRANSACTION", + "id": 10 + } + ] + }, + { + "name": "BlockMetadataIndex", + "syntax": "proto3", + "values": [ + { + "name": "SIGNATURES", + "id": 0 + }, + { + "name": "LAST_CONFIG", + "id": 1 + }, + { + "name": "TRANSACTIONS_FILTER", + "id": 2 + }, + { + "name": "ORDERER", + "id": 3 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "transientstore", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/transientstore", + "java_package": "org.hyperledger.fabric.protos.transientstore" + }, + "messages": [ + { + "name": "TxPvtReadWriteSetWithConfigInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "endorsed_at", + "id": 1 + }, + { + "rule": "optional", + "type": "rwset.TxPvtReadWriteSet", + "name": "pvt_rwset", + "id": 2 + }, + { + "rule": "map", + "type": "common.CollectionConfigPackage", + "keytype": "string", + "name": "collection_configs", + "id": 3 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "gossip", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/gossip" + }, + "messages": [ + { + "name": "Envelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + }, + { + "rule": "optional", + "type": "SecretEnvelope", + "name": "secret_envelope", + "id": 3 + } + ] + }, + { + "name": "SecretEnvelope", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "Secret", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "internalEndpoint", + "id": 1, + "oneof": "content" + } + ], + "oneofs": { + "content": [ + 1 + ] + } + }, + { + "name": "GossipMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "nonce", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "channel", + "id": 2 + }, + { + "rule": "optional", + "type": "Tag", + "name": "tag", + "id": 3 + }, + { + "rule": "optional", + "type": "AliveMessage", + "name": "alive_msg", + "id": 5, + "oneof": "content" + }, + { + "rule": "optional", + "type": "MembershipRequest", + "name": "mem_req", + "id": 6, + "oneof": "content" + }, + { + "rule": "optional", + "type": "MembershipResponse", + "name": "mem_res", + "id": 7, + "oneof": "content" + }, + { + "rule": "optional", + "type": "DataMessage", + "name": "data_msg", + "id": 8, + "oneof": "content" + }, + { + "rule": "optional", + "type": "GossipHello", + "name": "hello", + "id": 9, + "oneof": "content" + }, + { + "rule": "optional", + "type": "DataDigest", + "name": "data_dig", + "id": 10, + "oneof": "content" + }, + { + "rule": "optional", + "type": "DataRequest", + "name": "data_req", + "id": 11, + "oneof": "content" + }, + { + "rule": "optional", + "type": "DataUpdate", + "name": "data_update", + "id": 12, + "oneof": "content" + }, + { + "rule": "optional", + "type": "Empty", + "name": "empty", + "id": 13, + "oneof": "content" + }, + { + "rule": "optional", + "type": "ConnEstablish", + "name": "conn", + "id": 14, + "oneof": "content" + }, + { + "rule": "optional", + "type": "StateInfo", + "name": "state_info", + "id": 15, + "oneof": "content" + }, + { + "rule": "optional", + "type": "StateInfoSnapshot", + "name": "state_snapshot", + "id": 16, + "oneof": "content" + }, + { + "rule": "optional", + "type": "StateInfoPullRequest", + "name": "state_info_pull_req", + "id": 17, + "oneof": "content" + }, + { + "rule": "optional", + "type": "RemoteStateRequest", + "name": "state_request", + "id": 18, + "oneof": "content" + }, + { + "rule": "optional", + "type": "RemoteStateResponse", + "name": "state_response", + "id": 19, + "oneof": "content" + }, + { + "rule": "optional", + "type": "LeadershipMessage", + "name": "leadership_msg", + "id": 20, + "oneof": "content" + }, + { + "rule": "optional", + "type": "PeerIdentity", + "name": "peer_identity", + "id": 21, + "oneof": "content" + }, + { + "rule": "optional", + "type": "Acknowledgement", + "name": "ack", + "id": 22, + "oneof": "content" + }, + { + "rule": "optional", + "type": "RemotePvtDataRequest", + "name": "privateReq", + "id": 23, + "oneof": "content" + }, + { + "rule": "optional", + "type": "RemotePvtDataResponse", + "name": "privateRes", + "id": 24, + "oneof": "content" + }, + { + "rule": "optional", + "type": "PrivateDataMessage", + "name": "private_data", + "id": 25, + "oneof": "content" + } + ], + "oneofs": { + "content": [ + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ] + }, + "enums": [ + { + "name": "Tag", + "syntax": "proto3", + "values": [ + { + "name": "UNDEFINED", + "id": 0 + }, + { + "name": "EMPTY", + "id": 1 + }, + { + "name": "ORG_ONLY", + "id": 2 + }, + { + "name": "CHAN_ONLY", + "id": 3 + }, + { + "name": "CHAN_AND_ORG", + "id": 4 + }, + { + "name": "CHAN_OR_ORG", + "id": 5 + } + ] + } + ] + }, + { + "name": "StateInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PeerTime", + "name": "timestamp", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "pki_id", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "channel_MAC", + "id": 4 + }, + { + "rule": "optional", + "type": "Properties", + "name": "properties", + "id": 5 + } + ] + }, + { + "name": "Properties", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "ledger_height", + "id": 1 + }, + { + "rule": "optional", + "type": "bool", + "name": "left_channel", + "id": 2 + }, + { + "rule": "repeated", + "type": "Chaincode", + "name": "chaincodes", + "id": 3 + } + ] + }, + { + "name": "StateInfoSnapshot", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Envelope", + "name": "elements", + "id": 1 + } + ] + }, + { + "name": "StateInfoPullRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "channel_MAC", + "id": 1 + } + ] + }, + { + "name": "ConnEstablish", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "pki_id", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "identity", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "tls_cert_hash", + "id": 3 + } + ] + }, + { + "name": "PeerIdentity", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "pki_id", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "cert", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 3 + } + ] + }, + { + "name": "DataRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "nonce", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "digests", + "id": 2 + }, + { + "rule": "optional", + "type": "PullMsgType", + "name": "msg_type", + "id": 3 + } + ] + }, + { + "name": "GossipHello", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "nonce", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 2 + }, + { + "rule": "optional", + "type": "PullMsgType", + "name": "msg_type", + "id": 3 + } + ] + }, + { + "name": "DataUpdate", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "nonce", + "id": 1 + }, + { + "rule": "repeated", + "type": "Envelope", + "name": "data", + "id": 2 + }, + { + "rule": "optional", + "type": "PullMsgType", + "name": "msg_type", + "id": 3 + } + ] + }, + { + "name": "DataDigest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "nonce", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "digests", + "id": 2 + }, + { + "rule": "optional", + "type": "PullMsgType", + "name": "msg_type", + "id": 3 + } + ] + }, + { + "name": "DataMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Payload", + "name": "payload", + "id": 1 + } + ] + }, + { + "name": "PrivateDataMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PrivatePayload", + "name": "payload", + "id": 1 + } + ] + }, + { + "name": "Payload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "seq_num", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "data", + "id": 2 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "private_data", + "id": 3 + } + ] + }, + { + "name": "PrivatePayload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "collection_name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "private_rwset", + "id": 4 + }, + { + "rule": "optional", + "type": "uint64", + "name": "private_sim_height", + "id": 5 + }, + { + "rule": "optional", + "type": "common.CollectionConfigPackage", + "name": "collection_configs", + "id": 6 + } + ] + }, + { + "name": "AliveMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Member", + "name": "membership", + "id": 1 + }, + { + "rule": "optional", + "type": "PeerTime", + "name": "timestamp", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "identity", + "id": 4 + } + ] + }, + { + "name": "LeadershipMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "pki_id", + "id": 1 + }, + { + "rule": "optional", + "type": "PeerTime", + "name": "timestamp", + "id": 2 + }, + { + "rule": "optional", + "type": "bool", + "name": "is_declaration", + "id": 3 + } + ] + }, + { + "name": "PeerTime", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "inc_num", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "seq_num", + "id": 2 + } + ] + }, + { + "name": "MembershipRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Envelope", + "name": "self_information", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "known", + "id": 2 + } + ] + }, + { + "name": "MembershipResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Envelope", + "name": "alive", + "id": 1 + }, + { + "rule": "repeated", + "type": "Envelope", + "name": "dead", + "id": 2 + } + ] + }, + { + "name": "Member", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "endpoint", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "pki_id", + "id": 3 + } + ] + }, + { + "name": "Empty", + "syntax": "proto3", + "fields": [] + }, + { + "name": "RemoteStateRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "start_seq_num", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "end_seq_num", + "id": 2 + } + ] + }, + { + "name": "RemoteStateResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Payload", + "name": "payloads", + "id": 1 + } + ] + }, + { + "name": "RemotePvtDataRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "PvtDataDigest", + "name": "digests", + "id": 1 + } + ] + }, + { + "name": "PvtDataDigest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "tx_id", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "namespace", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "collection", + "id": 3 + }, + { + "rule": "optional", + "type": "uint64", + "name": "block_seq", + "id": 4 + }, + { + "rule": "optional", + "type": "uint64", + "name": "seq_in_block", + "id": 5 + } + ] + }, + { + "name": "RemotePvtDataResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "PvtDataElement", + "name": "elements", + "id": 1 + } + ] + }, + { + "name": "PvtDataElement", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "PvtDataDigest", + "name": "digest", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "payload", + "id": 2 + } + ] + }, + { + "name": "PvtDataPayload", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "tx_seq_in_block", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 2 + } + ] + }, + { + "name": "Acknowledgement", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "error", + "id": 1 + } + ] + }, + { + "name": "Chaincode", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 3 + } + ] + } + ], + "enums": [ + { + "name": "PullMsgType", + "syntax": "proto3", + "values": [ + { + "name": "UNDEFINED", + "id": 0 + }, + { + "name": "BLOCK_MSG", + "id": 1 + }, + { + "name": "IDENTITY_MSG", + "id": 2 + } + ] + } + ], + "services": [ + { + "name": "Gossip", + "options": {}, + "rpc": { + "GossipStream": { + "request": "Envelope", + "request_stream": true, + "response": "Envelope", + "response_stream": true, + "options": {} + }, + "Ping": { + "request": "Empty", + "request_stream": false, + "response": "Empty", + "response_stream": false, + "options": {} + } + } + } + ], + "isNamespace": true + }, + { + "name": "msp", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/msp", + "java_package": "org.hyperledger.fabric.protos.msp", + "java_outer_classname": "MspConfigPackage" + }, + "messages": [ + { + "name": "MSPConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int32", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "config", + "id": 2 + } + ] + }, + { + "name": "FabricMSPConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "root_certs", + "id": 2 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "intermediate_certs", + "id": 3 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "admins", + "id": 4 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "revocation_list", + "id": 5 + }, + { + "rule": "optional", + "type": "SigningIdentityInfo", + "name": "signing_identity", + "id": 6 + }, + { + "rule": "repeated", + "type": "FabricOUIdentifier", + "name": "organizational_unit_identifiers", + "id": 7 + }, + { + "rule": "optional", + "type": "FabricCryptoConfig", + "name": "crypto_config", + "id": 8 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "tls_root_certs", + "id": 9 + }, + { + "rule": "repeated", + "type": "bytes", + "name": "tls_intermediate_certs", + "id": 10 + }, + { + "rule": "optional", + "type": "FabricNodeOUs", + "name": "fabric_node_ous", + "id": 11 + } + ] + }, + { + "name": "FabricCryptoConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "signature_hash_family", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "identity_identifier_hash_function", + "id": 2 + } + ] + }, + { + "name": "IdemixMSPConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "ipk", + "id": 2 + }, + { + "rule": "optional", + "type": "IdemixMSPSignerConfig", + "name": "signer", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "revocation_pk", + "id": 4 + }, + { + "rule": "optional", + "type": "int64", + "name": "epoch", + "id": 5 + } + ] + }, + { + "name": "IdemixMSPSignerConfig", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "cred", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "sk", + "id": 2 + }, + { + "rule": "optional", + "type": "string", + "name": "organizational_unit_identifier", + "id": 3 + }, + { + "rule": "optional", + "type": "int32", + "name": "role", + "id": 4 + }, + { + "rule": "optional", + "type": "string", + "name": "enrollment_id", + "id": 5 + }, + { + "rule": "optional", + "type": "bytes", + "name": "credential_revocation_information", + "id": 6 + } + ] + }, + { + "name": "SigningIdentityInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "public_signer", + "id": 1 + }, + { + "rule": "optional", + "type": "KeyInfo", + "name": "private_signer", + "id": 2 + } + ] + }, + { + "name": "KeyInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "key_identifier", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "key_material", + "id": 2 + } + ] + }, + { + "name": "FabricOUIdentifier", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "certificate", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "organizational_unit_identifier", + "id": 2 + } + ] + }, + { + "name": "FabricNodeOUs", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bool", + "name": "enable", + "id": 1 + }, + { + "rule": "optional", + "type": "FabricOUIdentifier", + "name": "client_ou_identifier", + "id": 2 + }, + { + "rule": "optional", + "type": "FabricOUIdentifier", + "name": "peer_ou_identifier", + "id": 3 + } + ] + }, + { + "name": "SerializedIdentity", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "mspid", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "id_bytes", + "id": 2 + } + ] + }, + { + "name": "SerializedIdemixIdentity", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "nym_x", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "nym_y", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "ou", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "role", + "id": 4 + }, + { + "rule": "optional", + "type": "bytes", + "name": "proof", + "id": 5 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "discovery", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/discovery" + }, + "messages": [ + { + "name": "SignedRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "signature", + "id": 2 + } + ] + }, + { + "name": "Request", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "AuthInfo", + "name": "authentication", + "id": 1 + }, + { + "rule": "repeated", + "type": "Query", + "name": "queries", + "id": 2 + } + ] + }, + { + "name": "Response", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "QueryResult", + "name": "results", + "id": 1 + } + ] + }, + { + "name": "AuthInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "client_identity", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "client_tls_cert_hash", + "id": 2 + } + ] + }, + { + "name": "Query", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel", + "id": 1 + }, + { + "rule": "optional", + "type": "ConfigQuery", + "name": "config_query", + "id": 2, + "oneof": "query" + }, + { + "rule": "optional", + "type": "PeerMembershipQuery", + "name": "peer_query", + "id": 3, + "oneof": "query" + }, + { + "rule": "optional", + "type": "ChaincodeQuery", + "name": "cc_query", + "id": 4, + "oneof": "query" + }, + { + "rule": "optional", + "type": "LocalPeerQuery", + "name": "local_peers", + "id": 5, + "oneof": "query" + } + ], + "oneofs": { + "query": [ + 2, + 3, + 4, + 5 + ] + } + }, + { + "name": "QueryResult", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "Error", + "name": "error", + "id": 1, + "oneof": "result" + }, + { + "rule": "optional", + "type": "ConfigResult", + "name": "config_result", + "id": 2, + "oneof": "result" + }, + { + "rule": "optional", + "type": "ChaincodeQueryResult", + "name": "cc_query_res", + "id": 3, + "oneof": "result" + }, + { + "rule": "optional", + "type": "PeerMembershipResult", + "name": "members", + "id": 4, + "oneof": "result" + } + ], + "oneofs": { + "result": [ + 1, + 2, + 3, + 4 + ] + } + }, + { + "name": "ConfigQuery", + "syntax": "proto3", + "fields": [] + }, + { + "name": "ConfigResult", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "msp.FabricMSPConfig", + "keytype": "string", + "name": "msps", + "id": 1 + }, + { + "rule": "map", + "type": "Endpoints", + "keytype": "string", + "name": "orderers", + "id": 2 + } + ] + }, + { + "name": "PeerMembershipQuery", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "ChaincodeInterest", + "name": "filter", + "id": 1 + } + ] + }, + { + "name": "PeerMembershipResult", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "Peers", + "keytype": "string", + "name": "peers_by_org", + "id": 1 + } + ] + }, + { + "name": "ChaincodeQuery", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "ChaincodeInterest", + "name": "interests", + "id": 1 + } + ] + }, + { + "name": "ChaincodeInterest", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "ChaincodeCall", + "name": "chaincodes", + "id": 1 + } + ] + }, + { + "name": "ChaincodeCall", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "repeated", + "type": "string", + "name": "collection_names", + "id": 2 + } + ] + }, + { + "name": "ChaincodeQueryResult", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "EndorsementDescriptor", + "name": "content", + "id": 1 + } + ] + }, + { + "name": "LocalPeerQuery", + "syntax": "proto3", + "fields": [] + }, + { + "name": "EndorsementDescriptor", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "chaincode", + "id": 1 + }, + { + "rule": "map", + "type": "Peers", + "keytype": "string", + "name": "endorsers_by_groups", + "id": 2 + }, + { + "rule": "repeated", + "type": "Layout", + "name": "layouts", + "id": 3 + } + ] + }, + { + "name": "Layout", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "uint32", + "keytype": "string", + "name": "quantities_by_group", + "id": 1 + } + ] + }, + { + "name": "Peers", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Peer", + "name": "peers", + "id": 1 + } + ] + }, + { + "name": "Peer", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "gossip.Envelope", + "name": "state_info", + "id": 1 + }, + { + "rule": "optional", + "type": "gossip.Envelope", + "name": "membership_info", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "identity", + "id": 3 + } + ] + }, + { + "name": "Error", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "content", + "id": 1 + } + ] + }, + { + "name": "Endpoints", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Endpoint", + "name": "endpoint", + "id": 1 + } + ] + }, + { + "name": "Endpoint", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "host", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "port", + "id": 2 + } + ] + } + ], + "services": [ + { + "name": "Discovery", + "options": {}, + "rpc": { + "Discover": { + "request": "SignedRequest", + "request_stream": false, + "response": "Response", + "response_stream": false, + "options": {} + } + } + } + ], + "isNamespace": true + }, + { + "name": "orderer", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/orderer", + "java_package": "org.hyperledger.fabric.protos.orderer" + }, + "messages": [ + { + "name": "StepRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 2 + } + ] + }, + { + "name": "StepResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + } + ] + }, + { + "name": "SubmitRequest", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "channel", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "last_validation_seq", + "id": 2 + }, + { + "rule": "optional", + "type": "common.Envelope", + "name": "content", + "id": 3 + } + ] + }, + { + "name": "SubmitResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Status", + "name": "status", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "info", + "id": 2 + } + ] + }, + { + "name": "ConsensusType", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "type", + "id": 1 + }, + { + "rule": "optional", + "type": "bytes", + "name": "metadata", + "id": 2 + }, + { + "rule": "optional", + "type": "MigrationState", + "name": "migration_state", + "id": 3 + }, + { + "rule": "optional", + "type": "uint64", + "name": "migration_context", + "id": 4 + } + ], + "enums": [ + { + "name": "MigrationState", + "syntax": "proto3", + "values": [ + { + "name": "MIG_STATE_NONE", + "id": 0 + }, + { + "name": "MIG_STATE_START", + "id": 1 + }, + { + "name": "MIG_STATE_COMMIT", + "id": 2 + }, + { + "name": "MIG_STATE_ABORT", + "id": 3 + }, + { + "name": "MIG_STATE_CONTEXT", + "id": 4 + } + ] + } + ] + }, + { + "name": "BatchSize", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint32", + "name": "max_message_count", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "absolute_max_bytes", + "id": 2 + }, + { + "rule": "optional", + "type": "uint32", + "name": "preferred_max_bytes", + "id": 3 + } + ] + }, + { + "name": "BatchTimeout", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "timeout", + "id": 1 + } + ] + }, + { + "name": "KafkaBrokers", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "string", + "name": "brokers", + "id": 1 + } + ] + }, + { + "name": "ChannelRestrictions", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "max_count", + "id": 1 + } + ] + }, + { + "name": "KafkaMessage", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "KafkaMessageRegular", + "name": "regular", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "KafkaMessageTimeToCut", + "name": "time_to_cut", + "id": 2, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "KafkaMessageConnect", + "name": "connect", + "id": 3, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2, + 3 + ] + } + }, + { + "name": "KafkaMessageRegular", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "config_seq", + "id": 2 + }, + { + "rule": "optional", + "type": "Class", + "name": "class", + "id": 3 + }, + { + "rule": "optional", + "type": "int64", + "name": "original_offset", + "id": 4 + } + ], + "enums": [ + { + "name": "Class", + "syntax": "proto3", + "values": [ + { + "name": "UNKNOWN", + "id": 0 + }, + { + "name": "NORMAL", + "id": 1 + }, + { + "name": "CONFIG", + "id": 2 + } + ] + } + ] + }, + { + "name": "KafkaMessageTimeToCut", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "block_number", + "id": 1 + } + ] + }, + { + "name": "KafkaMessageConnect", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "payload", + "id": 1 + } + ] + }, + { + "name": "KafkaMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "int64", + "name": "last_offset_persisted", + "id": 1 + }, + { + "rule": "optional", + "type": "int64", + "name": "last_original_offset_processed", + "id": 2 + }, + { + "rule": "optional", + "type": "int64", + "name": "last_resubmitted_config_offset", + "id": 3 + } + ] + }, + { + "name": "BroadcastResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Status", + "name": "status", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "info", + "id": 2 + } + ] + }, + { + "name": "SeekNewest", + "syntax": "proto3", + "fields": [] + }, + { + "name": "SeekOldest", + "syntax": "proto3", + "fields": [] + }, + { + "name": "SeekSpecified", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "number", + "id": 1 + } + ] + }, + { + "name": "SeekPosition", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "SeekNewest", + "name": "newest", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "SeekOldest", + "name": "oldest", + "id": 2, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "SeekSpecified", + "name": "specified", + "id": 3, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2, + 3 + ] + } + }, + { + "name": "SeekInfo", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "SeekPosition", + "name": "start", + "id": 1 + }, + { + "rule": "optional", + "type": "SeekPosition", + "name": "stop", + "id": 2 + }, + { + "rule": "optional", + "type": "SeekBehavior", + "name": "behavior", + "id": 3 + } + ], + "enums": [ + { + "name": "SeekBehavior", + "syntax": "proto3", + "values": [ + { + "name": "BLOCK_UNTIL_READY", + "id": 0 + }, + { + "name": "FAIL_IF_NOT_READY", + "id": 1 + } + ] + } + ] + }, + { + "name": "DeliverResponse", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "common.Status", + "name": "status", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "common.Block", + "name": "block", + "id": 2, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2 + ] + } + } + ], + "services": [ + { + "name": "Cluster", + "options": {}, + "rpc": { + "Submit": { + "request": "SubmitRequest", + "request_stream": true, + "response": "SubmitResponse", + "response_stream": true, + "options": {} + }, + "Step": { + "request": "StepRequest", + "request_stream": false, + "response": "StepResponse", + "response_stream": false, + "options": {} + } + } + }, + { + "name": "AtomicBroadcast", + "options": {}, + "rpc": { + "Broadcast": { + "request": "common.Envelope", + "request_stream": true, + "response": "BroadcastResponse", + "response_stream": true, + "options": {} + }, + "Deliver": { + "request": "common.Envelope", + "request_stream": true, + "response": "DeliverResponse", + "response_stream": true, + "options": {} + } + } + } + ], + "isNamespace": true + }, + { + "name": "etcdraft", + "fields": [], + "syntax": "proto2", + "options": { + "go_package": "github.com/hyperledger/fabric/protos/orderer/etcdraft", + "java_package": "org.hyperledger.fabric.protos.orderer.etcdraft" + }, + "messages": [ + { + "name": "Metadata", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "Consenter", + "name": "consenters", + "id": 1 + }, + { + "rule": "optional", + "type": "Options", + "name": "options", + "id": 2 + } + ] + }, + { + "name": "Consenter", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "host", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "port", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "client_tls_cert", + "id": 3 + }, + { + "rule": "optional", + "type": "bytes", + "name": "server_tls_cert", + "id": 4 + } + ] + }, + { + "name": "Options", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "uint64", + "name": "tick_interval", + "id": 1 + }, + { + "rule": "optional", + "type": "uint32", + "name": "election_tick", + "id": 2 + }, + { + "rule": "optional", + "type": "uint32", + "name": "heartbeat_tick", + "id": 3 + }, + { + "rule": "optional", + "type": "uint32", + "name": "max_inflight_msgs", + "id": 4 + }, + { + "rule": "optional", + "type": "uint64", + "name": "max_size_per_msg", + "id": 5 + }, + { + "rule": "optional", + "type": "uint64", + "name": "snapshot_interval", + "id": 6 + } + ] + }, + { + "name": "RaftMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "map", + "type": "Consenter", + "keytype": "uint64", + "name": "consenters", + "id": 1 + }, + { + "rule": "optional", + "type": "uint64", + "name": "next_consenter_id", + "id": 2 + }, + { + "rule": "optional", + "type": "uint64", + "name": "conf_change_counts", + "id": 3 + }, + { + "rule": "optional", + "type": "uint64", + "name": "raft_index", + "id": 4 + } + ] + } + ], + "isNamespace": true + }, + { + "name": "lifecycle", + "fields": [], + "syntax": "proto2", + "options": { + "java_package": "org.hyperledger.fabric.protos.peer.lifecycle", + "go_package": "github.com/hyperledger/fabric/protos/peer/lifecycle" + }, + "messages": [ + { + "name": "InstallChaincodeArgs", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "chaincode_install_package", + "id": 3 + } + ] + }, + { + "name": "InstallChaincodeResult", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "hash", + "id": 1 + } + ] + }, + { + "name": "QueryInstalledChaincodeArgs", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + } + ] + }, + { + "name": "QueryInstalledChaincodeResult", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "bytes", + "name": "hash", + "id": 1 + } + ] + }, + { + "name": "QueryInstalledChaincodesArgs", + "syntax": "proto3", + "fields": [] + }, + { + "name": "QueryInstalledChaincodesResult", + "syntax": "proto3", + "fields": [ + { + "rule": "repeated", + "type": "InstalledChaincode", + "name": "installed_chaincodes", + "id": 1 + } + ], + "messages": [ + { + "name": "InstalledChaincode", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "name", + "id": 1 + }, + { + "rule": "optional", + "type": "string", + "name": "version", + "id": 2 + }, + { + "rule": "optional", + "type": "bytes", + "name": "hash", + "id": 3 + } + ] + } + ] + }, + { + "name": "StateMetadata", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "datatype", + "id": 1 + }, + { + "rule": "repeated", + "type": "string", + "name": "fields", + "id": 2 + } + ] + }, + { + "name": "StateData", + "syntax": "proto3", + "fields": [ + { + "rule": "optional", + "type": "string", + "name": "String", + "id": 1, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "bytes", + "name": "Bytes", + "id": 2, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "uint64", + "name": "Uint64", + "id": 3, + "oneof": "Type" + }, + { + "rule": "optional", + "type": "int64", + "name": "Int64", + "id": 4, + "oneof": "Type" + } + ], + "oneofs": { + "Type": [ + 1, + 2, + 3, + 4 + ] + } + } + ], + "isNamespace": true + } + ], + "isNamespace": true +} \ No newline at end of file diff --git a/fabric-protos/google-protos/google/protobuf/empty.proto b/fabric-protos/google-protos/google/protobuf/empty.proto new file mode 100644 index 0000000000..8a59a85c65 --- /dev/null +++ b/fabric-protos/google-protos/google/protobuf/empty.proto @@ -0,0 +1,53 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/empty"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} \ No newline at end of file diff --git a/fabric-protos/google-protos/google/protobuf/timestamp.proto b/fabric-protos/google-protos/google/protobuf/timestamp.proto new file mode 100644 index 0000000000..53d26a637a --- /dev/null +++ b/fabric-protos/google-protos/google/protobuf/timestamp.proto @@ -0,0 +1,110 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone +// or calendar, represented as seconds and fractions of seconds at +// nanosecond resolution in UTC Epoch time. It is encoded using the +// Proleptic Gregorian Calendar which extends the Gregorian calendar +// backwards to year one. It is encoded assuming all minutes are 60 +// seconds long, i.e. leap seconds are "smeared" so that no leap second +// table is needed for interpretation. Range is from +// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. +// By restricting to that range, we ensure that we can convert to +// and from RFC 3339 date strings. +// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from current time in Python. +// +// now = time.time() +// seconds = int(now) +// nanos = int((now - seconds) * 10**9) +// timestamp = Timestamp(seconds=seconds, nanos=nanos) +// +// +message Timestamp { + + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} \ No newline at end of file diff --git a/fabric-protos/index.js b/fabric-protos/index.js new file mode 100644 index 0000000000..114405aba3 --- /dev/null +++ b/fabric-protos/index.js @@ -0,0 +1,51 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + */ + +const bundle = require('./bundle'); +const grpc = require('grpc'); +const protobuf = require('protobufjs'); + +// This is a modified version of the grpc.loadObject function. The modifications +// ensure that it works with the JSON output by pbjs, which incorrectly encodes +// namespaces with a class name of "Message". We have no way to tell if a "Message" +// is a "Message" or actually a "Namespace", so we need to treat it as both. +function loadObject(value, options) { + if (!value) { + return value; + } else if (value.hasOwnProperty('ns')) { + return loadObject(value.ns, options); + } else if (value.className === 'Namespace') { + const result = {}; + for (const child of value.children) { + result[child.name] = loadObject(child, options); + } + return result; + } else if (value.className === 'Service') { + return grpc.loadObject(value, {protobufjsVersion: 5}); + } else if (value.className === 'Message' || value.className === 'Enum') { + const result = value.build(); + if (value.className === 'Message') { + for (const child of value.children) { + result[child.name] = loadObject(child, options); + } + } + return result; + } else { + return value; + } +} + +// We have to set the top level syntax to "proto3" to force protobufjs to treat +// the whole JSON output from pbjs as "proto3", otherwise it generates it as if +// it was "proto2", which causes incorrect parsing behaviour. +bundle.syntax = 'proto3'; + +// This generates an export tree with all the namespaces and types under it, for +// example: +// const fabprotos = require('fabric-protos'); +// const block = fabprotos.common.Block.decode(...); +// const gossipClient = new fabprotos.gossip.Gossip(...); +const builder = protobuf.loadJson(bundle); +const root = loadObject(builder.ns, {protobufjsVersion: 5}); +module.exports = root; diff --git a/fabric-protos/package.json b/fabric-protos/package.json new file mode 100644 index 0000000000..7d65903716 --- /dev/null +++ b/fabric-protos/package.json @@ -0,0 +1,43 @@ +{ + "name": "fabric-protos", + "version": "2.0.0-snapshot", + "tag": "unstable", + "description": "Protocol Buffer files and generated JavaScript classes for Hyperledger Fabric", + "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: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", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "github (read mirror)", + "url": "https://github.com/hyperledger/fabric-sdk-node" + }, + "engines": { + "node": "^8.9.0", + "npm": "^5.5.1" + }, + "keywords": [ + "hyperledger", + "blockchain" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "https://github.com/hyperledger/fabric/blob/master/LICENSE" + } + ], + "dependencies": { + "grpc": "1.14.2", + "protobufjs": "5.0.3" + }, + "devDependencies": { + "cpx": "^1.5.0", + "glob": "^7.1.3", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.3" + } +} diff --git a/fabric-protos/protos/common/collection.proto b/fabric-protos/protos/common/collection.proto new file mode 100644 index 0000000000..16e57b556d --- /dev/null +++ b/fabric-protos/protos/common/collection.proto @@ -0,0 +1,90 @@ +/* +Copyright IBM Corp. 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 java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// CollectionConfigPackage represents an array of CollectionConfig +// messages; the extra struct is required because repeated oneof is +// forbidden by the protobuf syntax +message CollectionConfigPackage { + repeated CollectionConfig config = 1; +} + +// CollectionConfig defines the configuration of a collection object; +// it currently contains a single, static type. +// Dynamic collections are deferred. +message CollectionConfig { + oneof payload { + StaticCollectionConfig static_collection_config = 1; + } +} + + +// StaticCollectionConfig constitutes the configuration parameters of a +// static collection object. Static collections are collections that are +// known at chaincode instantiation time, and that cannot be changed. +// Dynamic collections are deferred. +message StaticCollectionConfig { + // the name of the collection inside the denoted chaincode + string name = 1; + // a reference to a policy residing / managed in the config block + // to define which orgs have access to this collection’s private data + CollectionPolicyConfig member_orgs_policy = 2; + // The minimum number of peers private data will be sent to upon + // endorsement. The endorsement would fail if dissemination to at least + // this number of peers is not achieved. + int32 required_peer_count = 3; + // The maximum number of peers that private data will be sent to + // upon endorsement. This number has to be bigger than required_peer_count. + int32 maximum_peer_count = 4; + // The number of blocks after which the collection data expires. + // For instance if the value is set to 10, a key last modified by block number 100 + // will be purged at block number 111. A zero value is treated same as MaxUint64 + uint64 block_to_live = 5; + // The member only read access denotes whether only collection member clients + // can read the private data (if set to true), or even non members can + // read the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + bool member_only_read = 6; + // The member only write access denotes whether only collection member clients + // can write the private data (if set to true), or even non members can + // write the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + bool member_only_write = 7; +} + + +// Collection policy configuration. Initially, the configuration can only +// contain a SignaturePolicy. In the future, the SignaturePolicy may be a +// more general Policy. Instead of containing the actual policy, the +// configuration may in the future contain a string reference to a policy. +message CollectionPolicyConfig { + oneof payload { + // Initially, only a signature policy is supported. + SignaturePolicyEnvelope signature_policy = 1; + // Later, the SignaturePolicy will be replaced by a Policy. + // Policy policy = 1; + // A reference to a Policy is planned to be added later. +// string reference = 2; + } +} + + +// CollectionCriteria defines an element of a private data that corresponds +// to a certain transaction and collection +message CollectionCriteria { + string channel = 1; + string tx_id = 2; + string collection = 3; + string namespace = 4; +} diff --git a/fabric-protos/protos/common/common.proto b/fabric-protos/protos/common/common.proto new file mode 100644 index 0000000000..57fb25a02b --- /dev/null +++ b/fabric-protos/protos/common/common.proto @@ -0,0 +1,178 @@ +/* +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. +*/ + +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/common"; +option java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// These status codes are intended to resemble selected HTTP status codes +enum Status { + UNKNOWN = 0; + SUCCESS = 200; + BAD_REQUEST = 400; + FORBIDDEN = 403; + NOT_FOUND = 404; + REQUEST_ENTITY_TOO_LARGE = 413; + INTERNAL_SERVER_ERROR = 500; + NOT_IMPLEMENTED = 501; + SERVICE_UNAVAILABLE = 503; +} + +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 + CONFIG_UPDATE = 2; // Used for transactions which update the channel config + ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions + ORDERER_TRANSACTION = 4; // Used internally by the orderer for management + 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 + TOKEN_ENDORSER_TRANSACTION = 10; // Used to denote endorsement transactions that use FabToken as payment settlement +} + +// This enum enlists indexes of the block metadata array +enum BlockMetadataIndex { + SIGNATURES = 0; // Block metadata array position for block signatures + LAST_CONFIG = 1; // Block metadata array position to store last configuration block sequence number + TRANSACTIONS_FILTER = 2; // Block metadata array position to store serialized bit array filter of invalid transactions + ORDERER = 3; // Block metadata array position to store operational metadata for orderers + // e.g. For Kafka, this is where we store the last offset written to the local ledger. +} + +// LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index +message LastConfig { + uint64 index = 1; +} + +// Metadata is a common structure to be used to encode block metadata +message Metadata { + bytes value = 1; + repeated MetadataSignature signatures = 2; +} + +message MetadataSignature { + bytes signature_header = 1; // An encoded SignatureHeader + bytes signature = 2; // The signature over the concatenation of the Metadata value bytes, signatureHeader, and block header +} + +message Header { + bytes channel_header = 1; + bytes signature_header = 2; +} + +// Header is a generic replay prevention and identity message to include in a signed payload +message ChannelHeader { + int32 type = 1; // Header types 0-10000 are reserved and defined by HeaderType + + // Version indicates message protocol version + int32 version = 2; + + // Timestamp is the local time when the message was created + // by the sender + google.protobuf.Timestamp timestamp = 3; + + // Identifier of the channel this message is bound for + string channel_id = 4; + + // An unique identifier that is used end-to-end. + // - set by higher layers such as end user or SDK + // - passed to the endorser (which will check for uniqueness) + // - as the header is passed along unchanged, it will be + // be retrieved by the committer (uniqueness check here as well) + // - to be stored in the ledger + string tx_id = 5; + + // The epoch in which this header was generated, where epoch is defined based on block height + // Epoch in which the response has been generated. This field identifies a + // logical window of time. A proposal response is accepted by a peer only if + // two conditions hold: + // 1. the epoch specified in the message is the current epoch + // 2. this message has been only seen once during this epoch (i.e. it hasn't + // been replayed) + uint64 epoch = 6; + + // Extension that may be attached based on the header type + bytes extension = 7; + + // If mutual TLS is employed, this represents + // the hash of the client's TLS certificate + bytes tls_cert_hash = 8; +} + +message SignatureHeader { + // Creator of the message, a marshaled msp.SerializedIdentity + bytes creator = 1; + + // Arbitrary number that may only be used once. Can be used to detect replay attacks. + bytes nonce = 2; +} + +// Payload is the message contents (and header to allow for signing) +message Payload { + + // Header is included to provide identity and prevent replay + Header header = 1; + + // Data, the encoding of which is defined by the type in the header + bytes data = 2; +} + +// Envelope wraps a Payload with a signature so that the message may be authenticated +message Envelope { + // A marshaled Payload + bytes payload = 1; + + // A signature by the creator specified in the Payload header + bytes signature = 2; +} + +// This is finalized block structure to be shared among the orderer and peer +// Note that the BlockHeader chains to the previous BlockHeader, and the BlockData hash is embedded +// in the BlockHeader. This makes it natural and obvious that the Data is included in the hash, but +// the Metadata is not. +message Block { + BlockHeader header = 1; + BlockData data = 2; + BlockMetadata metadata = 3; +} + +// BlockHeader is the element of the block which forms the block chain +// The block header is hashed using the configured chain hashing algorithm +// over the ASN.1 encoding of the BlockHeader +message BlockHeader { + uint64 number = 1; // The position in the blockchain + bytes previous_hash = 2; // The hash of the previous block header + bytes data_hash = 3; // The hash of the BlockData, by MerkleTree +} + +message BlockData { + repeated bytes data = 1; +} + +message BlockMetadata { + repeated bytes metadata = 1; +} diff --git a/fabric-protos/protos/common/configtx.proto b/fabric-protos/protos/common/configtx.proto new file mode 100644 index 0000000000..45528fa997 --- /dev/null +++ b/fabric-protos/protos/common/configtx.proto @@ -0,0 +1,114 @@ +/* +Copyright IBM Corp. 2017 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 java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency +// on previous configuration transactions. +// +// It is generated with the following scheme: +// 1. Retrieve the existing configuration +// 2. Note the config properties (ConfigValue, ConfigPolicy, ConfigGroup) to be modified +// 3. Add any intermediate ConfigGroups to the ConfigUpdate.read_set (sparsely) +// 4. Add any additional desired dependencies to ConfigUpdate.read_set (sparsely) +// 5. Modify the config properties, incrementing each version by 1, set them in the ConfigUpdate.write_set +// Note: any element not modified but specified should already be in the read_set, so may be specified sparsely +// 6. Create ConfigUpdate message and marshal it into ConfigUpdateEnvelope.update and encode the required signatures +// a) Each signature is of type ConfigSignature +// b) The ConfigSignature signature is over the concatenation of signature_header and the ConfigUpdate bytes (which includes a ChainHeader) +// 5. Submit new Config for ordering in Envelope signed by submitter +// a) The Envelope Payload has data set to the marshaled ConfigEnvelope +// b) The Envelope Payload has a header of type Header.Type.CONFIG_UPDATE +// +// The configuration manager will verify: +// 1. All items in the read_set exist at the read versions +// 2. All items in the write_set at a different version than, or not in, the read_set have been appropriately signed according to their mod_policy +// 3. The new configuration satisfies the ConfigSchema +message ConfigEnvelope { + Config config = 1; // A marshaled Config structure + Envelope last_update = 2; // The last CONFIG_UPDATE message which generated this current configuration + // Note that CONFIG_UPDATE has a Payload.Data of a Marshaled ConfigUpdate +} + +message ConfigGroupSchema { + map groups = 1; + map values = 2; + map policies = 3; +} + +message ConfigValueSchema {} + +message ConfigPolicySchema {} + +// Config represents the config for a particular channel +message Config { + // Prevent removed tag re-use + reserved 3; + reserved "type"; + + uint64 sequence = 1; + ConfigGroup channel_group = 2; // channel_group is a bad name for this, it should be changed to root when API breakage is allowed +} + +message ConfigUpdateEnvelope { + bytes config_update = 1; // A marshaled ConfigUpdate structure + repeated ConfigSignature signatures = 2; // Signatures over the config_update +} + +// ConfigUpdate is used to submit a subset of config and to have the orderer apply to Config +// it is always submitted inside a ConfigUpdateEnvelope which allows the addition of signatures +// resulting in a new total configuration. The update is applied as follows: +// 1. The versions from all of the elements in the read_set is verified against the versions in the existing config. +// If there is a mismatch in the read versions, then the config update fails and is rejected. +// 2. Any elements in the write_set with the same version as the read_set are ignored. +// 3. The corresponding mod_policy for every remaining element in the write_set is collected. +// 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected +// 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal +message ConfigUpdate { + // Prevent removed tag re-use + reserved 4; + reserved "type"; + + string channel_id = 1; // Which channel this config update is for + ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set + ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions + map isolated_data = 5; // Data which is not to be reflected in the resulting Config, but is still needed for some other purpose. For instance, rscc_seed_data +} + +// ConfigGroup is the hierarchical data structure for holding config +message ConfigGroup { + uint64 version = 1; + map groups = 2; + map values = 3; + map policies = 4; + string mod_policy = 5; +} + +// ConfigValue represents an individual piece of config data +message ConfigValue { + uint64 version = 1; + bytes value = 2; + string mod_policy = 3; +} + +message ConfigPolicy { + uint64 version = 1; + Policy policy = 2; + string mod_policy = 3; +} + +message ConfigSignature { + bytes signature_header = 1; // A marshaled SignatureHeader + bytes signature = 2; // Signature over the concatenation signatureHeader bytes and config bytes +} diff --git a/fabric-protos/protos/common/configuration.proto b/fabric-protos/protos/common/configuration.proto new file mode 100644 index 0000000000..2bdc8ab74b --- /dev/null +++ b/fabric-protos/protos/common/configuration.proto @@ -0,0 +1,89 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/common"; +option java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "HashingAlgorithm" and a Value of HashingAlgorithm as marshaled protobuf bytes +message HashingAlgorithm { + // Currently supported algorithms are: SHAKE256 + string name = 1; +} + +// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of +// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes +message BlockDataHashingStructure { + // width specifies the width of the Merkle tree to use when computing the BlockDataHash + // in order to replicate flat hashing, set this width to MAX_UINT32 + uint32 width = 1; +} + +// OrdererAddresses is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "OrdererAddresses" and a Value of OrdererAddresses as marshaled protobuf bytes +message OrdererAddresses { + repeated string addresses = 1; +} + +// Consortium represents the consortium context in which the channel was created +message Consortium { + string name = 1; +} + + +// Capabilities message defines the capabilities a particular binary must implement +// for that binary to be able to safely participate in the channel. The capabilities +// message is defined at the /Channel level, the /Channel/Application level, and the +// /Channel/Orderer level. +// +// The /Channel level capabilties define capabilities which both the orderer and peer +// binaries must satisfy. These capabilties might be things like a new MSP type, +// or a new policy type. +// +// The /Channel/Orderer level capabilties define capabilities which must be supported +// by the orderer, but which have no bearing on the behavior of the peer. For instance +// if the orderer changes the logic for how it constructs new channels, only all orderers +// must agree on the new logic. The peers do not need to be aware of this change as +// they only interact with the channel after it has been constructed. +// +// Finally, the /Channel/Application level capabilities define capabilities which the peer +// binary must satisfy, but which have no bearing on the orderer. For instance, if the +// peer adds a new UTXO transaction type, or changes the chaincode lifecycle requirements, +// all peers must agree on the new logic. However, orderers never inspect transactions +// this deeply, and therefore have no need to be aware of the change. +// +// The capabilities strings defined in these messages typically correspond to release +// binary versions (e.g. "V1.1"), and are used primarilly as a mechanism for a fully +// upgraded network to switch from one set of logic to a new one. +// +// Although for V1.1, the orderers must be upgraded to V1.1 prior to the rest of the +// network, going forward, because of the split between the /Channel, /Channel/Orderer +// and /Channel/Application capabilities. It should be possible for the orderer and +// application networks to upgrade themselves independently (with the exception of any +// new capabilities defined at the /Channel level). +message Capabilities { + 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 diff --git a/fabric-protos/protos/common/ledger.proto b/fabric-protos/protos/common/ledger.proto new file mode 100644 index 0000000000..a9b99711c3 --- /dev/null +++ b/fabric-protos/protos/common/ledger.proto @@ -0,0 +1,30 @@ +/* +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. +*/ +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/common"; +option java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// Contains information about the blockchain ledger such as height, current +// block hash, and previous block hash. +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 new file mode 100644 index 0000000000..cef1b8ea4b --- /dev/null +++ b/fabric-protos/protos/common/policies.proto @@ -0,0 +1,79 @@ +/* +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. +*/ + +syntax = "proto3"; + +import "msp/msp_principal.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/common"; +option java_package = "org.hyperledger.fabric.protos.common"; + +package common; + +// 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 { + enum PolicyType { + UNKNOWN = 0; // Reserved to check for proper initialization + SIGNATURE = 1; + MSP = 2; + IMPLICIT_META = 3; + } + int32 type = 1; // For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType + bytes value = 2; +} + +// SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements +message SignaturePolicyEnvelope { + int32 version = 1; + SignaturePolicy rule = 2; + repeated MSPPrincipal identities = 3; +} + +// SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing +// policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent +// to express AND as well as OR, as well as of course N out of the following M policies +// SignedBy implies that the signature is from a valid certificate which is signed by the trusted +// authority specified in the bytes. This will be the certificate itself for a self-signed certificate +// and will be the CA for more traditional certificates +message SignaturePolicy { + message NOutOf { + int32 n = 1; + repeated SignaturePolicy rules = 2; + } + oneof Type { + int32 signed_by = 1; + NOutOf n_out_of = 2; + } +} + +// ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration +// It is implicit because the rule is generate implicitly based on the number of sub policies +// It is meta because it depends only on the result of other policies +// When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy +// of name sub_policy, evaluates the collection and applies the rule. +// For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves +// each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY +// 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures. +message ImplicitMetaPolicy { + enum Rule { + ANY = 0; // Requires any of the sub-policies be satisfied, if no sub-policies exist, always returns true + ALL = 1; // Requires all of the sub-policies be satisfied + MAJORITY = 2; // Requires a strict majority (greater than half) of the sub-policies be satisfied + } + string sub_policy = 1; + Rule rule = 2; +} diff --git a/fabric-protos/protos/discovery/protocol.proto b/fabric-protos/protos/discovery/protocol.proto new file mode 100644 index 0000000000..a88b6e195c --- /dev/null +++ b/fabric-protos/protos/discovery/protocol.proto @@ -0,0 +1,235 @@ +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +syntax = "proto3"; + +import "gossip/message.proto"; +import "msp/msp_config.proto"; +import "msp/identities.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/discovery" ; + +package discovery; + +// Discovery defines a service that serves information about the fabric network +// like which peers, orderers, chaincodes, etc. +service Discovery { + // Discover receives a signed request, and returns a response. + rpc Discover (SignedRequest) returns (Response) {} +} + +// SignedRequest contains a serialized Request in the payload field +// and a signature. +// The identity that is used to verify the signature +// can be extracted from the authentication field of type AuthInfo +// in the Request itself after deserializing it. +message SignedRequest { + bytes payload = 1; + bytes signature = 2; +} + +// Request contains authentication info about the client that sent the request +// and the queries it wishes to query the service +message Request { + // authentication contains information that the service uses to check + // the client's eligibility for the queries. + AuthInfo authentication = 1; + // queries + repeated Query queries = 2; +} + +message Response { + // The results are returned in the same order of the queries + repeated QueryResult results = 1; +} + +// AuthInfo aggregates authentication information that the server uses +// to authenticate the client +message AuthInfo { + // This is the identity of the client that is used to verify the signature + // on the SignedRequest's payload. + // It is a msp.SerializedIdentity in bytes form + bytes client_identity = 1; + + // This is the hash of the client's TLS cert. + // When the network is running with TLS, clients that don't include a certificate + // will be denied access to the service. + // Since the Request is encapsulated with a SignedRequest (which is signed), + // this binds the TLS session to the enrollement identity of the client and + // therefore both authenticates the client to the server, + // and also prevents the server from relaying the request message to another server. + bytes client_tls_cert_hash = 2; +} + +// Query asks for information in the context of a specific channel +message Query { + string channel = 1; + oneof query { + // ConfigQuery is used to query for the configuration of the channel, + // such as FabricMSPConfig, and rorderer endpoints. + // The client has to query a peer it trusts as it doesn't have means to self-verify + // the authenticity of the returned result. + // The result is returned in the form of ConfigResult. + ConfigQuery config_query = 2; + + // PeerMembershipQuery queries for peers in a channel context, + // and returns PeerMembershipResult + PeerMembershipQuery peer_query = 3; + + // ChaincodeQuery queries for chaincodes by their name and version. + // An empty version means any version can by returned. + ChaincodeQuery cc_query = 4; + + // LocalPeerQuery queries for peers in a non channel context, + // and returns PeerMembershipResult + LocalPeerQuery local_peers = 5; + } +} + +// QueryResult contains a result for a given Query. +// The corresponding Query can be inferred by the index of the QueryResult from +// its enclosing Response message. +// QueryResults are ordered in the same order as the Queries are ordered in their enclosing Request. +message QueryResult { + oneof result { + // Error indicates failure or refusal to process the query + Error error = 1; + + // ConfigResult contains the configuration of the channel, + // such as FabricMSPConfig and orderer endpoints + ConfigResult config_result = 2; + + // ChaincodeQueryResult contains information about chaincodes, + // and their corresponding endorsers + ChaincodeQueryResult cc_query_res = 3; + + // PeerMembershipResult contains information about peers, + // such as their identity, endpoints, and channel related state. + PeerMembershipResult members = 4; + } +} + +// ConfigQuery requests a ConfigResult +message ConfigQuery { + +} + +message ConfigResult { + // msps is a map from MSP_ID to FabricMSPConfig + map msps = 1; + // orderers is a map from MSP_ID to endpoint lists of orderers + map orderers = 2; +} + +// PeerMembershipQuery requests PeerMembershipResult. +// The filter field may be optionally populated in order +// for the peer membership to be filtered according to +// chaincodes that are installed on peers and collection +// access control policies. +message PeerMembershipQuery { + ChaincodeInterest filter = 1; +} + +// PeerMembershipResult contains peers mapped by their organizations (MSP_ID) +message PeerMembershipResult { + map peers_by_org = 1; +} + +// ChaincodeQuery requests ChaincodeQueryResults for a given +// list of chaincode invocations. +// Each invocation is a separate one, and the endorsement policy +// is evaluated independantly for each given interest. +message ChaincodeQuery { + repeated ChaincodeInterest interests = 1; +} + +// ChaincodeInterest defines an interest about an endorsement +// for a specific single chaincode invocation. +// Multiple chaincodes indicate chaincode to chaincode invocations. +message ChaincodeInterest { + repeated ChaincodeCall chaincodes = 1; +} + +// ChaincodeCall defines a call to a chaincode. +// It may have collections that are related to the chaincode +message ChaincodeCall { + string name = 1; + repeated string collection_names = 2; +} + +// ChaincodeQueryResult contains EndorsementDescriptors for +// chaincodes +message ChaincodeQueryResult { + repeated EndorsementDescriptor content = 1; +} + +// LocalPeerQuery queries for peers in a non channel context +message LocalPeerQuery { +} + +// EndorsementDescriptor contains information about which peers can be used +// to request endorsement from, such that the endorsement policy would be fulfilled. +// Here is how to compute a set of peers to ask an endorsement from, given an EndorsementDescriptor: +// Let e: G --> P be the endorsers_by_groups field that maps a group to a set of peers. +// Note that applying e on a group g yields a set of peers. +// 1) Select a layout l: G --> N out of the layouts given. +// l is the quantities_by_group field of a Layout, and it maps a group to an integer. +// 2) R = {} (an empty set of peers) +// 3) For each group g in the layout l, compute n = l(g) +// 3.1) Denote P_g as a set of n random peers {p0, p1, ... p_n} selected from e(g) +// 3.2) R = R U P_g (add P_g to R) +// 4) The set of peers R is the peers the client needs to request endorsements from +message EndorsementDescriptor { + string chaincode = 1; + // Specifies the endorsers, separated to groups. + map endorsers_by_groups = 2; + + // Specifies options of fulfulling the endorsement policy. + // Each option lists the group names, and the amount of signatures needed + // from each group. + repeated Layout layouts = 3; +} + +// Layout contains a mapping from a group name to number of peers +// that are needed for fulfilling an endorsement policy +message Layout { + // Specifies how many non repeated signatures of each group + // are needed for endorsement + map quantities_by_group = 1; +} + +// Peers contains a list of Peer(s) +message Peers { + repeated Peer peers = 1; +} + +// Peer contains information about the peer such as its channel specific +// state, and membership information. +message Peer { + // This is an Envelope of a GossipMessage with a gossip.StateInfo message + gossip.Envelope state_info = 1; + // This is an Envelope of a GossipMessage with a gossip.AliveMessage message + gossip.Envelope membership_info = 2; + + // This is the msp.SerializedIdentity of the peer, represented in bytes. + bytes identity = 3; +} + +// Error denotes that something went wrong and contains the error message +message Error { + string content = 1; +} + +// Endpoints is a list of Endpoint(s) +message Endpoints { + repeated Endpoint endpoint = 1; +} + +// Endpoint is a combination of a host and a port +message Endpoint { + string host = 1; + uint32 port = 2; +} + + diff --git a/fabric-protos/protos/gossip/message.proto b/fabric-protos/protos/gossip/message.proto new file mode 100644 index 0000000000..56cb0cd0c3 --- /dev/null +++ b/fabric-protos/protos/gossip/message.proto @@ -0,0 +1,372 @@ +// Copyright IBM Corp. All Rights Reserved. +// +// SPDX-License-Identifier: Apache-2.0 +// +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/gossip" ; + +package gossip; + +import "common/collection.proto"; + +// Gossip +service Gossip { + + // GossipStream is the gRPC stream used for sending and receiving messages + rpc GossipStream (stream Envelope) returns (stream Envelope) {} + + // Ping is used to probe a remote peer's aliveness + rpc Ping (Empty) returns (Empty) {} +} + + +// Envelope contains a marshalled +// GossipMessage and a signature over it. +// It may also contain a SecretEnvelope +// which is a marshalled Secret +message Envelope { + bytes payload = 1; + bytes signature = 2; + SecretEnvelope secret_envelope = 3; +} + +// SecretEnvelope is a marshalled Secret +// and a signature over it. +// The signature should be validated by the peer +// that signed the Envelope the SecretEnvelope +// came with +message SecretEnvelope { + bytes payload = 1; + bytes signature = 2; +} + +// Secret is an entity that might be omitted +// from an Envelope when the remote peer that is receiving +// the Envelope shouldn't know the secret's content. +message Secret { + oneof content { + string internalEndpoint = 1; + } +} + +// GossipMessage defines the message sent in a gossip network +message GossipMessage { + + // used mainly for testing, but will might be used in the future + // for ensuring message delivery by acking + uint64 nonce = 1; + + // The channel of the message. + // Some GossipMessages may set this to nil, because + // they are cross-channels but some may not + bytes channel = 2; + + + enum Tag { + UNDEFINED = 0; + EMPTY = 1; + ORG_ONLY = 2; + CHAN_ONLY = 3; + CHAN_AND_ORG = 4; + CHAN_OR_ORG = 5; + } + + // determines to which peers it is allowed + // to forward the message + Tag tag = 3; + + oneof content { + // Membership + AliveMessage alive_msg = 5; + MembershipRequest mem_req = 6; + MembershipResponse mem_res = 7; + + // Contains a ledger block + DataMessage data_msg = 8; + + // Used for push&pull + GossipHello hello = 9; + DataDigest data_dig = 10; + DataRequest data_req = 11; + DataUpdate data_update = 12; + + // Empty message, used for pinging + Empty empty = 13; + + // ConnEstablish, used for establishing a connection + ConnEstablish conn = 14; + + // Used for relaying information + // about state + StateInfo state_info = 15; + + // Used for sending sets of StateInfo messages + StateInfoSnapshot state_snapshot = 16; + + // Used for asking for StateInfoSnapshots + StateInfoPullRequest state_info_pull_req = 17; + + // Used to ask from a remote peer a set of blocks + RemoteStateRequest state_request = 18; + + // Used to send a set of blocks to a remote peer + RemoteStateResponse state_response = 19; + + // Used to indicate intent of peer to become leader + LeadershipMessage leadership_msg = 20; + + // Used to learn of a peer's certificate + PeerIdentity peer_identity = 21; + + Acknowledgement ack = 22; + + // Used to request private data + RemotePvtDataRequest privateReq = 23; + + // Used to respond to private data requests + RemotePvtDataResponse privateRes = 24; + + // Encapsulates private data used to distribute + // private rwset after the endorsement + PrivateDataMessage private_data = 25; + } +} + +// StateInfo is used for a peer to relay its state information +// to other peers +message StateInfo { + PeerTime timestamp = 2; + bytes pki_id = 3; + + // channel_MAC is an authentication code that proves + // that the peer that sent this message knows + // the name of the channel. + bytes channel_MAC = 4; + + Properties properties = 5; +} + +message Properties { + uint64 ledger_height = 1; + bool left_channel = 2; + repeated Chaincode chaincodes = 3; +} + +// StateInfoSnapshot is an aggregation of StateInfo messages +message StateInfoSnapshot { + repeated Envelope elements = 1; +} + +// StateInfoPullRequest is used to fetch a StateInfoSnapshot +// from a remote peer +message StateInfoPullRequest { + // channel_MAC is an authentication code that proves + // that the peer that sent this message knows + // the name of the channel. + bytes channel_MAC = 1; +} + +// ConnEstablish is the message used for the gossip handshake +// Whenever a peer connects to another peer, it handshakes +// with it by sending this message that proves its identity +message ConnEstablish { + bytes pki_id = 1; + bytes identity = 2; + bytes tls_cert_hash = 3; +} + +// PeerIdentity defines the identity of the peer +// Used to make other peers learn of the identity +// of a certain peer +message PeerIdentity { + bytes pki_id = 1; + bytes cert = 2; + bytes metadata = 3; +} + +// Messages related to pull mechanism + +enum PullMsgType { + UNDEFINED = 0; + BLOCK_MSG = 1; + IDENTITY_MSG = 2; +} + +// DataRequest is a message used for a peer to request +// certain data blocks from a remote peer +message DataRequest { + uint64 nonce = 1; + repeated bytes digests = 2; + PullMsgType msg_type = 3; +} + +// GossipHello is the message that is used for the peer to initiate +// a pull round with another peer +message GossipHello { + uint64 nonce = 1; + bytes metadata = 2; + PullMsgType msg_type = 3; +} + +// DataUpdate is the final message in the pull phase +// sent from the receiver to the initiator +message DataUpdate { + uint64 nonce = 1; + repeated Envelope data = 2; + PullMsgType msg_type = 3; +} + +// DataDigest is the message sent from the receiver peer +// to the initator peer and contains the data items it has +message DataDigest { + uint64 nonce = 1; + repeated bytes digests = 2; // Maybe change this to bitmap later on + PullMsgType msg_type = 3; +} + + +// Ledger block messages + +// DataMessage is the message that contains a block +message DataMessage { + Payload payload = 1; +} + +// PrivateDataMessage message which includes private +// data information to distributed once transaction +// has been endorsed +message PrivateDataMessage { + PrivatePayload payload = 1; +} + +// Payload contains a block +message Payload { + uint64 seq_num = 1; + bytes data = 2; + repeated bytes private_data = 3; +} + +// PrivatePayload payload to encapsulate private +// data with collection name to enable routing +// based on collection partitioning +message PrivatePayload { + string collection_name = 1; + string namespace = 2; + string tx_id = 3; + bytes private_rwset = 4; + uint64 private_sim_height = 5; + common.CollectionConfigPackage collection_configs = 6; +} + +// Membership messages + +// AliveMessage is sent to inform remote peers +// of a peer's existence and activity +message AliveMessage { + Member membership = 1; + PeerTime timestamp = 2; + bytes identity = 4; +} + +// Leadership Message is sent during leader election to inform +// remote peers about intent of peer to proclaim itself as leader +message LeadershipMessage { + bytes pki_id = 1; + PeerTime timestamp = 2; + bool is_declaration = 3; +} + +// PeerTime defines the logical time of a peer's life +message PeerTime { + uint64 inc_num = 1; + uint64 seq_num = 2; +} + +// MembershipRequest is used to ask membership information +// from a remote peer +message MembershipRequest { + Envelope self_information = 1; + repeated bytes known = 2; +} + +// MembershipResponse is used for replying to MembershipRequests +message MembershipResponse { + repeated Envelope alive = 1; + repeated Envelope dead = 2; +} + +// Member holds membership-related information +// about a peer +message Member { + string endpoint = 1; + bytes metadata = 2; + bytes pki_id = 3; +} + +// Empty is used for pinging and in tests +message Empty {} + + +// State transfer + +// RemoteStateRequest is used to ask a set of blocks +// from a remote peer +message RemoteStateRequest { + uint64 start_seq_num = 1; + uint64 end_seq_num = 2; +} + +// RemoteStateResponse is used to send a set of blocks +// to a remote peer +message RemoteStateResponse { + repeated Payload payloads = 1; +} + +// RemotePrivateDataRequest message used to request +// missing private rwset +message RemotePvtDataRequest { + repeated PvtDataDigest digests = 1; +} + +// PvtDataDigest defines a digest of private data +message PvtDataDigest { + string tx_id = 1; + string namespace = 2; + string collection = 3; + uint64 block_seq = 4; + uint64 seq_in_block = 5; +} + +// RemotePrivateData message to response on private +// data replication request +message RemotePvtDataResponse { + repeated PvtDataElement elements = 1; +} + +message PvtDataElement { + PvtDataDigest digest = 1; + // the payload is a marshaled kvrwset.KVRWSet + repeated bytes payload = 2; +} + +// PvtPayload augments private rwset data and tx index +// inside the block +message PvtDataPayload { + uint64 tx_seq_in_block = 1; + // Encodes marhslaed bytes of rwset.TxPvtReadWriteSet + // defined in rwset.proto + bytes payload = 2; +} + +message Acknowledgement { + string error = 1; +} + +// Chaincode represents a Chaincode that is installed +// on a peer +message Chaincode { + string name = 1; + string version = 2; + bytes metadata = 3; +} \ No newline at end of file diff --git a/fabric-protos/protos/idemix/idemix.proto b/fabric-protos/protos/idemix/idemix.proto new file mode 100644 index 0000000000..56b546d651 --- /dev/null +++ b/fabric-protos/protos/idemix/idemix.proto @@ -0,0 +1,144 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/idemix"; + +// The Identity Mixer protocols make use of pairings (bilinear maps) - +// functions that can be described as e: G1 x G2 -> GT that +// map group elements from the source groups (G1 and G2) to the target group +// Such groups can be represented by the points on an elliptic curve + +// ECP is an elliptic curve point specified by its coordinates +// ECP corresponds to an element of the first group (G1) +message ECP { + bytes x = 1; + bytes y = 2; +} + +// ECP2 is an elliptic curve point specified by its coordinates +// ECP2 corresponds to an element of the second group (G2) +message ECP2 { + bytes xa = 1; + bytes xb = 2; + bytes ya = 3; + bytes yb = 4; +} + +// IssuerPublicKey specifies an issuer public key that consists of +// attribute_names - a list of the attribute names of a credential issued by the issuer +// h_sk, h_rand, h_attrs, w, bar_g1, bar_g2 - group elements corresponding to the signing key, randomness, and attributes +// proof_c, proof_s compose a zero-knowledge proof of knowledge of the secret key +// hash is a hash of the public key appended to it +message IssuerPublicKey { + repeated string attribute_names = 1; + ECP h_sk = 2; + ECP h_rand = 3; + repeated ECP h_attrs = 4; + ECP2 w = 5; + ECP bar_g1 = 6; + ECP bar_g2 = 7; + bytes proof_c = 8; + bytes proof_s = 9; + bytes hash = 10; +} + +// IssuerKey specifies an issuer key pair that consists of +// ISk - the issuer secret key and +// IssuerPublicKey - the issuer public key +message IssuerKey { + bytes isk = 1; + IssuerPublicKey ipk = 2; +} + +// Credential specifies a credential object that consists of +// a, b, e, s - signature value +// attrs - attribute values +message Credential { + ECP a = 1; + ECP b = 2; + bytes e = 3; + bytes s = 4; + repeated bytes attrs = 5; +} + +// CredRequest specifies a credential request object that consists of +// nym - a pseudonym, which is a commitment to the user secret +// issuer_nonce - a random nonce provided by the issuer +// proof_c, proof_s - a zero-knowledge proof of knowledge of the +// user secret inside Nym +message CredRequest { + ECP nym = 1; + bytes issuer_nonce = 2; + bytes proof_c = 3; + bytes proof_s = 4; +} + +// Signature specifies a signature object that consists of +// a_prime, a_bar, b_prime, proof_* - randomized credential signature values +// and a zero-knowledge proof of knowledge of a credential +// and the corresponding user secret together with the attribute values +// nonce - a fresh nonce used for the signature +// nym - a fresh pseudonym (a commitment to to the user secret) +message Signature { + ECP a_prime = 1; + ECP a_bar = 2; + ECP b_prime = 3; + bytes proof_c = 4; + bytes proof_s_sk = 5; + bytes proof_s_e = 6; + bytes proof_s_r2 = 7; + bytes proof_s_r3 = 8; + bytes proof_s_s_prime = 9; + repeated bytes proof_s_attrs = 10; + bytes nonce = 11; + ECP nym = 12; + bytes proof_s_r_nym = 13; + ECP2 revocation_epoch_pk = 14; + bytes revocation_pk_sig = 15; + int64 epoch = 16; + NonRevocationProof non_revocation_proof = 17; +} + +// NonRevocationProof contains proof that the credential is not revoked +message NonRevocationProof { + int32 revocation_alg = 1; + bytes non_revocation_proof = 2; +} + +// NymSignature specifies a signature object that signs a message +// with respect to a pseudonym. It differs from the standard idemix.signature in the fact that +// the standard signature object also proves that the pseudonym is based on a secret certified by +// a CA (issuer), whereas NymSignature only proves that the the owner of the pseudonym +// signed the message +message NymSignature { + // proof_c is the Fiat-Shamir challenge of the ZKP + bytes proof_c = 1; + // proof_s_sk is the s-value proving knowledge of the user secret key + bytes proof_s_sk = 2; + //proof_s_r_nym is the s-value proving knowledge of the pseudonym secret + bytes proof_s_r_nym = 3; + // nonce is a fresh nonce used for the signature + bytes nonce = 4; +} + +message CredentialRevocationInformation { + // epoch contains the epoch (time window) in which this CRI is valid + int64 epoch = 1; + + // epoch_pk is the public key that is used by the revocation authority in this epoch + ECP2 epoch_pk = 2; + + // epoch_pk_sig is a signature on the EpochPK valid under the revocation authority's long term key + bytes epoch_pk_sig = 3; + + // revocation_alg denotes which revocation algorithm is used + int32 revocation_alg = 4; + + // revocation_data contains data specific to the revocation algorithm used + bytes revocation_data = 5; +} \ 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 new file mode 100644 index 0000000000..3b8d106586 --- /dev/null +++ b/fabric-protos/protos/ledger/queryresult/kv_query_result.proto @@ -0,0 +1,41 @@ +/* +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. +*/ + +syntax = "proto3"; + +package queryresult; + +option go_package = "github.com/hyperledger/fabric/protos/ledger/queryresult"; +option java_package = "org.hyperledger.fabric.protos.ledger.queryresult"; + +import "google/protobuf/timestamp.proto"; + + +// KV -- QueryResult for range/execute query. Holds a key and corresponding value. +message KV { + string namespace = 1; + string key = 2; + bytes value = 3; +} + +// KeyModification -- QueryResult for history query. Holds a transaction ID, value, +// timestamp, and delete marker which resulted from a history query. +message KeyModification { + string tx_id = 1; + bytes value = 2; + google.protobuf.Timestamp timestamp = 3; + bool is_delete = 4; +} diff --git a/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto b/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto new file mode 100644 index 0000000000..d1c480e897 --- /dev/null +++ b/fabric-protos/protos/ledger/rwset/kvrwset/kv_rwset.proto @@ -0,0 +1,116 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset"; +option java_package = "org.hyperledger.fabric.protos.ledger.rwset.kvrwset"; + +package kvrwset; + +// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model +// This structure is used for both the public data and the private data +message KVRWSet { + repeated KVRead reads = 1; + repeated RangeQueryInfo range_queries_info = 2; + repeated KVWrite writes = 3; + repeated KVMetadataWrite metadata_writes = 4; +} + +// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model +message HashedRWSet { + repeated KVReadHash hashed_reads = 1; + repeated KVWriteHash hashed_writes = 2; + repeated KVMetadataWriteHash metadata_writes = 3; +} + +// KVRead captures a read operation performed during transaction simulation +// A 'nil' version indicates a non-existing key read by the transaction +message KVRead { + string key = 1; + Version version = 2; +} + +// KVWrite captures a write (update/delete) operation performed during transaction simulation +message KVWrite { + string key = 1; + bool is_delete = 2; + bytes value = 3; +} + +// KVMetadataWrite captures all the entries in the metadata associated with a key +message KVMetadataWrite { + string key = 1; + repeated KVMetadataEntry entries = 2; +} + +// KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself +// version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the +// hash of the version and hence of 'bytes' type +message KVReadHash { + bytes key_hash = 1; + Version version = 2; +} + +// KVWriteHash is similar to the KVWrite. It captures a write (update/delete) operation performed during transaction simulation +message KVWriteHash { + bytes key_hash = 1; + bool is_delete = 2; + bytes value_hash = 3; +} + +// KVMetadataWriteHash captures all the upserts to the metadata associated with a key hash +message KVMetadataWriteHash { + bytes key_hash = 1; + repeated KVMetadataEntry entries = 2; +} + +// KVMetadataEntry captures a 'name'ed entry in the metadata of a key/key-hash. +message KVMetadataEntry { + string name = 1; + bytes value = 2; +} + +// Version encapsulates the version of a Key +// A version of a committed key is maintained as the height of the transaction that committed the key. +// The height is represenetd as a tuple where the txNum is the position of the transaction +// (starting with 0) within block +message Version { + uint64 block_num = 1; + uint64 tx_num = 2; +} + +// RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. +// This helps protect transactions from phantom reads by varifying during validation whether any new items +// got committed within the given range between transaction simuation and validation +// (in addition to regular checks for updates/deletes of the existing items). +// readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash +// if the KVReads exceeds a pre-configured numbers +message RangeQueryInfo { + string start_key = 1; + string end_key = 2; + bool itr_exhausted = 3; + oneof reads_info { + QueryReads raw_reads = 4; + QueryReadsMerkleSummary reads_merkle_hashes = 5; + } +} + +// QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution +message QueryReads { + repeated KVRead kv_reads = 1; +} + +// QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads +// This allows to reduce the size of RWSet in the presence of query results +// by storing certain hashes instead of actual results. +// maxDegree field refers to the maximum number of children in the tree at any level +// maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level) +message QueryReadsMerkleSummary { + uint32 max_degree = 1; + uint32 max_level = 2; + repeated bytes max_level_hashes = 3; +} diff --git a/fabric-protos/protos/ledger/rwset/rwset.proto b/fabric-protos/protos/ledger/rwset/rwset.proto new file mode 100644 index 0000000000..7f7e6c7740 --- /dev/null +++ b/fabric-protos/protos/ledger/rwset/rwset.proto @@ -0,0 +1,65 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/ledger/rwset"; +option java_package = "org.hyperledger.fabric.protos.ledger.rwset"; + +package rwset; + +// TxReadWriteSet encapsulates a read-write set for a transaction +// DataModel specifies the enum value of the data model +// ns_rwset field specifies a list of chaincode specific read-write set (one for each chaincode) +message TxReadWriteSet { + enum DataModel { + KV = 0; + } + DataModel data_model = 1; + repeated NsReadWriteSet ns_rwset = 2; +} + +// NsReadWriteSet encapsulates the read-write set for a chaincode +message NsReadWriteSet { + string namespace = 1; + bytes rwset = 2; // Data model specific serialized proto message (e.g., kvrwset.KVRWSet for KV and Document data models) + repeated CollectionHashedReadWriteSet collection_hashed_rwset = 3; +} + +// CollectionHashedReadWriteSet encapsulate the hashed representation for the private read-write set for a collection +message CollectionHashedReadWriteSet { + string collection_name = 1; + bytes hashed_rwset = 2; // Data model specific serialized proto message (e.g., kvrwset.HashedRWSet for KV and Document data models) + bytes pvt_rwset_hash = 3; // Hash of entire private read-write set for a specific collection. This helps in authenticating the private read-write set efficiently +} + +// TxPvtReadWriteSet encapsulate the private read-write set for a transaction +message TxPvtReadWriteSet { + TxReadWriteSet.DataModel data_model = 1; + repeated NsPvtReadWriteSet ns_pvt_rwset = 2; +} + +// NsPvtReadWriteSet encapsulates the private read-write set for a chaincode +message NsPvtReadWriteSet { + string namespace = 1; + repeated CollectionPvtReadWriteSet collection_pvt_rwset = 2; +} + +// CollectionPvtReadWriteSet encapsulates the private read-write set for a collection +message CollectionPvtReadWriteSet { + string collection_name = 1; + bytes rwset = 2; // Data model specific serialized proto message (e.g., kvrwset.KVRWSet for KV and Document data models) +} diff --git a/fabric-protos/protos/msp/identities.proto b/fabric-protos/protos/msp/identities.proto new file mode 100644 index 0000000000..fef457c851 --- /dev/null +++ b/fabric-protos/protos/msp/identities.proto @@ -0,0 +1,49 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/msp"; +option java_package = "org.hyperledger.fabric.protos.msp"; + +package msp; + +// This struct represents an Identity +// (with its MSP identifier) to be used +// to serialize it and deserialize it +message SerializedIdentity { + // The identifier of the associated membership service provider + string mspid = 1; + + // the Identity, serialized according to the rules of its MPS + bytes id_bytes = 2; +} + +// This struct represents an Idemix Identity +// to be used to serialize it and deserialize it. +// The IdemixMSP will first serialize an idemix identity to bytes using +// this proto, and then uses these bytes as id_bytes in SerializedIdentity +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; + + // 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; + + // ou contains the organizational unit of the idemix identity + 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 new file mode 100644 index 0000000000..542f06d827 --- /dev/null +++ b/fabric-protos/protos/msp/msp_config.proto @@ -0,0 +1,208 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/msp"; +option java_package = "org.hyperledger.fabric.protos.msp"; +option java_outer_classname = "MspConfigPackage"; + +package msp; + +// MSPConfig collects all the configuration information for +// an MSP. The Config field should be unmarshalled in a way +// that depends on the Type +message MSPConfig { + // Type holds the type of the MSP; the default one would + // be of type FABRIC implementing an X.509 based provider + int32 type = 1; + + // Config is MSP dependent configuration info + bytes config = 2; +} + +// FabricMSPConfig collects all the configuration information for +// a Fabric MSP. +// Here we assume a default certificate validation policy, where +// any certificate signed by any of the listed rootCA certs would +// be considered as valid under this MSP. +// This MSP may or may not come with a signing identity. If it does, +// it can also issue signing identities. If it does not, it can only +// be used to validate and verify certificates. +message FabricMSPConfig { + // Name holds the identifier of the MSP; MSP identifier + // is chosen by the application that governs this MSP. + // For example, and assuming the default implementation of MSP, + // that is X.509-based and considers a single Issuer, + // this can refer to the Subject OU field or the Issuer OU field. + string name = 1; + + // List of root certificates trusted by this MSP + // they are used upon certificate validation (see + // comment for IntermediateCerts below) + repeated bytes root_certs = 2; + + // List of intermediate certificates trusted by this MSP; + // they are used upon certificate validation as follows: + // validation attempts to build a path from the certificate + // to be validated (which is at one end of the path) and + // one of the certs in the RootCerts field (which is at + // the other end of the path). If the path is longer than + // 2, certificates in the middle are searched within the + // IntermediateCerts pool + repeated bytes intermediate_certs = 3; + + // Identity denoting the administrator of this MSP + repeated bytes admins = 4; + + // Identity revocation list + repeated bytes revocation_list = 5; + + // SigningIdentity holds information on the signing identity + // this peer is to use, and which is to be imported by the + // MSP defined before + SigningIdentityInfo signing_identity = 6; + + // OrganizationalUnitIdentifiers holds one or more + // fabric organizational unit identifiers that belong to + // this MSP configuration + repeated FabricOUIdentifier organizational_unit_identifiers = 7; + + // FabricCryptoConfig contains the configuration parameters + // for the cryptographic algorithms used by this MSP + FabricCryptoConfig crypto_config = 8; + + // List of TLS root certificates trusted by this MSP. + // They are returned by GetTLSRootCerts. + repeated bytes tls_root_certs = 9; + + // List of TLS intermediate certificates trusted by this MSP; + // They are returned by GetTLSIntermediateCerts. + repeated bytes tls_intermediate_certs = 10; + + // fabric_node_ous contains the configuration to distinguish clients from peers from orderers + // based on the OUs. + FabricNodeOUs fabric_node_ous = 11; +} + +// FabricCryptoConfig contains configuration parameters +// for the cryptographic algorithms used by the MSP +// this configuration refers to +message FabricCryptoConfig { + + // SignatureHashFamily is a string representing the hash family to be used + // during sign and verify operations. + // Allowed values are "SHA2" and "SHA3". + string signature_hash_family = 1; + + // IdentityIdentifierHashFunction is a string representing the hash function + // to be used during the computation of the identity identifier of an MSP identity. + // Allowed values are "SHA256", "SHA384" and "SHA3_256", "SHA3_384". + string identity_identifier_hash_function = 2; + +} + +// IdemixMSPConfig collects all the configuration information for +// an Idemix MSP. +message IdemixMSPConfig { + // Name holds the identifier of the MSP + string name = 1; + + // ipk represents the (serialized) issuer public key + bytes ipk = 2; + + // signer may contain crypto material to configure a default signer + IdemixMSPSignerConfig signer = 3; + + // revocation_pk is the public key used for revocation of credentials + bytes revocation_pk = 4; + + // epoch represents the current epoch (time interval) used for revocation + int64 epoch = 5; +} + +// IdemixMSPSIgnerConfig contains the crypto material to set up an idemix signing identity +message IdemixMSPSignerConfig { + // cred represents the serialized idemix credential of the default signer + bytes cred = 1; + + // sk is the secret key of the default signer, corresponding to credential Cred + bytes sk = 2; + + // organizational_unit_identifier defines the organizational unit the default signer is in + string organizational_unit_identifier = 3; + + // role defines whether the default signer is admin, peer, member or client + int32 role = 4; + + // enrollment_id contains the enrollment id of this signer + string enrollment_id = 5; + + // credential_revocation_information contains a serialized CredentialRevocationInformation + bytes credential_revocation_information = 6; +} + +// SigningIdentityInfo represents the configuration information +// related to the signing identity the peer is to use for generating +// endorsements +message SigningIdentityInfo { + // PublicSigner carries the public information of the signing + // identity. For an X.509 provider this would be represented by + // an X.509 certificate + bytes public_signer = 1; + + // PrivateSigner denotes a reference to the private key of the + // peer's signing identity + KeyInfo private_signer = 2; +} + +// KeyInfo represents a (secret) key that is either already stored +// in the bccsp/keystore or key material to be imported to the +// bccsp key-store. In later versions it may contain also a +// keystore identifier +message KeyInfo { + // Identifier of the key inside the default keystore; this for + // the case of Software BCCSP as well as the HSM BCCSP would be + // the SKI of the key + string key_identifier = 1; + + // KeyMaterial (optional) for the key to be imported; this is + // properly encoded key bytes, prefixed by the type of the key + bytes key_material = 2; +} + +// FabricOUIdentifier represents an organizational unit and +// its related chain of trust identifier. +message FabricOUIdentifier { + + // Certificate represents the second certificate in a certification chain. + // (Notice that the first certificate in a certification chain is supposed + // to be the certificate of an identity). + // It must correspond to the certificate of root or intermediate CA + // recognized by the MSP this message belongs to. + // Starting from this certificate, a certification chain is computed + // and bound to the OrganizationUnitIdentifier specified + bytes certificate = 1; + + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + string organizational_unit_identifier = 2; +} + +// FabricNodeOUs contains configuration to tell apart clients from peers from orderers +// based on OUs. If NodeOUs recognition is enabled then an msp identity +// that does not contain any of the specified OU will be considered invalid. +message FabricNodeOUs { + // If true then an msp identity that does not contain any of the specified OU will be considered invalid. + bool enable = 1; + + // OU Identifier of the clients + FabricOUIdentifier client_ou_identifier = 2; + + // OU Identifier of the peers + FabricOUIdentifier peer_ou_identifier = 3; + +} \ No newline at end of file diff --git a/fabric-protos/protos/msp/msp_principal.proto b/fabric-protos/protos/msp/msp_principal.proto new file mode 100644 index 0000000000..972f0fe4dc --- /dev/null +++ b/fabric-protos/protos/msp/msp_principal.proto @@ -0,0 +1,153 @@ +/* +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. +*/ + + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/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 +// the configuration.proto file. This does not represent the MSP +// configuration for a chain, but is understood by MSPs + +// MSPPrincipal aims to represent an MSP-centric set of identities. +// In particular, this structure allows for definition of +// - a group of identities that are member of the same MSP +// - a group of identities that are member of the same organization unit +// in the same MSP +// - a group of identities that are administering a specific MSP +// - a specific identity +// Expressing these groups is done given two fields of the fields below +// - Classification, that defines the type of classification of identities +// in an MSP this principal would be defined on; Classification can take +// three values: +// (i) ByMSPRole: that represents a classification of identities within +// MSP based on one of the two pre-defined MSP rules, "member" and "admin" +// (ii) ByOrganizationUnit: that represents a classification of identities +// within MSP based on the organization unit an identity belongs to +// (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single +// 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 + // administrator of an MSP network + ORGANIZATION_UNIT = 1; // Denotes a finer grained (affiliation-based) + // groupping of entities, per MSP affiliation + // E.g., this can well be represented by an MSP's + // Organization unit + IDENTITY = 2; // Denotes a principal that consists of a single + // identity + ANONYMITY = 3; // Denotes a principal that can be used to enforce + // an identity to be anonymous or nominal. + COMBINED = 4; // Denotes a combined principal + } + + // Classification describes the way that one should process + // Principal. An Classification value of "ByOrganizationUnit" reflects + // that "Principal" contains the name of an organization this MSP + // handles. A Classification value "ByIdentity" means that + // "Principal" contains a specific identity. Default value + // denotes that Principal contains one of the groups by + // default supported by all MSPs ("admin" or "member"). + Classification principal_classification = 1; + + // Principal completes the policy principal definition. For the default + // principal types, Principal can be either "Admin" or "Member". + // For the ByOrganizationUnit/ByIdentity values of Classification, + // PolicyPrincipal acquires its value from an organization unit or + // identity, respectively. + // For the Combined Classification type, the Principal is a marshalled + // CombinedPrincipal. + bytes principal = 2; +} + + +// OrganizationUnit governs the organization of the Principal +// field of a policy principal when a specific organization unity members +// are to be defined within a policy principal. +message OrganizationUnit { + + // MSPIdentifier represents the identifier of the MSP this organization unit + // refers to + string msp_identifier = 1; + + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + string organizational_unit_identifier = 2; + + // CertifiersIdentifier is the hash of certificates chain of trust + // related to this organizational unit + bytes certifiers_identifier = 3; +} + +// MSPRole governs the organization of the Principal +// 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; + + enum MSPRoleType { + MEMBER = 0; // Represents an MSP Member + ADMIN = 1; // Represents an MSP Admin + CLIENT = 2; // Represents an MSP Client + PEER = 3; // Represents an MSP Peer + } + + // 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; +} + +// TODO: Bring msp.SerializedIdentity from fabric/msp/identities.proto here. Reason below. +// SerializedIdentity represents an serialized version of an identity; +// this consists of an MSP-identifier this identity would correspond to +// and the bytes of the actual identity. A serialized form of +// SerializedIdentity would govern "Principal" field of a PolicyPrincipal +// of classification "ByIdentity". diff --git a/fabric-protos/protos/orderer/ab.proto b/fabric-protos/protos/orderer/ab.proto new file mode 100644 index 0000000000..b9b47d90a7 --- /dev/null +++ b/fabric-protos/protos/orderer/ab.proto @@ -0,0 +1,80 @@ +/* +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. +*/ + +syntax = "proto3"; + +import "common/common.proto"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +message BroadcastResponse { + // Status code, which may be used to programatically respond to success/failure + common.Status status = 1; + // Info string which may contain additional information about the status returned + string info = 2; +} + +message SeekNewest { } + +message SeekOldest { } + +message SeekSpecified { + uint64 number = 1; +} + +message SeekPosition { + oneof Type { + SeekNewest newest = 1; + SeekOldest oldest = 2; + SeekSpecified specified = 3; + } +} + +// SeekInfo specifies the range of requested blocks to return +// If the start position is not found, an error is immediately returned +// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated +// by the SeekBehavior specified. If BLOCK_UNTIL_READY is specified, the reply will block until +// the requested blocks are available, if FAIL_IF_NOT_READY is specified, the reply will return an +// error indicating that the block is not found. To request that all blocks be returned indefinitely +// as they are created, behavior should be set to BLOCK_UNTIL_READY and the stop should be set to +// specified with a number of MAX_UINT64 +message SeekInfo { + enum SeekBehavior { + BLOCK_UNTIL_READY = 0; + FAIL_IF_NOT_READY = 1; + } + SeekPosition start = 1; // The position to start the deliver from + SeekPosition stop = 2; // The position to stop the deliver + SeekBehavior behavior = 3; // The behavior when a missing block is encountered +} + +message DeliverResponse { + oneof Type { + common.Status status = 1; + common.Block block = 2; + } +} + +service AtomicBroadcast { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse) {} + + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + rpc Deliver(stream common.Envelope) returns (stream DeliverResponse) {} +} diff --git a/fabric-protos/protos/orderer/cluster.proto b/fabric-protos/protos/orderer/cluster.proto new file mode 100644 index 0000000000..fe5b07f468 --- /dev/null +++ b/fabric-protos/protos/orderer/cluster.proto @@ -0,0 +1,57 @@ +/* +Copyright IBM Corp. 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 java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +// Cluster defines communication between cluster members. +service Cluster { + // Submit submits transactions to a cluster member + rpc Submit(stream SubmitRequest) returns (stream SubmitResponse); + // Step passes an implementation-specific message to another cluster member. + rpc Step(StepRequest) returns (StepResponse); +} + +// StepRequest wraps a consensus implementation +// specific message that is sent to a cluster member +message StepRequest { + string channel = 1; + bytes payload = 2; +} + +// StepResponse wraps a consensus implementation +// specific message that is received from +// a cluster member as a response to a StepRequest +message StepResponse { + bytes payload = 1; +} + +// SubmitRequest wraps a transaction to be sent for ordering +message SubmitRequest { + string channel = 1; + // last_validation_seq denotes the last + // configuration sequence at which the + // sender validated this message + uint64 last_validation_seq = 2; + // content is the fabric transaction + // that is forwarded to the cluster member + common.Envelope content = 3; +} + +// SubmitResponse returns a success +// or failure status to the sender +message SubmitResponse { + // Status code, which may be used to programatically respond to success/failure + common.Status status = 1; + // Info string which may contain additional information about the status returned + string info = 2; +} \ No newline at end of file diff --git a/fabric-protos/protos/orderer/configuration.proto b/fabric-protos/protos/orderer/configuration.proto new file mode 100644 index 0000000000..08e6c6db09 --- /dev/null +++ b/fabric-protos/protos/orderer/configuration.proto @@ -0,0 +1,86 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/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" +// For example, for the configuration item of name "ConsensusType" +// the encoded value is the proto message "ConsensusType" + +message ConsensusType { + string type = 1; + // Opaque metadata, dependent on the consensus type. + bytes metadata = 2; + + // MigrationState defines the possible states of a consensus-type migration. + // NONE represents that migration is not taking place. + enum MigrationState { + MIG_STATE_NONE = 0; + MIG_STATE_START = 1; + MIG_STATE_COMMIT = 2; + MIG_STATE_ABORT = 3; + MIG_STATE_CONTEXT = 4; + } + // The state of a consensus-type migration. + // On the system channel this could be START|COMMIT|ABORT. + // On a standard channel this is CONTEXT. + // When migration is not taking place it is set to NONE. + MigrationState migration_state = 3; + // The context of a standard channel consensus-type migration. + // On a standard channel, this is the system channel block height of the config-update-tx that START migration. + // On a standard channel, this must be >0. On a system channel, this is =0. + // When migration is not taking place it is set =0. + uint64 migration_context = 4; +} + +message BatchSize { + // Simply specified as number of messages for now, in the future + // we may want to allow this to be specified by size in bytes + uint32 max_message_count = 1; + // The byte count of the serialized messages in a batch cannot + // exceed this value. + uint32 absolute_max_bytes = 2; + // The byte count of the serialized messages in a batch should not + // exceed this value. + uint32 preferred_max_bytes = 3; +} + +message BatchTimeout { + // Any duration string parseable by ParseDuration(): + // https://golang.org/pkg/time/#ParseDuration + string timeout = 1; +} + +// Carries a list of bootstrap brokers, i.e. this is not the exclusive set of +// brokers an ordering service +message KafkaBrokers { + // Each broker here should be identified using the (IP|host):port notation, + // e.g. 127.0.0.1:7050, or localhost:7050 are valid entries + repeated string brokers = 1; +} + +// ChannelRestrictions is the mssage which conveys restrictions on channel creation for an orderer +message ChannelRestrictions { + uint64 max_count = 1; // The max count of channels to allow to be created, a value of 0 indicates no limit +} diff --git a/fabric-protos/protos/orderer/etcdraft/configuration.proto b/fabric-protos/protos/orderer/etcdraft/configuration.proto new file mode 100644 index 0000000000..454e624fa7 --- /dev/null +++ b/fabric-protos/protos/orderer/etcdraft/configuration.proto @@ -0,0 +1,54 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer/etcdraft"; +option java_package = "org.hyperledger.fabric.protos.orderer.etcdraft"; + +package etcdraft; + +// Metadata is serialized and set as the value of ConsensusType.Metadata in +// a channel configuration when the ConsensusType.Type is set "etcdraft". +message Metadata { + repeated Consenter consenters = 1; + Options options = 2; +} + +// Consenter represents a consenting node (i.e. replica). +message Consenter { + string host = 1; + uint32 port = 2; + bytes client_tls_cert = 3; + bytes server_tls_cert = 4; +} + +// Options to be specified for all the etcd/raft nodes. These can be modified on a +// per-channel basis. +message Options { + uint64 tick_interval = 1; // specified in miliseconds + uint32 election_tick = 2; + uint32 heartbeat_tick = 3; + uint32 max_inflight_msgs = 4; + uint64 max_size_per_msg = 5; + uint64 snapshot_interval = 6; // take snapshot every n blocks +} + +// RaftMetadata stores data used by the Raft OSNs when +// coordinating with each other, to be serialized into +// block meta dta field and used after failres and restarts. +message RaftMetadata { + // Maintains a mapping between the cluster's OSNs + // and their Raft IDs. + map consenters = 1; + // Carries the Raft ID value that will be assigned + // to the next OSN that will join this cluster. + uint64 next_consenter_id = 2; + // Raft cluster configurations count + uint64 conf_change_counts = 3; + // Index of etcd/raft entry for current block. + uint64 raft_index = 4; +} diff --git a/fabric-protos/protos/orderer/kafka.proto b/fabric-protos/protos/orderer/kafka.proto new file mode 100644 index 0000000000..462d157ea0 --- /dev/null +++ b/fabric-protos/protos/orderer/kafka.proto @@ -0,0 +1,83 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/orderer"; +option java_package = "org.hyperledger.fabric.protos.orderer"; + +package orderer; + +// KafkaMessage is a wrapper type for the messages +// that the Kafka-based orderer deals with. +message KafkaMessage { + oneof Type { + KafkaMessageRegular regular = 1; + KafkaMessageTimeToCut time_to_cut = 2; + KafkaMessageConnect connect = 3; + } +} + +// KafkaMessageRegular wraps a marshalled envelope. +message KafkaMessageRegular { + enum Class { + UNKNOWN = 0; + NORMAL = 1; + CONFIG = 2; + } + bytes payload = 1; + uint64 config_seq = 2; + Class class = 3; + int64 original_offset = 4; +} + +// KafkaMessageTimeToCut is used to signal to the orderers +// that it is time to cut block . +message KafkaMessageTimeToCut { + uint64 block_number = 1; +} + +// KafkaMessageConnect is posted by an orderer upon booting up. +// It is used to prevent the panic that would be caused if we +// were to consume an empty partition. It is ignored by all +// orderers when processing the partition. +message KafkaMessageConnect { + bytes payload = 1; +} + +// KafkaMetadata is encoded into the ORDERER block to keep track of +// Kafka-related metadata associated with this block. +message KafkaMetadata { + // LastOffsetPersisted is the encoded value for the Metadata message + // which is encoded in the ORDERER block metadata index for the case + // of the Kafka-based orderer. + int64 last_offset_persisted = 1; + + // LastOriginalOffsetProcessed is used to keep track of the newest + // offset processed if a message is re-validated and re-ordered. + // This value is used to deduplicate re-submitted messages from + // multiple orderer so that we don't bother re-processing it again. + int64 last_original_offset_processed = 2; + + // LastResubmittedConfigOffset is used to capture the newest offset of + // CONFIG kafka message, which is revalidated and resubmitted. By comparing + // this with LastOriginalOffsetProcessed, we could detemine whether there + // are still CONFIG messages that have been resubmitted but NOT processed + // yet. It's used as condition to block ingress messages, so we could reduce + // the overhead of repeatedly resubmitting messages as config seq keeps + // advancing. + int64 last_resubmitted_config_offset = 3; +} diff --git a/fabric-protos/protos/peer/admin.proto b/fabric-protos/protos/peer/admin.proto new file mode 100644 index 0000000000..a30dede52d --- /dev/null +++ b/fabric-protos/protos/peer/admin.proto @@ -0,0 +1,67 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option java_outer_classname = "AdminPackage"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +import "google/protobuf/empty.proto"; +import "common/common.proto"; + +// Interface exported by the server. +service Admin { + rpc GetStatus(common.Envelope) returns (ServerStatus) {} + rpc StartServer(common.Envelope) returns (ServerStatus) {} + rpc GetModuleLogLevel(common.Envelope) returns (LogLevelResponse) {} + rpc SetModuleLogLevel(common.Envelope) returns (LogLevelResponse) {} + rpc RevertLogLevels(common.Envelope) returns (google.protobuf.Empty) {} + rpc GetLogSpec(common.Envelope) returns (LogSpecResponse) {} + rpc SetLogSpec(common.Envelope) returns (LogSpecResponse) {} +} + +message ServerStatus { + + enum StatusCode { + UNDEFINED = 0; + STARTED = 1; + STOPPED = 2; + PAUSED = 3; + ERROR = 4; + UNKNOWN = 5; + } + + StatusCode status = 1; + +} +message LogLevelRequest { + string log_module = 1; + string log_level = 2; +} + +message LogLevelResponse { + string log_module = 1; + string log_level = 2; +} + +message LogSpecRequest { + string log_spec = 1; +} + +message LogSpecResponse { + string log_spec = 1; + string error = 2; +} + +message AdminOperation { + oneof content { + LogLevelRequest logReq = 1; + LogSpecRequest logSpecReq = 2; + } +} diff --git a/fabric-protos/protos/peer/chaincode.proto b/fabric-protos/protos/peer/chaincode.proto new file mode 100644 index 0000000000..ae4d9fba11 --- /dev/null +++ b/fabric-protos/protos/peer/chaincode.proto @@ -0,0 +1,106 @@ +/* +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. +*/ + +syntax = "proto3"; + +package protos; +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + + +// Confidentiality Levels +enum ConfidentialityLevel { + PUBLIC = 0; + CONFIDENTIAL = 1; +} + + +//ChaincodeID contains the path as specified by the deploy transaction +//that created it as well as the hashCode that is generated by the +//system for the path. From the user level (ie, CLI, REST API and so on) +//deploy transaction is expected to provide the path and other requests +//are expected to provide the hashCode. The other value will be ignored. +//Internally, the structure could contain both values. For instance, the +//hashCode will be set when first generated using the path +message ChaincodeID { + //deploy transaction will use the path + string path = 1; + + //all other requests will use the name (really a hashcode) generated by + //the deploy transaction + string name = 2; + + //user friendly version name for the chaincode + string version = 3; +} + +// Carries the chaincode function and its arguments. +// UnmarshalJSON in transaction.go converts the string-based REST/JSON input to +// the []byte-based current ChaincodeInput structure. +message ChaincodeInput { + repeated bytes args = 1; + map decorations = 2; +} + +// Carries the chaincode specification. This is the actual metadata required for +// defining a chaincode. +message ChaincodeSpec { + + enum Type { + UNDEFINED = 0; + GOLANG = 1; + NODE = 2; + CAR = 3; + JAVA = 4; + } + + Type type = 1; + ChaincodeID chaincode_id = 2; + ChaincodeInput input = 3; + int32 timeout = 4; +} + +// Specify the deployment of a chaincode. +// TODO: Define `codePackage`. +message ChaincodeDeploymentSpec { + // Prevent removed tag re-use + reserved 2; + reserved "effective_date"; + + enum ExecutionEnvironment { + DOCKER = 0; + SYSTEM = 1; + } + + ChaincodeSpec chaincode_spec = 1; + bytes code_package = 3; + ExecutionEnvironment exec_env= 4; + +} + +// Carries the chaincode function and its arguments. +message ChaincodeInvocationSpec { + // Prevent removed tag re-use + reserved 2; + reserved "id_generation_alg"; + + ChaincodeSpec chaincode_spec = 1; +} + +// LifecycleEvent is used as the payload of the chaincode event emitted by LSCC +message LifecycleEvent { + string chaincode_name = 1; +} diff --git a/fabric-protos/protos/peer/chaincode_event.proto b/fabric-protos/protos/peer/chaincode_event.proto new file mode 100644 index 0000000000..14a51f737f --- /dev/null +++ b/fabric-protos/protos/peer/chaincode_event.proto @@ -0,0 +1,30 @@ +/* +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. +*/ +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"; + + +//ChaincodeEvent is used for events and registrations that are specific to chaincode +//string type - "chaincode" +message ChaincodeEvent { + string chaincode_id = 1; + string tx_id = 2; + string event_name = 3; + bytes payload = 4; +} diff --git a/fabric-protos/protos/peer/chaincode_shim.proto b/fabric-protos/protos/peer/chaincode_shim.proto new file mode 100644 index 0000000000..e49e573fe1 --- /dev/null +++ b/fabric-protos/protos/peer/chaincode_shim.proto @@ -0,0 +1,184 @@ +/* +Copyright IBM Corp. 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"; +import "peer/chaincode_event.proto"; +import "peer/proposal.proto"; +import "google/protobuf/timestamp.proto"; + + +message ChaincodeMessage { + + enum Type { + UNDEFINED = 0; + REGISTER = 1; + REGISTERED = 2; + INIT = 3; + READY = 4; + TRANSACTION = 5; + COMPLETED = 6; + ERROR = 7; + GET_STATE = 8; + PUT_STATE = 9; + DEL_STATE = 10; + INVOKE_CHAINCODE = 11; + RESPONSE = 13; + GET_STATE_BY_RANGE = 14; + GET_QUERY_RESULT = 15; + QUERY_STATE_NEXT = 16; + QUERY_STATE_CLOSE = 17; + KEEPALIVE = 18; + GET_HISTORY_FOR_KEY = 19; + GET_STATE_METADATA = 20; + PUT_STATE_METADATA = 21; + GET_PRIVATE_DATA_HASH = 22; + } + + Type type = 1; + google.protobuf.Timestamp timestamp = 2; + bytes payload = 3; + string txid = 4; + + SignedProposal proposal = 5; + + //event emitted by chaincode. Used only with Init or Invoke. + // This event is then stored (currently) + //with Block.NonHashData.TransactionResult + ChaincodeEvent chaincode_event = 6; + + //channel id + string channel_id = 7; +} + +// TODO: We need to finalize the design on chaincode container +// compatibility upon upgrade, see FAB-5777. + +// GetState is the payload of a ChaincodeMessage. It contains a key which +// 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; +} + +message GetStateMetadata { + string key = 1; + string collection = 2; +} + +// PutState is the payload of a ChaincodeMessage. It contains a key and value +// which needs to be written to the transaction's write set. If the collection is +// 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; +} + +message PutStateMetadata { + string key = 1; + string collection = 3; + StateMetadata metadata = 4; +} + +// DelState is the payload of a ChaincodeMessage. It contains a key which +// needs to be recorded in the transaction's write set as a delete operation. +// 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; +} + +// GetStateByRange is the payload of a ChaincodeMessage. It contains a start key and +// a end key required to execute range query. If the collection is specified, +// 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; +} + +// GetQueryResult is the payload of a ChaincodeMessage. It contains a query +// string in the form that is supported by the underlying state database. +// 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; +} + +// 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; +} + +// 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; +} + +message QueryStateNext { + string id = 1; +} + +message QueryStateClose { + string id = 1; +} + +// QueryResultBytes hold the byte representation of a record returned by the peer. +message QueryResultBytes { + bytes resultBytes = 1; +} + +// QueryResponse is returned by the peer as a result of a GetStateByRange, +// GetQueryResult, and GetHistoryForKey. It holds a bunch of records in +// results field, a flag to denote whether more results need to be fetched from +// 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; +} + +// 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; +} + +message StateMetadata { + string metakey = 1; + bytes value = 2; +} + +message StateMetadataResult { + repeated StateMetadata entries = 1; +} + +// 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) {} + + +} diff --git a/fabric-protos/protos/peer/configuration.proto b/fabric-protos/protos/peer/configuration.proto new file mode 100644 index 0000000000..4c201088de --- /dev/null +++ b/fabric-protos/protos/peer/configuration.proto @@ -0,0 +1,51 @@ +/* +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. +*/ + +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem +message AnchorPeers { + repeated AnchorPeer anchor_peers = 1; +} + +// 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; + +} + +// APIResource represents an API resource in the peer whose ACL +// is determined by the policy_ref field +message APIResource { + string policy_ref = 1; // The policy name to use for this API +} + +// ACLs provides mappings for resources in a channel. APIResource encapsulates +// reference to a policy used to determine ACL for the resource +message ACLs { + map acls = 1; +} diff --git a/fabric-protos/protos/peer/events.proto b/fabric-protos/protos/peer/events.proto new file mode 100644 index 0000000000..78f9d2f061 --- /dev/null +++ b/fabric-protos/protos/peer/events.proto @@ -0,0 +1,70 @@ +/* +Copyright IBM Corp. 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"; + +package protos; + +// FilteredBlock is a minimal set of information about a block +message FilteredBlock { + string channel_id = 1; + uint64 number = 2; // The position in the blockchain + repeated FilteredTransaction filtered_transactions = 4; +} + +// FilteredTransaction is a minimal set of information about a transaction +// within a block +message FilteredTransaction { + string txid = 1; + common.HeaderType type = 2; + TxValidationCode tx_validation_code = 3; + oneof Data { + FilteredTransactionActions transaction_actions = 4; + } +} + +// FilteredTransactionActions is a wrapper for array of TransactionAction +// message from regular block +message FilteredTransactionActions { + repeated FilteredChaincodeAction chaincode_actions = 1; +} + +// FilteredChaincodeAction is a minimal set of information about an action +// within a transaction +message FilteredChaincodeAction { + ChaincodeEvent chaincode_event = 1; +} + +// DeliverResponse +message DeliverResponse { + oneof Type { + common.Status status = 1; + common.Block block = 2; + FilteredBlock filtered_block = 3; + } +} + +service Deliver { + // 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 + // 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) { + } +} diff --git a/fabric-protos/protos/peer/lifecycle/db.proto b/fabric-protos/protos/peer/lifecycle/db.proto new file mode 100644 index 0000000000..02fe3d7484 --- /dev/null +++ b/fabric-protos/protos/peer/lifecycle/db.proto @@ -0,0 +1,33 @@ +/* +Copyright IBM Corp. 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"; + +// These protos are used for encoding data into the statedb +// in general, it should not be necessary for clients to utilize them. + +// StateMetadata describes the keys in a namespace. It is necessary because +// in collections, range scans are not possible during transactions which +// write. Therefore we must track the keys in our namespace ourselves. +message StateMetadata { + string datatype = 1; + repeated string fields = 2; +} + +// StateData encodes a particular field of a datatype +message StateData { + oneof Type { + string String = 1; + bytes Bytes = 2; + uint64 Uint64 = 3; + int64 Int64 = 4; + } +} diff --git a/fabric-protos/protos/peer/lifecycle/lifecycle.proto b/fabric-protos/protos/peer/lifecycle/lifecycle.proto new file mode 100644 index 0000000000..36f1fe359a --- /dev/null +++ b/fabric-protos/protos/peer/lifecycle/lifecycle.proto @@ -0,0 +1,57 @@ +/* +Copyright IBM Corp. 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"; + +// InstallChaincodeArgs is the message used as the argument to +// '+lifecycle.InstallChaincode' +message InstallChaincodeArgs { + string name = 1; + string version = 2; + bytes chaincode_install_package = 3; // This should be a marshaled peer.ChaincodeInstallPackage +} + +// InstallChaincodeArgs is the message returned by +// '+lifecycle.InstallChaincode' +message InstallChaincodeResult { + bytes hash = 1; +} + +// QueryInstalledChaincodeArgs is the message returned by +// '+lifecycle.QueryInstalledChaincode' +message QueryInstalledChaincodeArgs { + string name = 1; + string version = 2; +} + +// QueryInstalledChaincodeResult is the message returned by +// '+lifecycle.QueryInstalledChaincode' +message QueryInstalledChaincodeResult { + bytes hash = 1; +} + +// QueryInstalledChaincodesArgs currently is an empty argument to +// '+lifecycle.QueryInstalledChaincodes'. In the future, it may be +// extended to have parameters. +message QueryInstalledChaincodesArgs { +} + +// QueryInstalledChaincodesResult is the message returned by +// '+lifecycle.QueryInstalledChaincodes'. It returns a list of +// installed chaincodes. +message QueryInstalledChaincodesResult { + message InstalledChaincode { + string name = 1; + string version = 2; + bytes hash = 3; + } + repeated InstalledChaincode installed_chaincodes = 1; +} diff --git a/fabric-protos/protos/peer/peer.proto b/fabric-protos/protos/peer/peer.proto new file mode 100644 index 0000000000..7d529dfe93 --- /dev/null +++ b/fabric-protos/protos/peer/peer.proto @@ -0,0 +1,37 @@ +/* +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. +*/ +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +import "peer/proposal.proto"; +import "peer/proposal_response.proto"; + +message PeerID { + string name = 1; +} + +message PeerEndpoint { + PeerID id = 1; + string address = 2; +} + +service Endorser { + rpc ProcessProposal(SignedProposal) returns (ProposalResponse) {} +} diff --git a/fabric-protos/protos/peer/proposal.proto b/fabric-protos/protos/peer/proposal.proto new file mode 100644 index 0000000000..81a8d04df6 --- /dev/null +++ b/fabric-protos/protos/peer/proposal.proto @@ -0,0 +1,279 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/peer"; +option java_package = "org.hyperledger.fabric.protos.peer"; +option java_outer_classname = "ProposalPackage"; + +package protos; + +import "peer/chaincode.proto"; +import "peer/proposal_response.proto"; +import "token/expectations.proto"; + +/* +The flow to get a generic transaction approved goes as follows: + +1. client sends proposal to endorser +==================================== + +The proposal is basically a request to do something that will result on some +action with impact on the ledger; a proposal contains a header (with some +metadata describing it, such as the type, the identity of the invoker, the +time, the ID of the chain, a cryptographic nonce..) and an opaque payload that +depends on the type specified in the header. A proposal contains the following +messages: + +SignedProposal +|\_ Signature (signature on the Proposal message by the creator specified in the header) + \_ Proposal + |\_ Header (the header for this proposal) + \_ Payload (the payload for this proposal) + +2. endorser sends proposal response back to client +================================================== + +The proposal response contains an endorser's response to a client's proposal. A +proposal response contains a success/error code, a response payload and a +signature (also referred to as endorsement) over the response payload. The +response payload contains a hash of the proposal (to securely link this +response to the corresponding proposal) and an opaque extension field that +depends on the type specified in the header of the corresponding proposal. A +proposal response contains the following messages: + +ProposalResponse +|\_ Endorsement (the endorser's signature over the whole response payload) + \_ ProposalResponsePayload (the payload of the proposal response) + +3. client assembles endorsements into a transaction +=================================================== + +A transaction message assembles one or more proposals and corresponding +responses into a message to be sent to orderers. After ordering, (batches of) +transactions are delivered to committing peers for validation and final +delivery into the ledger. A transaction contains one or more actions. Each of +them contains a header (same as that of the proposal that requested it) and an +opaque payload that depends on the type specified in the header. + +SignedTransaction +|\_ Signature (signature on the Transaction message by the creator specified in the header) + \_ Transaction + \_ TransactionAction (1...n) + |\_ Header (1) (the header of the proposal that requested this action) + \_ Payload (1) (the payload for this action) +*/ + +// This structure is necessary to sign the proposal which contains the header +// and the payload. Without this structure, we would have to concatenate the +// header and the payload to verify the signature, which could be expensive +// with large payload +// +// When an endorser receives a SignedProposal message, it should verify the +// signature over the proposal bytes. This verification requires the following +// steps: +// 1. Verification of the validity of the certificate that was used to produce +// the signature. The certificate will be available once proposalBytes has +// been unmarshalled to a Proposal message, and Proposal.header has been +// unmarshalled to a Header message. While this unmarshalling-before-verifying +// might not be ideal, it is unavoidable because i) the signature needs to also +// protect the signing certificate; ii) it is desirable that Header is created +// once by the client and never changed (for the sake of accountability and +// non-repudiation). Note also that it is actually impossible to conclusively +// verify the validity of the certificate included in a Proposal, because the +// proposal needs to first be endorsed and ordered with respect to certificate +// expiration transactions. Still, it is useful to pre-filter expired +// certificates at this stage. +// 2. Verification that the certificate is trusted (signed by a trusted CA) and +// that it is allowed to transact with us (with respect to some ACLs); +// 3. Verification that the signature on proposalBytes is valid; +// 4. Detect replay attacks; +message SignedProposal { + + // 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; +} + +// A Proposal is sent to an endorser for endorsement. The proposal contains: +// 1. A header which should be unmarshaled to a Header message. Note that +// Header is both the header of a Proposal and of a Transaction, in that i) +// both headers should be unmarshaled to this message; and ii) it is used to +// compute cryptographic hashes and signatures. The header has fields common +// to all proposals/transactions. In addition it has a type field for +// additional customization. An example of this is the ChaincodeHeaderExtension +// message used to extend the Header for type CHAINCODE. +// 2. A payload whose type depends on the header's type field. +// 3. An extension whose type depends on the header's type field. +// +// Let us see an example. For type CHAINCODE (see the Header message), +// we have the following: +// 1. The header is a Header message whose extensions field is a +// ChaincodeHeaderExtension message. +// 2. The payload is a ChaincodeProposalPayload message. +// 3. The extension is a ChaincodeAction that might be used to ask the +// endorsers to endorse a specific ChaincodeAction, thus emulating the +// submitting peer model. +message Proposal { + + // 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; + + // 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 ----------- + +/* +The flow to get a CHAINCODE transaction approved goes as follows: + +1. client sends proposal to endorser +==================================== + +The proposal is basically a request to do something on a chaincode, that will +result on some action - some change in the state of a chaincode and/or some +data to be committed to the ledger; a proposal in general contains a header +(with some metadata describing it, such as the type, the identity of the +invoker, the time, the ID of the chain, a cryptographic nonce..) and a payload +(the chaincode ID, invocation arguments..). Optionally, it may contain actions +that the endorser may be asked to endorse, to emulate a submitting peer. A +chaincode proposal contains the following messages: + +SignedProposal +|\_ Signature (signature on the Proposal message by the creator specified in the header) + \_ Proposal + |\_ Header (the header for this proposal) + |\_ ChaincodeProposalPayload (the payload for this proposal) + \_ ChaincodeAction (the actions for this proposal - optional for a proposal) + +2. endorser sends proposal response back to client +================================================== + +The proposal response contains an endorser's response to a client's proposal. A +proposal response contains a success/error code, a response payload and a +signature (also referred to as endorsement) over the response payload. The +response payload contains a hash of the proposal (to securely link this +response to the corresponding proposal), a description of the action resulting +from the proposal and the endorser's signature over its payload. Formally, a +chaincode proposal response contains the following messages: + +ProposalResponse +|\_ Endorsement (the endorser's signature over the whole response payload) + \_ ProposalResponsePayload + \_ ChaincodeAction (the actions for this proposal) + +3. client assembles endorsements into a transaction +=================================================== + +A transaction message assembles one or more proposals and corresponding +responses into a message to be sent to orderers. After ordering, (batches of) +transactions are delivered to committing peers for validation and final +delivery into the ledger. A transaction contains one or more actions. Each of +them contains a header (same as that of the proposal that requested it), a +proposal payload (same as that of the proposal that requested it), a +description of the resulting action and signatures from each of the endorsers +that endorsed the action. + +SignedTransaction +|\_ Signature (signature on the Transaction message by the creator specified in the header) + \_ Transaction + \_ TransactionAction (1...n) + |\_ Header (1) (the header of the proposal that requested this action) + \_ ChaincodeActionPayload (1) + |\_ ChaincodeProposalPayload (1) (payload of the proposal that requested this action) + \_ ChaincodeEndorsedAction (1) + |\_ Endorsement (1...n) (endorsers' signatures over the whole response payload) + \_ ProposalResponsePayload + \_ ChaincodeAction (the actions for this proposal) +*/ + +// ChaincodeHeaderExtension is the Header's extentions message to be used when +// the Header's type is CHAINCODE. This extensions is used to specify which +// 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; +} + +// ChaincodeProposalPayload is the Proposal's payload message to be used when +// the Header's type is CHAINCODE. It contains the arguments for this +// 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; + + // 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 expectation generated by the chaincode + // executing this invocation + TokenExpectation token_expectation = 5; +} \ No newline at end of file diff --git a/fabric-protos/protos/peer/proposal_response.proto b/fabric-protos/protos/peer/proposal_response.proto new file mode 100644 index 0000000000..6cc84493b5 --- /dev/null +++ b/fabric-protos/protos/peer/proposal_response.proto @@ -0,0 +1,119 @@ +/* +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. +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/peer"; +option java_package = "org.hyperledger.fabric.protos.peer"; +option java_outer_classname = "ProposalResponsePackage"; + +package protos; + +import "google/protobuf/timestamp.proto"; + +// A ProposalResponse is returned from an endorser to the proposal submitter. +// The idea is that this message contains the endorser's response to the +// request of a client to perform an action over a chaincode (or more +// generically on the ledger); the response might be success/error (conveyed in +// the Response field) together with a description of the action and a +// signature over it by that endorser. If a sufficient number of distinct +// 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; + + // 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; + + // 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; +} + +// 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 message associated with the response code. + string message = 2; + + // 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 +// is the "bridge" between the client's request and the endorser's action in +// response to that request. Concretely, for chaincodes, it contains a hashed +// 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; +} + +// An endorsement is a signature of an endorser over a proposal response. By +// producing an endorsement message, an endorser implicitly "approves" that +// proposal response and the actions contained therein. When enough +// endorsements have been collected, a transaction can be generated out of a +// set of proposal responses. Note that this message only contains an identity +// and a signature but no signed payload. This is intentional because +// endorsements are supposed to be collected in a transaction, and they are all +// 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; + + // 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 new file mode 100644 index 0000000000..d934104f04 --- /dev/null +++ b/fabric-protos/protos/peer/query.proto @@ -0,0 +1,66 @@ +/* +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. +*/ + +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +// ChaincodeQueryResponse returns information about each chaincode that pertains +// to a query in lscc.go, such as GetChaincodes (returns all chaincodes +// instantiated on a channel), and GetInstalledChaincodes (returns all chaincodes +// installed on a peer) +message ChaincodeQueryResponse { + repeated ChaincodeInfo chaincodes = 1; +} + +// ChaincodeInfo contains general information about an installed/instantiated +// chaincode +message ChaincodeInfo { + string name = 1; + string version = 2; + // the path as specified by the install/instantiate transaction + string path = 3; + // the chaincode function upon instantiation and its arguments. This will be + // blank if the query is returning information about installed chaincodes. + string input = 4; + // the name of the ESCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + string escc = 5; + // the name of the VSCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + string vscc = 6; + // the chaincode unique id. + // computed as: H( + // H(name || version) || + // H(CodePackage) + // ) + bytes id = 7; +} + +// ChannelQueryResponse returns information about each channel that pertains +// to a query in lscc.go, such as GetChannels (returns all channels for a +// given peer) +message ChannelQueryResponse { + repeated ChannelInfo channels = 1; +} + +// ChannelInfo contains general information about channels +message ChannelInfo { + string channel_id = 1; +} diff --git a/fabric-protos/protos/peer/resources.proto b/fabric-protos/protos/peer/resources.proto new file mode 100644 index 0000000000..697e91fdc8 --- /dev/null +++ b/fabric-protos/protos/peer/resources.proto @@ -0,0 +1,56 @@ +/* +Copyright IBM Corp. 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"; + +package protos; + +import "common/configtx.proto"; + +// ChaincodeIdentifier identifies a piece of chaincode. For a peer to accept invocations of +// this chaincode, the hash of the installed code must match, as must the version string +// included with the install command. +message ChaincodeIdentifier { + bytes hash = 1; // The hash of the chaincode bytes + string version = 2; // A user friendly human readable name corresponding to the ID +} + +// ChaincodeValidation instructs the peer how transactions for this chaincode should be +// validated. The only validation mechanism which ships with fabric today is the standard +// 'vscc' validation mechanism. This built in validation method utilizes an endorsement policy +// which checks that a sufficient number of signatures have been included. The 'arguement' +// field encodes any parameters required by the validation implementation. +message ChaincodeValidation { + string name = 1; // Specifies which code to run to validate transactions, defaults to 'vscc' + bytes argument = 2; // When 'vscc' a marshaled VSCCArgs +} + +// VSCCArgs is passed (marshaled) as a parameter to the VSCC imlementation via the +// argument field of the ChaincodeValidation message. +message VSCCArgs { + string endorsement_policy_ref = 1; // A named reference to an endorsement policy, + // for instance /Channel/Application/Writers +} + +// ChaincodeEndorsement instructs the peer how transactions should be endorsed. The only +// endorsement mechanism which ships with the fabric today is the standard 'escc' mechanism. +// This code simply simulates the proposal to generate a RW set, then signs the result +// using the peer's local signing identity. +message ChaincodeEndorsement { + string name = 1; // Specifies what code to run for endorsements, defaults 'escc' + // Eventually we may wish add an arg here, just like the ChaincodeValidation message, but + // omitting now until there is a need for it. +} + +// ConfigTree encapsulates channel and resources configuration of a channel. +// Both configurations are represented as common.Config +message ConfigTree { + common.Config channel_config = 1; + common.Config resources_config = 2; +} diff --git a/fabric-protos/protos/peer/signed_cc_dep_spec.proto b/fabric-protos/protos/peer/signed_cc_dep_spec.proto new file mode 100644 index 0000000000..6ce49509ac --- /dev/null +++ b/fabric-protos/protos/peer/signed_cc_dep_spec.proto @@ -0,0 +1,42 @@ +/* +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. +*/ +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +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; +} + diff --git a/fabric-protos/protos/peer/transaction.proto b/fabric-protos/protos/peer/transaction.proto new file mode 100644 index 0000000000..991b81adf4 --- /dev/null +++ b/fabric-protos/protos/peer/transaction.proto @@ -0,0 +1,171 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/peer"; +option java_package = "org.hyperledger.fabric.protos.peer"; +option java_outer_classname = "TransactionPackage"; + +package protos; + +import "peer/proposal_response.proto"; +import "common/common.proto"; +import "token/transaction.proto"; + +// This message is necessary to facilitate the verification of the signature +// (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; +} + +// ProcessedTransaction wraps an Envelope that includes a transaction along with an indication +// of whether the transaction was validated or invalidated by committing peer. +// The use case is that GetTransactionByID API needs to retrieve the transaction Envelope +// from block storage, and return it to a client, and indicate whether the transaction +// was validated or invalidated by committing peer. So that the originally submitted +// transaction Envelope is not modified, the ProcessedTransaction wrapper is returned. +message ProcessedTransaction { + // An Envelope which includes a processed transaction + common.Envelope transactionEnvelope = 1; + + // An indication of whether the transaction was validated or invalidated by committing peer + int32 validationCode = 2; +} + +// TokenEndorserTransaction is for chaincode-based endorsement transactions +// that use FabToken as payment settlement. +// It will be serialized as payload data in the envelope: +// 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) +// \_ TokenEndorserTransaction (1) +// \_ TransactionAction (1) (the transaction action that is same as regular endorser transaction) +// \_ TokenTransaction (1) (the token transaction matching the token expectation in endorsement response) +message TokenEndorserTransaction { + // TransactionAction defines the regular endorser transaction based on proposal endorsement + TransactionAction transaction_action = 1; + + // TokenTransaction satisfies the expectation generated at endorsement time + TokenTransaction token_transaction = 2; +} + +// The transaction to be sent to the ordering service. A transaction contains +// one or more TransactionAction. Each TransactionAction binds a proposal to +// potentially multiple actions. The transaction is atomic meaning that either +// all actions in the transaction will be committed or none will. Note that +// while a Transaction might include more than one Header, the Header.creator +// field must be the same in each. +// A single client is free to issue a number of independent Proposal, each with +// their header (Header) and request payload (ChaincodeProposalPayload). Each +// proposal is independently endorsed generating an action +// (ProposalResponsePayload) with one signature per Endorser. Any number of +// independent proposals (and their action) might be included in a transaction +// 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; +} + +// 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 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 ------------ + +// ChaincodeActionPayload is the message to be used for the TransactionAction's +// 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; +} + +// 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; +} + +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; + NOT_VALIDATED = 254; + INVALID_OTHER_REASON = 255; +} + +// Reserved entries in the key-level metadata map +enum MetaDataKeys { + VALIDATION_PARAMETER = 0; +} diff --git a/fabric-protos/protos/token/expectations.proto b/fabric-protos/protos/token/expectations.proto new file mode 100644 index 0000000000..c4cc595452 --- /dev/null +++ b/fabric-protos/protos/token/expectations.proto @@ -0,0 +1,40 @@ +/* +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 protos; + +import "google/protobuf/timestamp.proto"; +import "token/transaction.proto"; + +// TokenExpectation represent the belief that someone should achieve in terms of a token action +message TokenExpectation { + oneof Expectation { + // PlainExpectation describes a plain token expectation + PlainExpectation plain_expectation = 1; + } +} + +// PlainExpectation represent the plain expectation where no confidentiality is provided. +message PlainExpectation { + oneof payload { + // ImportExpectation describes an token import expectation + PlainTokenExpectation import_expectation = 1; + // TransferExpectation describes a token transfer expectation + PlainTokenExpectation transfer_expectation = 2; + } +} + +// PlainTokenExpectation represents the expecation that +// certain outputs will be matched +message PlainTokenExpectation { + // Outputs contains the expected outputs + repeated PlainOutput outputs = 1; +} diff --git a/fabric-protos/protos/token/prover.proto b/fabric-protos/protos/token/prover.proto new file mode 100644 index 0000000000..cf0313ff5b --- /dev/null +++ b/fabric-protos/protos/token/prover.proto @@ -0,0 +1,230 @@ +/* +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 protos; + +import "google/protobuf/timestamp.proto"; +import "token/expectations.proto"; +import "token/transaction.proto"; + +// TokenToIssue describes a token to be issued in the system +message TokenToIssue { + // Recipient refers to the owner of the token to be issued + bytes recipient = 1; + + // Type refers to the token type + string type = 2; + + // Quantity refers to the number of token units to be issued + uint64 quantity = 3; +} + +// RecipientTransferShare describes how much a recipient will receive in a token transfer +message RecipientTransferShare { + // Recipient refers to the prospective owner of a transferred token + bytes recipient = 1; + + // Quantity refers to the number of token units to be transferred to the recipient + uint64 quantity = 2; +} + +// TokenOutput is used to specify a token returned by ListRequest +message TokenOutput { + // ID is used to uniquely identify the token + bytes id = 1; + + // Type is the type of the token + string type = 2; + + // Quantity represents the number for this type of token + uint64 quantity = 3; +} + +// UnspentTokens is used to hold the output of listRequest +message UnspentTokens { + repeated TokenOutput tokens = 1; +} + +// ListRequest is used to request a list of unspent tokens +message ListRequest { + bytes credential = 1; +} + +// ImportRequest is used to request creation of imports +message ImportRequest { + // 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; + + // TokenToIssue contains the information about the tokens to be issued + repeated TokenToIssue tokens_to_issue = 2; +} + +// RequestTransfer is used to request creation of transfers +message TransferRequest { + bytes credential = 1; + + repeated bytes token_ids = 2; + + repeated RecipientTransferShare shares = 3; +} + +// RedeemRequest is used to request token redemption +message RedeemRequest { + // 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; + + // token_ids specifies the ids for the tokens that will be redeemed + repeated bytes token_ids = 2; + + // quantity refers to the number of units of a given token needs to be redeemed. + uint64 quantity_to_redeem = 3; +} + +// ALlowance defines how many and what tokens a recipient can transfer on behalf of their actual owner +message AllowanceRecipientShare { + // Recipient refers to the entity allowed to spend the specified quantity from the tokens identified by token IDs + bytes recipient = 1; + + // Quantity is how many tokens are delegated to the recipient + uint64 quantity = 2; +} + +// ApproveRequest is used to request the creation of allowance from one owner to another +message ApproveRequest{ + // Credential refers to the public credential of the request creator + bytes credential = 1; + + // Allowance describes the tokens the creator of the request is willing to delegate + repeated AllowanceRecipientShare allowance_shares = 2; + + // TokenIds are the token identifiers used to create the allowance + repeated bytes token_ids = 3; +} + +// ExpectationRequest is used to request indirect token import or transfer based on the token expectation +message ExpectationRequest { + // 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; + + // expectation contains the expected outputs for token import or transfer + TokenExpectation expectation = 2; + + // TokenIds are the token identifiers used to fulfill the expectation + repeated bytes 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 bound 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; + + // If mutual TLS is enabled, this represents + // the hash of the client's TLS certificate + 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 { + ImportRequest import_request = 2; + TransferRequest transfer_request = 3; + ListRequest list_request = 4; + RedeemRequest redeem_request = 5; + ApproveRequest approve_request = 6; + TransferRequest transfer_from_request = 7; + ExpectationRequest expectation_request = 8; + } +} + +// 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; + } +} + +// 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 new file mode 100644 index 0000000000..c5aa4e916f --- /dev/null +++ b/fabric-protos/protos/token/transaction.proto @@ -0,0 +1,158 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option go_package = "github.com/hyperledger/fabric/protos/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 { + // action carries the content of this transaction. + oneof action { + PlainTokenAction plain_action = 1; + } +} + +// PlainTokenAction governs the structure of a token action that is +// subjected to no privacy restrictions +message PlainTokenAction { + oneof data { + // A plaintext token import transaction + PlainImport plain_import = 1; + // A plaintext token transfer transaction + PlainTransfer plain_transfer = 2; + // A plaintext token redeem transaction + PlainTransfer plain_redeem = 3; + // A plaintext token approve transaction + PlainApprove plain_approve = 4; + // A plaintext token transfer from transaction + PlainTransferFrom plain_transfer_From = 5; + } +} + +// PlainImport specifies an import of one or more tokens in plaintext format +message PlainImport { + + // An import transaction may contain one or more outputs + repeated PlainOutput outputs = 1; +} + +// PlainTransfer specifies a transfer of one or more plaintext tokens to one or more outputs +message PlainTransfer { + + // The inputs to the transfer transaction are specified by their ID + repeated InputId inputs = 1; + + // A transfer transaction may contain one or more outputs + repeated PlainOutput outputs = 2; +} + +// PlainApprove specifies an approve of one or more tokens in plaintext format +message PlainApprove { + // The inputs to the transfer transaction are specified by their ID + repeated InputId inputs = 1; + + // An approve transaction contains one or more plain delegated outputs + repeated PlainDelegatedOutput delegated_outputs = 2; + + // An approve transaction contains one plain output + PlainOutput output = 3; +} + +// PlainTransferFrom specifies a transfer of one or more plaintext delegated tokens to one or more outputs +// an to a delegated output +message PlainTransferFrom { + // The inputs to the transfer transaction are specified by their ID + repeated InputId inputs = 1; + + // A transferFrom transaction contains multiple outputs + repeated PlainOutput outputs = 2; + + // A transferFrom transaction may contain one delegatable output + PlainDelegatedOutput delegated_output = 3; +} + +// A PlainOutput is the result of import and transfer transactions using plaintext tokens +message PlainOutput { + + // The owner is the serialization of a SerializedIdentity struct + bytes owner = 1; + + // The token type + string type = 2; + + // The quantity of tokens + uint64 quantity = 3; +} + +// An InputId specifies an output using the transaction ID and the index of the output in the transaction +message InputId { + + // The transaction ID + string tx_id = 1; + + // The index of the output in the transaction + uint32 index = 2; +} + +// A PlainDelegatedOutput is the result of approve transactions using plaintext tokens +message PlainDelegatedOutput { + // The owner is the serialization of a SerializedIdentity struct + bytes owner = 1; + + // The delegatees is an arrary of the serialized identities that can spend the output on behalf + // the owner + repeated bytes delegatees = 2; + + // The token type + string type = 3; + + // The quantity of tokens + uint64 quantity = 4; +} \ No newline at end of file diff --git a/fabric-protos/protos/transientstore/transientstore.proto b/fabric-protos/protos/transientstore/transientstore.proto new file mode 100644 index 0000000000..04089a2bd0 --- /dev/null +++ b/fabric-protos/protos/transientstore/transientstore.proto @@ -0,0 +1,35 @@ +/* +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. +*/ + +syntax = "proto3"; + + +package transientstore; + +option go_package = "github.com/hyperledger/fabric/protos/transientstore"; +option java_package = "org.hyperledger.fabric.protos.transientstore"; + +import "ledger/rwset/rwset.proto"; +import "common/collection.proto"; + +// TxPvtReadWriteSetWithConfigInfo encapsulates the transaction's private +// read-write set and additional information about the configurations such as +// the latest collection config when the transaction is simulated +message TxPvtReadWriteSetWithConfigInfo { + uint64 endorsed_at = 1; + rwset.TxPvtReadWriteSet pvt_rwset = 2; + map collection_configs = 3; +} diff --git a/package.json b/package.json index d71d726d82..ae5404ed02 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "fabric-client": "file:./fabric-client", "fabric-common": "file:./fabric-common", "fabric-network": "file:./fabric-network", + "fabric-protos": "file:./fabric-protos", "fs-extra": "^6.0.1", "gulp": "^3.9.1", "gulp-add-src": "^1.0.0", diff --git a/scripts/Jenkins_Scripts/Publish_NPM_Modules.sh b/scripts/Jenkins_Scripts/Publish_NPM_Modules.sh index 3f89784a15..d6bd33222a 100755 --- a/scripts/Jenkins_Scripts/Publish_NPM_Modules.sh +++ b/scripts/Jenkins_Scripts/Publish_NPM_Modules.sh @@ -98,7 +98,7 @@ cd $WORKSPACE/gopath/src/github.com/hyperledger/fabric-sdk-node npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN # Add or delete modules from here.. -for modules in fabric-network fabric-common fabric-ca-client fabric-client; do +for modules in fabric-protos fabric-common fabric-ca-client fabric-client fabric-network; do if [ -d "$modules" ]; then echo -e "\033[32m Publishing $modules" "\033[0m" cd $modules diff --git a/scripts/check_license.sh b/scripts/check_license.sh index 31277c6aa3..e705da6f89 100755 --- a/scripts/check_license.sh +++ b/scripts/check_license.sh @@ -30,6 +30,7 @@ function filterExcludedFiles { | grep -v "\.cds$" \ | grep -v "\.jar$" \ | grep -v "\.csr$" \ + | grep -v "\.proto$" \ | sort -u` }