Skip to content

Commit

Permalink
FABN-1499 NodeSDK update protos v2.0.0 (#139)
Browse files Browse the repository at this point in the history
Update the protos to final v2.0.0

Signed-off-by: Bret Harrison <[email protected]>
  • Loading branch information
harrisob authored Feb 20, 2020
1 parent d37dc85 commit 8156c0d
Show file tree
Hide file tree
Showing 12 changed files with 2,570 additions and 2,435 deletions.
4,857 changes: 2,464 additions & 2,393 deletions fabric-protos/bundle.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions fabric-protos/protos/common/collection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import "common/policies.proto";
// messages; the extra struct is required because repeated oneof is
// forbidden by the protobuf syntax
message CollectionConfigPackage {
option deprecated = true;
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 {
option deprecated = true;
oneof payload {
StaticCollectionConfig static_collection_config = 1;
}
Expand All @@ -33,6 +35,7 @@ message CollectionConfig {
// known at chaincode instantiation time, and that cannot be changed.
// Dynamic collections are deferred.
message StaticCollectionConfig {
option deprecated = true;
// the name of the collection inside the denoted chaincode
string name = 1;
// a reference to a policy residing / managed in the config block
Expand Down Expand Up @@ -70,6 +73,7 @@ message StaticCollectionConfig {
// more general Policy. Instead of containing the actual policy, the
// configuration may in the future contain a string reference to a policy.
message CollectionPolicyConfig {
option deprecated = true;
oneof payload {
// Initially, only a signature policy is supported.
SignaturePolicyEnvelope signature_policy = 1;
Expand Down
14 changes: 7 additions & 7 deletions fabric-protos/protos/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ enum HeaderType {

// 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 [deprecated=true]; /* 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 */
COMMIT_HASH = 4; /* Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates,
and the COMMIT_HASH of the previous block */
SIGNATURES = 0; // Block metadata array position for block signatures
LAST_CONFIG = 1 [deprecated=true]; // 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 [deprecated=true]; /* 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 */
COMMIT_HASH = 4; /* Block metadata array position to store the hash of TRANSACTIONS_FILTER, State Updates,
and the COMMIT_HASH of the previous block */
}

// LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index
Expand Down
10 changes: 0 additions & 10 deletions fabric-protos/protos/common/configtx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ message ConfigEnvelope {
// Note that CONFIG_UPDATE has a Payload.Data of a Marshaled ConfigUpdate
}

message ConfigGroupSchema {
map<string, ConfigGroupSchema> groups = 1;
map<string, ConfigValueSchema> values = 2;
map<string, ConfigPolicySchema> policies = 3;
}

message ConfigValueSchema {}

message ConfigPolicySchema {}

// Config represents the config for a particular channel
message Config {
// Prevent removed tag re-use
Expand Down
1 change: 1 addition & 0 deletions fabric-protos/protos/common/policies.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ message ImplicitMetaPolicy {
// ApplicationPolicy captures the diffenrent policy types that
// are set and evaluted at the application level.
message ApplicationPolicy {
option deprecated = true;
oneof Type {
// SignaturePolicy type is used if the policy is specified as
// a combination (using threshold gates) of signatures from MSP
Expand Down
2 changes: 2 additions & 0 deletions fabric-protos/protos/discovery/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ message ChaincodeInterest {
message ChaincodeCall {
string name = 1;
repeated string collection_names = 2;
bool no_private_reads = 3; // Indicates we do not need to read from private data
bool no_public_writes = 4; // Indicates we do not need to write to the chaincode namespace
}

// ChaincodeQueryResult contains EndorsementDescriptors for
Expand Down
4 changes: 2 additions & 2 deletions fabric-protos/protos/gossip/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option java_package = "org.hyperledger.fabric.protos.gossip";

package gossip;

import "common/collection.proto";
import "peer/collection.proto";

// Gossip
service Gossip {
Expand Down Expand Up @@ -257,7 +257,7 @@ message PrivatePayload {
string tx_id = 3;
bytes private_rwset = 4;
uint64 private_sim_height = 5;
common.CollectionConfigPackage collection_configs = 6;
protos.CollectionConfigPackage collection_configs = 6;
}

// Membership messages
Expand Down
82 changes: 82 additions & 0 deletions fabric-protos/protos/peer/collection.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright the Hyperledger Fabric contributors. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

option go_package = "github.com/hyperledger/fabric-protos-go/peer";
option java_package = "org.hyperledger.fabric.protos.peer";

package protos;

import "common/policies.proto";
import "peer/policy.proto";

// 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;
// a reference to a policy residing / managed in the config block
// to define the endorsement policy for this collection
ApplicationPolicy endorsement_policy= 8;
}


// 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.
common.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;
}
}
12 changes: 6 additions & 6 deletions fabric-protos/protos/peer/lifecycle/lifecycle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option go_package = "github.com/hyperledger/fabric-protos-go/peer/lifecycle";

package lifecycle;

import "common/collection.proto";
import "peer/collection.proto";

// InstallChaincodeArgs is the message used as the argument to
// '_lifecycle.InstallChaincode'.
Expand Down Expand Up @@ -97,7 +97,7 @@ message ApproveChaincodeDefinitionForMyOrgArgs {
string endorsement_plugin = 4;
string validation_plugin = 5;
bytes validation_parameter = 6;
common.CollectionConfigPackage collections = 7;
protos.CollectionConfigPackage collections = 7;
bool init_required = 8;
ChaincodeSource source = 9;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ message CommitChaincodeDefinitionArgs {
string endorsement_plugin = 4;
string validation_plugin = 5;
bytes validation_parameter = 6;
common.CollectionConfigPackage collections = 7;
protos.CollectionConfigPackage collections = 7;
bool init_required = 8;
}

Expand All @@ -149,7 +149,7 @@ message CheckCommitReadinessArgs {
string endorsement_plugin = 4;
string validation_plugin = 5;
bytes validation_parameter = 6;
common.CollectionConfigPackage collections = 7;
protos.CollectionConfigPackage collections = 7;
bool init_required = 8;
}

Expand All @@ -175,7 +175,7 @@ message QueryChaincodeDefinitionResult {
string endorsement_plugin = 3;
string validation_plugin = 4;
bytes validation_parameter = 5;
common.CollectionConfigPackage collections = 6;
protos.CollectionConfigPackage collections = 6;
bool init_required = 7;
map<string,bool> approvals = 8;
}
Expand All @@ -194,7 +194,7 @@ message QueryChaincodeDefinitionsResult {
string endorsement_plugin = 4;
string validation_plugin = 5;
bytes validation_parameter = 6;
common.CollectionConfigPackage collections = 7;
protos.CollectionConfigPackage collections = 7;
bool init_required = 8;
}
repeated ChaincodeDefinition chaincode_definitions = 1;
Expand Down
1 change: 0 additions & 1 deletion fabric-protos/protos/peer/policy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import "common/policies.proto";
// ApplicationPolicy captures the diffenrent policy types that
// are set and evaluted at the application level.
message ApplicationPolicy {
option deprecated = true;
oneof Type {
// SignaturePolicy type is used if the policy is specified as
// a combination (using threshold gates) of signatures from MSP
Expand Down
14 changes: 0 additions & 14 deletions fabric-protos/protos/peer/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ package protos;
import "peer/proposal_response.proto";
import "common/common.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
Expand Down
4 changes: 2 additions & 2 deletions fabric-protos/protos/transientstore/transientstore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ option go_package = "github.com/hyperledger/fabric-protos-go/transientstore";
option java_package = "org.hyperledger.fabric.protos.transientstore";

import "ledger/rwset/rwset.proto";
import "common/collection.proto";
import "peer/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<string, common.CollectionConfigPackage> collection_configs = 3;
map<string, protos.CollectionConfigPackage> collection_configs = 3;
}

0 comments on commit 8156c0d

Please sign in to comment.