From 5b4846940e8468ffa6538934e578279f1498e06b Mon Sep 17 00:00:00 2001 From: jeffgarratt Date: Wed, 22 Feb 2017 09:51:40 -0500 Subject: [PATCH] [FAB-1141] Latest changes incorporated Updated to use bytes for signature_header and channel_header on common Header. Regenerated protos. Updated .behaverc to only run the bootstrap.feature at the moment. Removed unused python artifacts. Fixed issue with Compose whereby service names needed to be collected on construction. Now document generator creates cert loading for python. Cleaned up BDD per Gari. Added flag to disable default chain startup in peers. Was causing issue and using code from test package. Added user install deployment step with verification prior to deployment. Updated README.md to include steps for virtualenv usage for python. Now set localMSPID for peers. Now use a separate developer from peerOrg1 to join channel. First developer gives the returned genesis block to other orgs developer. Bumpled timeout on streams to 110 secs. Now set OrdererAddresses config value. Change-Id: I161fc2e3568388e193a09b9aa86512dd334e2eed Signed-off-by: jeffgarratt --- bddtests/.behaverc | 15 +- bddtests/README.md | 98 + bddtests/api_pb2.py | 229 -- bddtests/ca_pb2.py | 2677 ----------------- bddtests/chaincode_pb2.py | 1030 ------- bddtests/chaincode_rbac.feature | 230 -- bddtests/chaincodeevent_pb2.py | 97 - bddtests/common/common_pb2.py | 58 +- bddtests/common/common_pb2_grpc.py | 1 + bddtests/common/configtx_pb2.py | 58 +- bddtests/common/configtx_pb2_grpc.py | 1 + bddtests/common/configuration_pb2_grpc.py | 1 + bddtests/common/ledger_pb2.py | 95 + bddtests/common/ledger_pb2_grpc.py | 5 + bddtests/common/msp_principal_pb2.py | 51 +- bddtests/common/msp_principal_pb2_grpc.py | 1 + bddtests/common/policies_pb2_grpc.py | 1 + bddtests/compose-defaults.yml | 2 +- bddtests/devops_pb2.py | 581 ---- bddtests/docker-compose-1-devmode.yml | 22 - bddtests/docker-compose-1-empty.yml | 3 - bddtests/docker-compose-1-exp.yml | 8 - bddtests/docker-compose-1.yml | 7 - bddtests/docker-compose-2-tls-basic.yml | 19 - bddtests/docker-compose-2.yml | 17 - bddtests/docker-compose-3.yml | 24 - bddtests/docker-compose-4-consensus-base.yml | 24 - ...-compose-4-consensus-batch-1-byzantine.yml | 55 - bddtests/docker-compose-4-consensus-batch.yml | 58 - bddtests/docker-compose-4-consensus-noops.yml | 56 - bddtests/docker-compose-4-consensus-nvp0.yml | 13 - ...cker-compose-4-consensus-vp3-byzantine.yml | 3 - bddtests/docker-compose-4.yml | 33 - bddtests/docker-compose-5.yml | 42 - bddtests/docker-compose-next-4.yml | 5 + bddtests/docker-compose-rest.yml | 17 - bddtests/docker-compose-sdk-node.yml | 11 - .../docker-membersrvc-attributes-enabled.yml | 3 - ...mbersrvc-attributes-encryption-enabled.yml | 3 - bddtests/environment.py | 9 +- bddtests/events_pb2.py | 313 -- bddtests/fabric_next_pb2.py | 696 ----- bddtests/fabric_pb2.py | 1354 --------- bddtests/features/bootstrap.feature | 113 +- bddtests/gossip/message_pb2.py | 1561 ++++++++++ bddtests/gossip/message_pb2_grpc.py | 67 + bddtests/java_shim.feature | 212 -- bddtests/msp/mspconfig_pb2.py | 66 +- bddtests/orderer/configuration_pb2.py | 45 +- bddtests/orderer/kafka_pb2.py | 41 +- bddtests/peer/admin_pb2.py | 429 +++ bddtests/peer/admin_pb2_grpc.py | 116 + bddtests/peer/chaincode_pb2.py | 707 +---- bddtests/peer/chaincode_pb2_grpc.py | 44 - bddtests/peer/chaincode_proposal_pb2.py | 183 -- bddtests/peer/chaincodeevent_pb2.py | 10 +- bddtests/peer/chaincodeshim_pb2.py | 670 +++++ bddtests/peer/chaincodeshim_pb2_grpc.py | 48 + bddtests/peer/configuration_pb2.py | 11 +- bddtests/peer/events_pb2.py | 568 ++++ bddtests/peer/events_pb2_grpc.py | 48 + bddtests/peer/peer_pb2.py | 71 +- bddtests/peer/peer_pb2_grpc.py | 6 - bddtests/peer/proposal_response_pb2.py | 10 +- bddtests/peer/query_pb2.py | 235 ++ ...proposal_pb2_grpc.py => query_pb2_grpc.py} | 0 bddtests/peer/transaction_pb2.py | 426 +++ bddtests/peer/transaction_pb2_grpc.py | 4 + bddtests/peer_basic.feature | 1388 --------- bddtests/peer_cli.feature | 25 - bddtests/peer_logging.feature | 46 - bddtests/peer_rest.feature | 23 - bddtests/scripts/start-peer.sh | 20 - bddtests/sdk.feature | 28 - bddtests/steps/bdd_grpc_util.py | 71 - bddtests/steps/bootstrap_impl.py | 46 +- bddtests/steps/bootstrap_util.py | 161 +- bddtests/steps/chaincode_rbac_impl.py | 138 - bddtests/steps/compose.py | 25 +- bddtests/steps/contexthelper.py | 4 + bddtests/steps/docgen.py | 39 +- bddtests/steps/endorser_impl.py | 77 +- bddtests/steps/endorser_util.py | 50 +- bddtests/steps/orderer_impl.py | 10 - bddtests/steps/orderer_util.py | 40 +- bddtests/steps/peer_basic_impl.py | 768 ----- bddtests/steps/peer_cli_impl.py | 97 - bddtests/steps/peer_logging_impl.py | 61 - bddtests/steps/peer_rest_impl.py | 51 - bddtests/steps/sdk_impl.py | 43 - bddtests/templates/html/error.html | 5 + bddtests/templates/html/org-py.html | 17 + bddtests/templates/html/org.html | 3 + bddtests/templates/html/report.css | 17 + bddtests/templates/html/scenario.html | 6 +- bddtests/utxo.feature | 46 - 96 files changed, 5089 insertions(+), 11933 deletions(-) create mode 100644 bddtests/README.md delete mode 100644 bddtests/api_pb2.py delete mode 100644 bddtests/ca_pb2.py delete mode 100644 bddtests/chaincode_pb2.py delete mode 100644 bddtests/chaincode_rbac.feature delete mode 100644 bddtests/chaincodeevent_pb2.py create mode 100644 bddtests/common/ledger_pb2.py create mode 100644 bddtests/common/ledger_pb2_grpc.py delete mode 100644 bddtests/devops_pb2.py delete mode 100644 bddtests/docker-compose-1-devmode.yml delete mode 100644 bddtests/docker-compose-1-empty.yml delete mode 100644 bddtests/docker-compose-1-exp.yml delete mode 100644 bddtests/docker-compose-1.yml delete mode 100644 bddtests/docker-compose-2-tls-basic.yml delete mode 100644 bddtests/docker-compose-2.yml delete mode 100644 bddtests/docker-compose-3.yml delete mode 100644 bddtests/docker-compose-4-consensus-base.yml delete mode 100644 bddtests/docker-compose-4-consensus-batch-1-byzantine.yml delete mode 100644 bddtests/docker-compose-4-consensus-batch.yml delete mode 100644 bddtests/docker-compose-4-consensus-noops.yml delete mode 100644 bddtests/docker-compose-4-consensus-nvp0.yml delete mode 100644 bddtests/docker-compose-4-consensus-vp3-byzantine.yml delete mode 100644 bddtests/docker-compose-4.yml delete mode 100644 bddtests/docker-compose-5.yml delete mode 100644 bddtests/docker-compose-rest.yml delete mode 100644 bddtests/docker-compose-sdk-node.yml delete mode 100644 bddtests/docker-membersrvc-attributes-enabled.yml delete mode 100644 bddtests/docker-membersrvc-attributes-encryption-enabled.yml delete mode 100644 bddtests/events_pb2.py delete mode 100644 bddtests/fabric_next_pb2.py delete mode 100644 bddtests/fabric_pb2.py create mode 100644 bddtests/gossip/message_pb2.py create mode 100644 bddtests/gossip/message_pb2_grpc.py delete mode 100644 bddtests/java_shim.feature create mode 100644 bddtests/peer/admin_pb2.py create mode 100644 bddtests/peer/admin_pb2_grpc.py delete mode 100644 bddtests/peer/chaincode_proposal_pb2.py create mode 100644 bddtests/peer/chaincodeshim_pb2.py create mode 100644 bddtests/peer/chaincodeshim_pb2_grpc.py create mode 100644 bddtests/peer/events_pb2.py create mode 100644 bddtests/peer/events_pb2_grpc.py create mode 100644 bddtests/peer/query_pb2.py rename bddtests/peer/{chaincode_proposal_pb2_grpc.py => query_pb2_grpc.py} (100%) create mode 100644 bddtests/peer/transaction_pb2.py create mode 100644 bddtests/peer/transaction_pb2_grpc.py delete mode 100644 bddtests/peer_basic.feature delete mode 100644 bddtests/peer_cli.feature delete mode 100644 bddtests/peer_logging.feature delete mode 100644 bddtests/peer_rest.feature delete mode 100755 bddtests/scripts/start-peer.sh delete mode 100644 bddtests/sdk.feature delete mode 100644 bddtests/steps/chaincode_rbac_impl.py delete mode 100644 bddtests/steps/peer_basic_impl.py delete mode 100644 bddtests/steps/peer_cli_impl.py delete mode 100755 bddtests/steps/peer_logging_impl.py delete mode 100644 bddtests/steps/peer_rest_impl.py delete mode 100644 bddtests/steps/sdk_impl.py create mode 100644 bddtests/templates/html/error.html create mode 100644 bddtests/templates/html/org-py.html delete mode 100644 bddtests/utxo.feature diff --git a/bddtests/.behaverc b/bddtests/.behaverc index d6862579e62..e9d6c132e19 100644 --- a/bddtests/.behaverc +++ b/bddtests/.behaverc @@ -1,14 +1,3 @@ [behave] -tags=~@issue_767 - ~@issueUtxo - ~@issue_477 - ~@issue_1207 - ~@issue_1565 - ~@issue_RBAC_TCERT_With_Attributes - ~@sdk - ~@devops - ~@preV1 - - ~@FAB-314 - -name=^((?!1 Kafka Orderer and 3 Kafka Brokers).)*$ +tags=~@orderer + ~@endorser diff --git a/bddtests/README.md b/bddtests/README.md new file mode 100644 index 00000000000..3317c26d59c --- /dev/null +++ b/bddtests/README.md @@ -0,0 +1,98 @@ +# Welcome to the Behavioral Driven Development (BDD) subsytem for Fabric +Developers will find these mechanisms useful for both exploratory and verification purposes. + +## Getting started + +### Installation + +#### Setup python virtual environment wrapper usage + +``` + sudo pip install virtualenv + sudo pip install virtualenvwrapper + export WORKON_HOME=~/Envs + source /usr/local/bin/virtualenvwrapper.sh +``` + +#### Setup your virtual environment for behave +[Virtual Environment Guide](http://docs.python-guide.org/en/latest/dev/virtualenvs/) + + +``` + mkvirtualenv -p /usr/bin/python2.7 behave_venv +``` + +This will automaticall switch you to the new environment if successful. In the future, you can switch to the virtual environment using the workon command as shown below. + +``` + workon behave_venv +``` + + +#### Now install required modules into the virtual environment + +**NOTE**: If you have issues installing the modules below, and you are running the vagrant environment, consider performing a **vagrant destroy** followed by a **vagrant up**. + +``` + pip install behave + pip install grpcio-tools + pip install "pysha3==1.0b1" + pip install b3j0f.aop + pip install jinja2 + # The pyopenssl install gives errors, but installs succeeds + pip install pyopenssl + pip install ecdsa + pip install python-slugify + pip install pyyaml +``` + +### Running behave + +#### Peer Executable and Docker containers + +Behave requires the peer executable for packaging deployments. To make the peer execute the following command. + + +``` +#Change to the root fabric folder to perform the following commands. +cd .. + +# Optionally perform the following clean if you are unsure of your environments state. +make clean +make peer +``` + +The behave system also uses several docker containers. Execute the following commands to create the required docker containers. + +``` + make peer-docker + make orderer-docker +``` + +Change back to the bddtests folder (Where this readme is located) to execute subsequent behave commands. + +``` + cd bddtests +``` + +#### Running all of the behave features and suppressing skipped steps (-k) + +The following behave commands should be executed from within this folder. + +``` + behave -k -D cache-deployment-spec +``` + +#### Running a specific feature + +``` + behave -k -D cache-deployment-spec features/bootstrap.feature +``` + +### Deactivating your behave virtual environment +Once you are done using behave and you wish to switch back to your normal +python environment, issue the following command. + +``` + deactivate +``` diff --git a/bddtests/api_pb2.py b/bddtests/api_pb2.py deleted file mode 100644 index 72c4e0511c5..00000000000 --- a/bddtests/api_pb2.py +++ /dev/null @@ -1,229 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: api.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -import fabric_pb2 as fabric__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='api.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\tapi.proto\x12\x06protos\x1a\x0c\x66\x61\x62ric.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x1d\n\x0b\x42lockNumber\x12\x0e\n\x06number\x18\x01 \x01(\x04\"\x1b\n\nBlockCount\x12\r\n\x05\x63ount\x18\x01 \x01(\x04\x32\x87\x02\n\tOpenchain\x12\x45\n\x11GetBlockchainInfo\x12\x16.google.protobuf.Empty\x1a\x16.protos.BlockchainInfo\"\x00\x12\x38\n\x10GetBlockByNumber\x12\x13.protos.BlockNumber\x1a\r.protos.Block\"\x00\x12=\n\rGetBlockCount\x12\x16.google.protobuf.Empty\x1a\x12.protos.BlockCount\"\x00\x12:\n\x08GetPeers\x12\x16.google.protobuf.Empty\x1a\x14.protos.PeersMessage\"\x00\x62\x06proto3') - , - dependencies=[fabric__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_BLOCKNUMBER = _descriptor.Descriptor( - name='BlockNumber', - full_name='protos.BlockNumber', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='number', full_name='protos.BlockNumber.number', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=64, - serialized_end=93, -) - - -_BLOCKCOUNT = _descriptor.Descriptor( - name='BlockCount', - full_name='protos.BlockCount', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='count', full_name='protos.BlockCount.count', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=95, - serialized_end=122, -) - -DESCRIPTOR.message_types_by_name['BlockNumber'] = _BLOCKNUMBER -DESCRIPTOR.message_types_by_name['BlockCount'] = _BLOCKCOUNT - -BlockNumber = _reflection.GeneratedProtocolMessageType('BlockNumber', (_message.Message,), dict( - DESCRIPTOR = _BLOCKNUMBER, - __module__ = 'api_pb2' - # @@protoc_insertion_point(class_scope:protos.BlockNumber) - )) -_sym_db.RegisterMessage(BlockNumber) - -BlockCount = _reflection.GeneratedProtocolMessageType('BlockCount', (_message.Message,), dict( - DESCRIPTOR = _BLOCKCOUNT, - __module__ = 'api_pb2' - # @@protoc_insertion_point(class_scope:protos.BlockCount) - )) -_sym_db.RegisterMessage(BlockCount) - - -import abc -import six -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - -class BetaOpenchainServicer(object): - """Interface exported by the server. - """ - def GetBlockchainInfo(self, request, context): - """GetBlockchainInfo returns information about the blockchain ledger such as - height, current block hash, and previous block hash. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def GetBlockByNumber(self, request, context): - """GetBlockByNumber returns the data contained within a specific block in the - blockchain. The genesis block is block zero. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def GetBlockCount(self, request, context): - """GetBlockCount returns the current number of blocks in the blockchain data - structure. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def GetPeers(self, request, context): - """GetPeers returns a list of all peer nodes currently connected to the target - peer. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaOpenchainStub(object): - """Interface exported by the server. - """ - def GetBlockchainInfo(self, request, timeout): - """GetBlockchainInfo returns information about the blockchain ledger such as - height, current block hash, and previous block hash. - """ - raise NotImplementedError() - GetBlockchainInfo.future = None - def GetBlockByNumber(self, request, timeout): - """GetBlockByNumber returns the data contained within a specific block in the - blockchain. The genesis block is block zero. - """ - raise NotImplementedError() - GetBlockByNumber.future = None - def GetBlockCount(self, request, timeout): - """GetBlockCount returns the current number of blocks in the blockchain data - structure. - """ - raise NotImplementedError() - GetBlockCount.future = None - def GetPeers(self, request, timeout): - """GetPeers returns a list of all peer nodes currently connected to the target - peer. - """ - raise NotImplementedError() - GetPeers.future = None - -def beta_create_Openchain_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import google.protobuf.empty_pb2 - import fabric_pb2 - import api_pb2 - import fabric_pb2 - import google.protobuf.empty_pb2 - import api_pb2 - import google.protobuf.empty_pb2 - import fabric_pb2 - request_deserializers = { - ('protos.Openchain', 'GetBlockByNumber'): api_pb2.BlockNumber.FromString, - ('protos.Openchain', 'GetBlockCount'): google.protobuf.empty_pb2.Empty.FromString, - ('protos.Openchain', 'GetBlockchainInfo'): google.protobuf.empty_pb2.Empty.FromString, - ('protos.Openchain', 'GetPeers'): google.protobuf.empty_pb2.Empty.FromString, - } - response_serializers = { - ('protos.Openchain', 'GetBlockByNumber'): fabric_pb2.Block.SerializeToString, - ('protos.Openchain', 'GetBlockCount'): api_pb2.BlockCount.SerializeToString, - ('protos.Openchain', 'GetBlockchainInfo'): fabric_pb2.BlockchainInfo.SerializeToString, - ('protos.Openchain', 'GetPeers'): fabric_pb2.PeersMessage.SerializeToString, - } - method_implementations = { - ('protos.Openchain', 'GetBlockByNumber'): face_utilities.unary_unary_inline(servicer.GetBlockByNumber), - ('protos.Openchain', 'GetBlockCount'): face_utilities.unary_unary_inline(servicer.GetBlockCount), - ('protos.Openchain', 'GetBlockchainInfo'): face_utilities.unary_unary_inline(servicer.GetBlockchainInfo), - ('protos.Openchain', 'GetPeers'): face_utilities.unary_unary_inline(servicer.GetPeers), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_Openchain_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import google.protobuf.empty_pb2 - import fabric_pb2 - import api_pb2 - import fabric_pb2 - import google.protobuf.empty_pb2 - import api_pb2 - import google.protobuf.empty_pb2 - import fabric_pb2 - request_serializers = { - ('protos.Openchain', 'GetBlockByNumber'): api_pb2.BlockNumber.SerializeToString, - ('protos.Openchain', 'GetBlockCount'): google.protobuf.empty_pb2.Empty.SerializeToString, - ('protos.Openchain', 'GetBlockchainInfo'): google.protobuf.empty_pb2.Empty.SerializeToString, - ('protos.Openchain', 'GetPeers'): google.protobuf.empty_pb2.Empty.SerializeToString, - } - response_deserializers = { - ('protos.Openchain', 'GetBlockByNumber'): fabric_pb2.Block.FromString, - ('protos.Openchain', 'GetBlockCount'): api_pb2.BlockCount.FromString, - ('protos.Openchain', 'GetBlockchainInfo'): fabric_pb2.BlockchainInfo.FromString, - ('protos.Openchain', 'GetPeers'): fabric_pb2.PeersMessage.FromString, - } - cardinalities = { - 'GetBlockByNumber': cardinality.Cardinality.UNARY_UNARY, - 'GetBlockCount': cardinality.Cardinality.UNARY_UNARY, - 'GetBlockchainInfo': cardinality.Cardinality.UNARY_UNARY, - 'GetPeers': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.Openchain', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/ca_pb2.py b/bddtests/ca_pb2.py deleted file mode 100644 index 907a2618201..00000000000 --- a/bddtests/ca_pb2.py +++ /dev/null @@ -1,2677 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ca.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='ca.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x08\x63\x61.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\"`\n\x08\x43\x41Status\x12+\n\x06status\x18\x01 \x01(\x0e\x32\x1b.protos.CAStatus.StatusCode\"\'\n\nStatusCode\x12\x06\n\x02OK\x10\x00\x12\x11\n\rUNKNOWN_ERROR\x10\x01\"\x07\n\x05\x45mpty\"\x16\n\x08Identity\x12\n\n\x02id\x18\x01 \x01(\t\"\x14\n\x05Token\x12\x0b\n\x03tok\x18\x01 \x01(\x0c\"\x14\n\x04Hash\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\":\n\tPublicKey\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.protos.CryptoType\x12\x0b\n\x03key\x18\x02 \x01(\x0c\";\n\nPrivateKey\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.protos.CryptoType\x12\x0b\n\x03key\x18\x02 \x01(\x0c\"C\n\tSignature\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.protos.CryptoType\x12\t\n\x01r\x18\x02 \x01(\x0c\x12\t\n\x01s\x18\x03 \x01(\x0c\"q\n\x0fRegisterUserReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04role\x18\x02 \x01(\x0e\x32\x0c.protos.Role\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x66\x66iliation\x18\x04 \x01(\t\"k\n\x0eReadUserSetReq\x12\x1d\n\x03req\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04role\x18\x02 \x01(\x0e\x32\x0c.protos.Role\x12\x1e\n\x03sig\x18\x03 \x01(\x0b\x32\x11.protos.Signature\"@\n\x04User\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04role\x18\x02 \x01(\x0e\x32\x0c.protos.Role\"&\n\x07UserSet\x12\x1b\n\x05users\x18\x01 \x03(\x0b\x32\x0c.protos.User\"\xd3\x01\n\x0e\x45\x43\x65rtCreateReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x02id\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x03tok\x18\x03 \x01(\x0b\x32\r.protos.Token\x12\x1f\n\x04sign\x18\x04 \x01(\x0b\x32\x11.protos.PublicKey\x12\x1e\n\x03\x65nc\x18\x05 \x01(\x0b\x32\x11.protos.PublicKey\x12\x1e\n\x03sig\x18\x06 \x01(\x0b\x32\x11.protos.Signature\"}\n\x0f\x45\x43\x65rtCreateResp\x12\x1f\n\x05\x63\x65rts\x18\x01 \x01(\x0b\x32\x10.protos.CertPair\x12\x1c\n\x05\x63hain\x18\x02 \x01(\x0b\x32\r.protos.Token\x12\x0f\n\x07pkchain\x18\x04 \x01(\x0c\x12\x1a\n\x03tok\x18\x03 \x01(\x0b\x32\r.protos.Token\",\n\x0c\x45\x43\x65rtReadReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\"j\n\x0e\x45\x43\x65rtRevokeReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04\x63\x65rt\x18\x02 \x01(\x0b\x32\x0c.protos.Cert\x12\x1e\n\x03sig\x18\x03 \x01(\x0b\x32\x11.protos.Signature\"K\n\x0b\x45\x43\x65rtCRLReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1e\n\x03sig\x18\x02 \x01(\x0b\x32\x11.protos.Signature\"\x96\x01\n\x0eTCertCreateReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x02id\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x1e\n\x03pub\x18\x03 \x01(\x0b\x32\x11.protos.PublicKey\x12\x1e\n\x03sig\x18\x04 \x01(\x0b\x32\x11.protos.Signature\"-\n\x0fTCertCreateResp\x12\x1a\n\x04\x63\x65rt\x18\x01 \x01(\x0b\x32\x0c.protos.Cert\"\xb2\x01\n\x11TCertCreateSetReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x02id\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x0b\n\x03num\x18\x03 \x01(\r\x12*\n\nattributes\x18\x04 \x03(\x0b\x32\x16.protos.TCertAttribute\x12\x1e\n\x03sig\x18\x05 \x01(\x0b\x32\x11.protos.Signature\"?\n\x0eTCertAttribute\x12\x15\n\rattributeName\x18\x01 \x01(\t\x12\x16\n\x0e\x61ttributeValue\x18\x02 \x01(\t\"4\n\x12TCertCreateSetResp\x12\x1e\n\x05\x63\x65rts\x18\x01 \x01(\x0b\x32\x0f.protos.CertSet\"\xaf\x01\n\x0cTCertReadReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x04hash\x18\x02 \x01(\x0b\x32\x0c.protos.Hash\x12\x1d\n\x03req\x18\x03 \x01(\x0b\x32\x10.protos.Identity\x12\x1c\n\x02id\x18\x04 \x01(\x0b\x32\x10.protos.Identity\x12\x1e\n\x03sig\x18\x05 \x01(\x0b\x32\x11.protos.Signature\"\xa3\x01\n\x0fTCertReadSetReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1d\n\x03req\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x1c\n\x02id\x18\x03 \x01(\x0b\x32\x10.protos.Identity\x12\x0b\n\x03num\x18\x04 \x01(\r\x12\x1e\n\x03sig\x18\x05 \x01(\x0b\x32\x11.protos.Signature\"\xc1\x01\n\x10TCertReadSetsReq\x12)\n\x05\x62\x65gin\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1d\n\x03req\x18\x03 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04role\x18\x04 \x01(\x0e\x32\x0c.protos.Role\x12\x1e\n\x03sig\x18\x05 \x01(\x0b\x32\x11.protos.Signature\"j\n\x0eTCertRevokeReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04\x63\x65rt\x18\x02 \x01(\x0b\x32\x0c.protos.Cert\x12\x1e\n\x03sig\x18\x03 \x01(\x0b\x32\x11.protos.Signature\"y\n\x11TCertRevokeSetReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12&\n\x02ts\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x03sig\x18\x03 \x01(\x0b\x32\x11.protos.Signature\"K\n\x0bTCertCRLReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1e\n\x03sig\x18\x02 \x01(\x0b\x32\x11.protos.Signature\"\x98\x01\n\x10TLSCertCreateReq\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x02id\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x1e\n\x03pub\x18\x03 \x01(\x0b\x32\x11.protos.PublicKey\x12\x1e\n\x03sig\x18\x04 \x01(\x0b\x32\x11.protos.Signature\"O\n\x11TLSCertCreateResp\x12\x1a\n\x04\x63\x65rt\x18\x01 \x01(\x0b\x32\x0c.protos.Cert\x12\x1e\n\x08rootCert\x18\x02 \x01(\x0b\x32\x0c.protos.Cert\".\n\x0eTLSCertReadReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\"l\n\x10TLSCertRevokeReq\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.protos.Identity\x12\x1a\n\x04\x63\x65rt\x18\x02 \x01(\x0b\x32\x0c.protos.Cert\x12\x1e\n\x03sig\x18\x03 \x01(\x0b\x32\x11.protos.Signature\"\x14\n\x04\x43\x65rt\x12\x0c\n\x04\x63\x65rt\x18\x01 \x01(\x0c\"i\n\x05TCert\x12\x0c\n\x04\x63\x65rt\x18\x01 \x01(\x0c\x12%\n\x04keys\x18\x02 \x03(\x0b\x32\x17.protos.TCert.KeysEntry\x1a+\n\tKeysEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"z\n\x07\x43\x65rtSet\x12&\n\x02ts\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1c\n\x02id\x18\x02 \x01(\x0b\x32\x10.protos.Identity\x12\x0b\n\x03key\x18\x03 \x01(\x0c\x12\x1c\n\x05\x63\x65rts\x18\x04 \x03(\x0b\x32\r.protos.TCert\")\n\x08\x43\x65rtSets\x12\x1d\n\x04sets\x18\x01 \x03(\x0b\x32\x0f.protos.CertSet\"%\n\x08\x43\x65rtPair\x12\x0c\n\x04sign\x18\x01 \x01(\x0c\x12\x0b\n\x03\x65nc\x18\x02 \x01(\x0c*)\n\nCryptoType\x12\t\n\x05\x45\x43\x44SA\x10\x00\x12\x07\n\x03RSA\x10\x01\x12\x07\n\x03\x44SA\x10\x02*M\n\x04Role\x12\x08\n\x04NONE\x10\x00\x12\n\n\x06\x43LIENT\x10\x01\x12\x08\n\x04PEER\x10\x02\x12\r\n\tVALIDATOR\x10\x04\x12\x0b\n\x07\x41UDITOR\x10\x08\x12\t\n\x03\x41LL\x10\xff\xff\x03\x32\xb9\x02\n\x04\x45\x43\x41P\x12\x30\n\x11ReadCACertificate\x12\r.protos.Empty\x1a\x0c.protos.Cert\x12H\n\x15\x43reateCertificatePair\x12\x16.protos.ECertCreateReq\x1a\x17.protos.ECertCreateResp\x12=\n\x13ReadCertificatePair\x12\x14.protos.ECertReadReq\x1a\x10.protos.CertPair\x12\x33\n\x15ReadCertificateByHash\x12\x0c.protos.Hash\x1a\x0c.protos.Cert\x12\x41\n\x15RevokeCertificatePair\x12\x16.protos.ECertRevokeReq\x1a\x10.protos.CAStatus2\xea\x01\n\x04\x45\x43\x41\x41\x12\x36\n\x0cRegisterUser\x12\x17.protos.RegisterUserReq\x1a\r.protos.Token\x12\x36\n\x0bReadUserSet\x12\x16.protos.ReadUserSetReq\x1a\x0f.protos.UserSet\x12=\n\x11RevokeCertificate\x12\x16.protos.ECertRevokeReq\x1a\x10.protos.CAStatus\x12\x33\n\nPublishCRL\x12\x13.protos.ECertCRLReq\x1a\x10.protos.CAStatus2\x82\x03\n\x04TCAP\x12\x30\n\x11ReadCACertificate\x12\r.protos.Empty\x1a\x0c.protos.Cert\x12M\n\x14\x43reateCertificateSet\x12\x19.protos.TCertCreateSetReq\x1a\x1a.protos.TCertCreateSetResp\x12\x35\n\x0fReadCertificate\x12\x14.protos.TCertReadReq\x1a\x0c.protos.Cert\x12>\n\x12ReadCertificateSet\x12\x17.protos.TCertReadSetReq\x1a\x0f.protos.CertSet\x12=\n\x11RevokeCertificate\x12\x16.protos.TCertRevokeReq\x1a\x10.protos.CAStatus\x12\x43\n\x14RevokeCertificateSet\x12\x19.protos.TCertRevokeSetReq\x1a\x10.protos.CAStatus2\x82\x02\n\x04TCAA\x12\x41\n\x13ReadCertificateSets\x12\x18.protos.TCertReadSetsReq\x1a\x10.protos.CertSets\x12=\n\x11RevokeCertificate\x12\x16.protos.TCertRevokeReq\x1a\x10.protos.CAStatus\x12\x43\n\x14RevokeCertificateSet\x12\x19.protos.TCertRevokeSetReq\x1a\x10.protos.CAStatus\x12\x33\n\nPublishCRL\x12\x13.protos.TCertCRLReq\x1a\x10.protos.CAStatus2\xfe\x01\n\x06TLSCAP\x12\x30\n\x11ReadCACertificate\x12\r.protos.Empty\x1a\x0c.protos.Cert\x12H\n\x11\x43reateCertificate\x12\x18.protos.TLSCertCreateReq\x1a\x19.protos.TLSCertCreateResp\x12\x37\n\x0fReadCertificate\x12\x16.protos.TLSCertReadReq\x1a\x0c.protos.Cert\x12?\n\x11RevokeCertificate\x12\x18.protos.TLSCertRevokeReq\x1a\x10.protos.CAStatus2I\n\x06TLSCAA\x12?\n\x11RevokeCertificate\x12\x18.protos.TLSCertRevokeReq\x1a\x10.protos.CAStatusb\x06proto3') - , - dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -_CRYPTOTYPE = _descriptor.EnumDescriptor( - name='CryptoType', - full_name='protos.CryptoType', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='ECDSA', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='RSA', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DSA', index=2, number=2, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=3397, - serialized_end=3438, -) -_sym_db.RegisterEnumDescriptor(_CRYPTOTYPE) - -CryptoType = enum_type_wrapper.EnumTypeWrapper(_CRYPTOTYPE) -_ROLE = _descriptor.EnumDescriptor( - name='Role', - full_name='protos.Role', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='NONE', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CLIENT', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PEER', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='VALIDATOR', index=3, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='AUDITOR', index=4, number=8, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ALL', index=5, number=65535, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=3440, - serialized_end=3517, -) -_sym_db.RegisterEnumDescriptor(_ROLE) - -Role = enum_type_wrapper.EnumTypeWrapper(_ROLE) -ECDSA = 0 -RSA = 1 -DSA = 2 -NONE = 0 -CLIENT = 1 -PEER = 2 -VALIDATOR = 4 -AUDITOR = 8 -ALL = 65535 - - -_CASTATUS_STATUSCODE = _descriptor.EnumDescriptor( - name='StatusCode', - full_name='protos.CAStatus.StatusCode', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='OK', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='UNKNOWN_ERROR', index=1, number=1, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=110, - serialized_end=149, -) -_sym_db.RegisterEnumDescriptor(_CASTATUS_STATUSCODE) - - -_CASTATUS = _descriptor.Descriptor( - name='CAStatus', - full_name='protos.CAStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='protos.CAStatus.status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CASTATUS_STATUSCODE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=53, - serialized_end=149, -) - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='protos.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=151, - serialized_end=158, -) - - -_IDENTITY = _descriptor.Descriptor( - name='Identity', - full_name='protos.Identity', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.Identity.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=160, - serialized_end=182, -) - - -_TOKEN = _descriptor.Descriptor( - name='Token', - full_name='protos.Token', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='tok', full_name='protos.Token.tok', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=184, - serialized_end=204, -) - - -_HASH = _descriptor.Descriptor( - name='Hash', - full_name='protos.Hash', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='hash', full_name='protos.Hash.hash', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=206, - serialized_end=226, -) - - -_PUBLICKEY = _descriptor.Descriptor( - name='PublicKey', - full_name='protos.PublicKey', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.PublicKey.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='key', full_name='protos.PublicKey.key', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=228, - serialized_end=286, -) - - -_PRIVATEKEY = _descriptor.Descriptor( - name='PrivateKey', - full_name='protos.PrivateKey', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.PrivateKey.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='key', full_name='protos.PrivateKey.key', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=288, - serialized_end=347, -) - - -_SIGNATURE = _descriptor.Descriptor( - name='Signature', - full_name='protos.Signature', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.Signature.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='r', full_name='protos.Signature.r', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='s', full_name='protos.Signature.s', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=349, - serialized_end=416, -) - - -_REGISTERUSERREQ = _descriptor.Descriptor( - name='RegisterUserReq', - full_name='protos.RegisterUserReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.RegisterUserReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='role', full_name='protos.RegisterUserReq.role', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='account', full_name='protos.RegisterUserReq.account', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='affiliation', full_name='protos.RegisterUserReq.affiliation', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=418, - serialized_end=531, -) - - -_READUSERSETREQ = _descriptor.Descriptor( - name='ReadUserSetReq', - full_name='protos.ReadUserSetReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='req', full_name='protos.ReadUserSetReq.req', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='role', full_name='protos.ReadUserSetReq.role', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.ReadUserSetReq.sig', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=533, - serialized_end=640, -) - - -_USER = _descriptor.Descriptor( - name='User', - full_name='protos.User', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.User.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='role', full_name='protos.User.role', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=642, - serialized_end=706, -) - - -_USERSET = _descriptor.Descriptor( - name='UserSet', - full_name='protos.UserSet', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='users', full_name='protos.UserSet.users', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=708, - serialized_end=746, -) - - -_ECERTCREATEREQ = _descriptor.Descriptor( - name='ECertCreateReq', - full_name='protos.ECertCreateReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.ECertCreateReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.ECertCreateReq.id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='tok', full_name='protos.ECertCreateReq.tok', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sign', full_name='protos.ECertCreateReq.sign', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='enc', full_name='protos.ECertCreateReq.enc', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.ECertCreateReq.sig', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=749, - serialized_end=960, -) - - -_ECERTCREATERESP = _descriptor.Descriptor( - name='ECertCreateResp', - full_name='protos.ECertCreateResp', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='certs', full_name='protos.ECertCreateResp.certs', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chain', full_name='protos.ECertCreateResp.chain', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='pkchain', full_name='protos.ECertCreateResp.pkchain', index=2, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='tok', full_name='protos.ECertCreateResp.tok', index=3, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=962, - serialized_end=1087, -) - - -_ECERTREADREQ = _descriptor.Descriptor( - name='ECertReadReq', - full_name='protos.ECertReadReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.ECertReadReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1089, - serialized_end=1133, -) - - -_ECERTREVOKEREQ = _descriptor.Descriptor( - name='ECertRevokeReq', - full_name='protos.ECertRevokeReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.ECertRevokeReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='cert', full_name='protos.ECertRevokeReq.cert', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.ECertRevokeReq.sig', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1135, - serialized_end=1241, -) - - -_ECERTCRLREQ = _descriptor.Descriptor( - name='ECertCRLReq', - full_name='protos.ECertCRLReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.ECertCRLReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.ECertCRLReq.sig', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1243, - serialized_end=1318, -) - - -_TCERTCREATEREQ = _descriptor.Descriptor( - name='TCertCreateReq', - full_name='protos.TCertCreateReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TCertCreateReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertCreateReq.id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='pub', full_name='protos.TCertCreateReq.pub', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertCreateReq.sig', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1321, - serialized_end=1471, -) - - -_TCERTCREATERESP = _descriptor.Descriptor( - name='TCertCreateResp', - full_name='protos.TCertCreateResp', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='cert', full_name='protos.TCertCreateResp.cert', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1473, - serialized_end=1518, -) - - -_TCERTCREATESETREQ = _descriptor.Descriptor( - name='TCertCreateSetReq', - full_name='protos.TCertCreateSetReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TCertCreateSetReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertCreateSetReq.id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='num', full_name='protos.TCertCreateSetReq.num', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='attributes', full_name='protos.TCertCreateSetReq.attributes', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertCreateSetReq.sig', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1521, - serialized_end=1699, -) - - -_TCERTATTRIBUTE = _descriptor.Descriptor( - name='TCertAttribute', - full_name='protos.TCertAttribute', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='attributeName', full_name='protos.TCertAttribute.attributeName', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='attributeValue', full_name='protos.TCertAttribute.attributeValue', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1701, - serialized_end=1764, -) - - -_TCERTCREATESETRESP = _descriptor.Descriptor( - name='TCertCreateSetResp', - full_name='protos.TCertCreateSetResp', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='certs', full_name='protos.TCertCreateSetResp.certs', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1766, - serialized_end=1818, -) - - -_TCERTREADREQ = _descriptor.Descriptor( - name='TCertReadReq', - full_name='protos.TCertReadReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TCertReadReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='hash', full_name='protos.TCertReadReq.hash', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='req', full_name='protos.TCertReadReq.req', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertReadReq.id', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertReadReq.sig', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1821, - serialized_end=1996, -) - - -_TCERTREADSETREQ = _descriptor.Descriptor( - name='TCertReadSetReq', - full_name='protos.TCertReadSetReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TCertReadSetReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='req', full_name='protos.TCertReadSetReq.req', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertReadSetReq.id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='num', full_name='protos.TCertReadSetReq.num', index=3, - number=4, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertReadSetReq.sig', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1999, - serialized_end=2162, -) - - -_TCERTREADSETSREQ = _descriptor.Descriptor( - name='TCertReadSetsReq', - full_name='protos.TCertReadSetsReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='begin', full_name='protos.TCertReadSetsReq.begin', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='end', full_name='protos.TCertReadSetsReq.end', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='req', full_name='protos.TCertReadSetsReq.req', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='role', full_name='protos.TCertReadSetsReq.role', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertReadSetsReq.sig', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2165, - serialized_end=2358, -) - - -_TCERTREVOKEREQ = _descriptor.Descriptor( - name='TCertRevokeReq', - full_name='protos.TCertRevokeReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertRevokeReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='cert', full_name='protos.TCertRevokeReq.cert', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertRevokeReq.sig', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2360, - serialized_end=2466, -) - - -_TCERTREVOKESETREQ = _descriptor.Descriptor( - name='TCertRevokeSetReq', - full_name='protos.TCertRevokeSetReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertRevokeSetReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TCertRevokeSetReq.ts', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertRevokeSetReq.sig', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2468, - serialized_end=2589, -) - - -_TCERTCRLREQ = _descriptor.Descriptor( - name='TCertCRLReq', - full_name='protos.TCertCRLReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.TCertCRLReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TCertCRLReq.sig', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2591, - serialized_end=2666, -) - - -_TLSCERTCREATEREQ = _descriptor.Descriptor( - name='TLSCertCreateReq', - full_name='protos.TLSCertCreateReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.TLSCertCreateReq.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.TLSCertCreateReq.id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='pub', full_name='protos.TLSCertCreateReq.pub', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TLSCertCreateReq.sig', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2669, - serialized_end=2821, -) - - -_TLSCERTCREATERESP = _descriptor.Descriptor( - name='TLSCertCreateResp', - full_name='protos.TLSCertCreateResp', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='cert', full_name='protos.TLSCertCreateResp.cert', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='rootCert', full_name='protos.TLSCertCreateResp.rootCert', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2823, - serialized_end=2902, -) - - -_TLSCERTREADREQ = _descriptor.Descriptor( - name='TLSCertReadReq', - full_name='protos.TLSCertReadReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.TLSCertReadReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2904, - serialized_end=2950, -) - - -_TLSCERTREVOKEREQ = _descriptor.Descriptor( - name='TLSCertRevokeReq', - full_name='protos.TLSCertRevokeReq', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.TLSCertRevokeReq.id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='cert', full_name='protos.TLSCertRevokeReq.cert', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sig', full_name='protos.TLSCertRevokeReq.sig', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2952, - serialized_end=3060, -) - - -_CERT = _descriptor.Descriptor( - name='Cert', - full_name='protos.Cert', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='cert', full_name='protos.Cert.cert', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3062, - serialized_end=3082, -) - - -_TCERT_KEYSENTRY = _descriptor.Descriptor( - name='KeysEntry', - full_name='protos.TCert.KeysEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.TCert.KeysEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='protos.TCert.KeysEntry.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=_descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3146, - serialized_end=3189, -) - -_TCERT = _descriptor.Descriptor( - name='TCert', - full_name='protos.TCert', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='cert', full_name='protos.TCert.cert', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='keys', full_name='protos.TCert.keys', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[_TCERT_KEYSENTRY, ], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3084, - serialized_end=3189, -) - - -_CERTSET = _descriptor.Descriptor( - name='CertSet', - full_name='protos.CertSet', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ts', full_name='protos.CertSet.ts', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.CertSet.id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='key', full_name='protos.CertSet.key', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='certs', full_name='protos.CertSet.certs', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3191, - serialized_end=3313, -) - - -_CERTSETS = _descriptor.Descriptor( - name='CertSets', - full_name='protos.CertSets', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='sets', full_name='protos.CertSets.sets', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3315, - serialized_end=3356, -) - - -_CERTPAIR = _descriptor.Descriptor( - name='CertPair', - full_name='protos.CertPair', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='sign', full_name='protos.CertPair.sign', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='enc', full_name='protos.CertPair.enc', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3358, - serialized_end=3395, -) - -_CASTATUS.fields_by_name['status'].enum_type = _CASTATUS_STATUSCODE -_CASTATUS_STATUSCODE.containing_type = _CASTATUS -_PUBLICKEY.fields_by_name['type'].enum_type = _CRYPTOTYPE -_PRIVATEKEY.fields_by_name['type'].enum_type = _CRYPTOTYPE -_SIGNATURE.fields_by_name['type'].enum_type = _CRYPTOTYPE -_REGISTERUSERREQ.fields_by_name['id'].message_type = _IDENTITY -_REGISTERUSERREQ.fields_by_name['role'].enum_type = _ROLE -_READUSERSETREQ.fields_by_name['req'].message_type = _IDENTITY -_READUSERSETREQ.fields_by_name['role'].enum_type = _ROLE -_READUSERSETREQ.fields_by_name['sig'].message_type = _SIGNATURE -_USER.fields_by_name['id'].message_type = _IDENTITY -_USER.fields_by_name['role'].enum_type = _ROLE -_USERSET.fields_by_name['users'].message_type = _USER -_ECERTCREATEREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ECERTCREATEREQ.fields_by_name['id'].message_type = _IDENTITY -_ECERTCREATEREQ.fields_by_name['tok'].message_type = _TOKEN -_ECERTCREATEREQ.fields_by_name['sign'].message_type = _PUBLICKEY -_ECERTCREATEREQ.fields_by_name['enc'].message_type = _PUBLICKEY -_ECERTCREATEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_ECERTCREATERESP.fields_by_name['certs'].message_type = _CERTPAIR -_ECERTCREATERESP.fields_by_name['chain'].message_type = _TOKEN -_ECERTCREATERESP.fields_by_name['tok'].message_type = _TOKEN -_ECERTREADREQ.fields_by_name['id'].message_type = _IDENTITY -_ECERTREVOKEREQ.fields_by_name['id'].message_type = _IDENTITY -_ECERTREVOKEREQ.fields_by_name['cert'].message_type = _CERT -_ECERTREVOKEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_ECERTCRLREQ.fields_by_name['id'].message_type = _IDENTITY -_ECERTCRLREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTCREATEREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTCREATEREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTCREATEREQ.fields_by_name['pub'].message_type = _PUBLICKEY -_TCERTCREATEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTCREATERESP.fields_by_name['cert'].message_type = _CERT -_TCERTCREATESETREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTCREATESETREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTCREATESETREQ.fields_by_name['attributes'].message_type = _TCERTATTRIBUTE -_TCERTCREATESETREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTCREATESETRESP.fields_by_name['certs'].message_type = _CERTSET -_TCERTREADREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTREADREQ.fields_by_name['hash'].message_type = _HASH -_TCERTREADREQ.fields_by_name['req'].message_type = _IDENTITY -_TCERTREADREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTREADREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTREADSETREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTREADSETREQ.fields_by_name['req'].message_type = _IDENTITY -_TCERTREADSETREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTREADSETREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTREADSETSREQ.fields_by_name['begin'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTREADSETSREQ.fields_by_name['end'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTREADSETSREQ.fields_by_name['req'].message_type = _IDENTITY -_TCERTREADSETSREQ.fields_by_name['role'].enum_type = _ROLE -_TCERTREADSETSREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTREVOKEREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTREVOKEREQ.fields_by_name['cert'].message_type = _CERT -_TCERTREVOKEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTREVOKESETREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTREVOKESETREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TCERTREVOKESETREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERTCRLREQ.fields_by_name['id'].message_type = _IDENTITY -_TCERTCRLREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TLSCERTCREATEREQ.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TLSCERTCREATEREQ.fields_by_name['id'].message_type = _IDENTITY -_TLSCERTCREATEREQ.fields_by_name['pub'].message_type = _PUBLICKEY -_TLSCERTCREATEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TLSCERTCREATERESP.fields_by_name['cert'].message_type = _CERT -_TLSCERTCREATERESP.fields_by_name['rootCert'].message_type = _CERT -_TLSCERTREADREQ.fields_by_name['id'].message_type = _IDENTITY -_TLSCERTREVOKEREQ.fields_by_name['id'].message_type = _IDENTITY -_TLSCERTREVOKEREQ.fields_by_name['cert'].message_type = _CERT -_TLSCERTREVOKEREQ.fields_by_name['sig'].message_type = _SIGNATURE -_TCERT_KEYSENTRY.containing_type = _TCERT -_TCERT.fields_by_name['keys'].message_type = _TCERT_KEYSENTRY -_CERTSET.fields_by_name['ts'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CERTSET.fields_by_name['id'].message_type = _IDENTITY -_CERTSET.fields_by_name['certs'].message_type = _TCERT -_CERTSETS.fields_by_name['sets'].message_type = _CERTSET -DESCRIPTOR.message_types_by_name['CAStatus'] = _CASTATUS -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Identity'] = _IDENTITY -DESCRIPTOR.message_types_by_name['Token'] = _TOKEN -DESCRIPTOR.message_types_by_name['Hash'] = _HASH -DESCRIPTOR.message_types_by_name['PublicKey'] = _PUBLICKEY -DESCRIPTOR.message_types_by_name['PrivateKey'] = _PRIVATEKEY -DESCRIPTOR.message_types_by_name['Signature'] = _SIGNATURE -DESCRIPTOR.message_types_by_name['RegisterUserReq'] = _REGISTERUSERREQ -DESCRIPTOR.message_types_by_name['ReadUserSetReq'] = _READUSERSETREQ -DESCRIPTOR.message_types_by_name['User'] = _USER -DESCRIPTOR.message_types_by_name['UserSet'] = _USERSET -DESCRIPTOR.message_types_by_name['ECertCreateReq'] = _ECERTCREATEREQ -DESCRIPTOR.message_types_by_name['ECertCreateResp'] = _ECERTCREATERESP -DESCRIPTOR.message_types_by_name['ECertReadReq'] = _ECERTREADREQ -DESCRIPTOR.message_types_by_name['ECertRevokeReq'] = _ECERTREVOKEREQ -DESCRIPTOR.message_types_by_name['ECertCRLReq'] = _ECERTCRLREQ -DESCRIPTOR.message_types_by_name['TCertCreateReq'] = _TCERTCREATEREQ -DESCRIPTOR.message_types_by_name['TCertCreateResp'] = _TCERTCREATERESP -DESCRIPTOR.message_types_by_name['TCertCreateSetReq'] = _TCERTCREATESETREQ -DESCRIPTOR.message_types_by_name['TCertAttribute'] = _TCERTATTRIBUTE -DESCRIPTOR.message_types_by_name['TCertCreateSetResp'] = _TCERTCREATESETRESP -DESCRIPTOR.message_types_by_name['TCertReadReq'] = _TCERTREADREQ -DESCRIPTOR.message_types_by_name['TCertReadSetReq'] = _TCERTREADSETREQ -DESCRIPTOR.message_types_by_name['TCertReadSetsReq'] = _TCERTREADSETSREQ -DESCRIPTOR.message_types_by_name['TCertRevokeReq'] = _TCERTREVOKEREQ -DESCRIPTOR.message_types_by_name['TCertRevokeSetReq'] = _TCERTREVOKESETREQ -DESCRIPTOR.message_types_by_name['TCertCRLReq'] = _TCERTCRLREQ -DESCRIPTOR.message_types_by_name['TLSCertCreateReq'] = _TLSCERTCREATEREQ -DESCRIPTOR.message_types_by_name['TLSCertCreateResp'] = _TLSCERTCREATERESP -DESCRIPTOR.message_types_by_name['TLSCertReadReq'] = _TLSCERTREADREQ -DESCRIPTOR.message_types_by_name['TLSCertRevokeReq'] = _TLSCERTREVOKEREQ -DESCRIPTOR.message_types_by_name['Cert'] = _CERT -DESCRIPTOR.message_types_by_name['TCert'] = _TCERT -DESCRIPTOR.message_types_by_name['CertSet'] = _CERTSET -DESCRIPTOR.message_types_by_name['CertSets'] = _CERTSETS -DESCRIPTOR.message_types_by_name['CertPair'] = _CERTPAIR -DESCRIPTOR.enum_types_by_name['CryptoType'] = _CRYPTOTYPE -DESCRIPTOR.enum_types_by_name['Role'] = _ROLE - -CAStatus = _reflection.GeneratedProtocolMessageType('CAStatus', (_message.Message,), dict( - DESCRIPTOR = _CASTATUS, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.CAStatus) - )) -_sym_db.RegisterMessage(CAStatus) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict( - DESCRIPTOR = _EMPTY, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Empty) - )) -_sym_db.RegisterMessage(Empty) - -Identity = _reflection.GeneratedProtocolMessageType('Identity', (_message.Message,), dict( - DESCRIPTOR = _IDENTITY, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Identity) - )) -_sym_db.RegisterMessage(Identity) - -Token = _reflection.GeneratedProtocolMessageType('Token', (_message.Message,), dict( - DESCRIPTOR = _TOKEN, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Token) - )) -_sym_db.RegisterMessage(Token) - -Hash = _reflection.GeneratedProtocolMessageType('Hash', (_message.Message,), dict( - DESCRIPTOR = _HASH, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Hash) - )) -_sym_db.RegisterMessage(Hash) - -PublicKey = _reflection.GeneratedProtocolMessageType('PublicKey', (_message.Message,), dict( - DESCRIPTOR = _PUBLICKEY, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.PublicKey) - )) -_sym_db.RegisterMessage(PublicKey) - -PrivateKey = _reflection.GeneratedProtocolMessageType('PrivateKey', (_message.Message,), dict( - DESCRIPTOR = _PRIVATEKEY, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.PrivateKey) - )) -_sym_db.RegisterMessage(PrivateKey) - -Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), dict( - DESCRIPTOR = _SIGNATURE, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Signature) - )) -_sym_db.RegisterMessage(Signature) - -RegisterUserReq = _reflection.GeneratedProtocolMessageType('RegisterUserReq', (_message.Message,), dict( - DESCRIPTOR = _REGISTERUSERREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.RegisterUserReq) - )) -_sym_db.RegisterMessage(RegisterUserReq) - -ReadUserSetReq = _reflection.GeneratedProtocolMessageType('ReadUserSetReq', (_message.Message,), dict( - DESCRIPTOR = _READUSERSETREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ReadUserSetReq) - )) -_sym_db.RegisterMessage(ReadUserSetReq) - -User = _reflection.GeneratedProtocolMessageType('User', (_message.Message,), dict( - DESCRIPTOR = _USER, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.User) - )) -_sym_db.RegisterMessage(User) - -UserSet = _reflection.GeneratedProtocolMessageType('UserSet', (_message.Message,), dict( - DESCRIPTOR = _USERSET, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.UserSet) - )) -_sym_db.RegisterMessage(UserSet) - -ECertCreateReq = _reflection.GeneratedProtocolMessageType('ECertCreateReq', (_message.Message,), dict( - DESCRIPTOR = _ECERTCREATEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ECertCreateReq) - )) -_sym_db.RegisterMessage(ECertCreateReq) - -ECertCreateResp = _reflection.GeneratedProtocolMessageType('ECertCreateResp', (_message.Message,), dict( - DESCRIPTOR = _ECERTCREATERESP, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ECertCreateResp) - )) -_sym_db.RegisterMessage(ECertCreateResp) - -ECertReadReq = _reflection.GeneratedProtocolMessageType('ECertReadReq', (_message.Message,), dict( - DESCRIPTOR = _ECERTREADREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ECertReadReq) - )) -_sym_db.RegisterMessage(ECertReadReq) - -ECertRevokeReq = _reflection.GeneratedProtocolMessageType('ECertRevokeReq', (_message.Message,), dict( - DESCRIPTOR = _ECERTREVOKEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ECertRevokeReq) - )) -_sym_db.RegisterMessage(ECertRevokeReq) - -ECertCRLReq = _reflection.GeneratedProtocolMessageType('ECertCRLReq', (_message.Message,), dict( - DESCRIPTOR = _ECERTCRLREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.ECertCRLReq) - )) -_sym_db.RegisterMessage(ECertCRLReq) - -TCertCreateReq = _reflection.GeneratedProtocolMessageType('TCertCreateReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTCREATEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertCreateReq) - )) -_sym_db.RegisterMessage(TCertCreateReq) - -TCertCreateResp = _reflection.GeneratedProtocolMessageType('TCertCreateResp', (_message.Message,), dict( - DESCRIPTOR = _TCERTCREATERESP, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertCreateResp) - )) -_sym_db.RegisterMessage(TCertCreateResp) - -TCertCreateSetReq = _reflection.GeneratedProtocolMessageType('TCertCreateSetReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTCREATESETREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertCreateSetReq) - )) -_sym_db.RegisterMessage(TCertCreateSetReq) - -TCertAttribute = _reflection.GeneratedProtocolMessageType('TCertAttribute', (_message.Message,), dict( - DESCRIPTOR = _TCERTATTRIBUTE, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertAttribute) - )) -_sym_db.RegisterMessage(TCertAttribute) - -TCertCreateSetResp = _reflection.GeneratedProtocolMessageType('TCertCreateSetResp', (_message.Message,), dict( - DESCRIPTOR = _TCERTCREATESETRESP, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertCreateSetResp) - )) -_sym_db.RegisterMessage(TCertCreateSetResp) - -TCertReadReq = _reflection.GeneratedProtocolMessageType('TCertReadReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTREADREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertReadReq) - )) -_sym_db.RegisterMessage(TCertReadReq) - -TCertReadSetReq = _reflection.GeneratedProtocolMessageType('TCertReadSetReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTREADSETREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertReadSetReq) - )) -_sym_db.RegisterMessage(TCertReadSetReq) - -TCertReadSetsReq = _reflection.GeneratedProtocolMessageType('TCertReadSetsReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTREADSETSREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertReadSetsReq) - )) -_sym_db.RegisterMessage(TCertReadSetsReq) - -TCertRevokeReq = _reflection.GeneratedProtocolMessageType('TCertRevokeReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTREVOKEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertRevokeReq) - )) -_sym_db.RegisterMessage(TCertRevokeReq) - -TCertRevokeSetReq = _reflection.GeneratedProtocolMessageType('TCertRevokeSetReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTREVOKESETREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertRevokeSetReq) - )) -_sym_db.RegisterMessage(TCertRevokeSetReq) - -TCertCRLReq = _reflection.GeneratedProtocolMessageType('TCertCRLReq', (_message.Message,), dict( - DESCRIPTOR = _TCERTCRLREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCertCRLReq) - )) -_sym_db.RegisterMessage(TCertCRLReq) - -TLSCertCreateReq = _reflection.GeneratedProtocolMessageType('TLSCertCreateReq', (_message.Message,), dict( - DESCRIPTOR = _TLSCERTCREATEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TLSCertCreateReq) - )) -_sym_db.RegisterMessage(TLSCertCreateReq) - -TLSCertCreateResp = _reflection.GeneratedProtocolMessageType('TLSCertCreateResp', (_message.Message,), dict( - DESCRIPTOR = _TLSCERTCREATERESP, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TLSCertCreateResp) - )) -_sym_db.RegisterMessage(TLSCertCreateResp) - -TLSCertReadReq = _reflection.GeneratedProtocolMessageType('TLSCertReadReq', (_message.Message,), dict( - DESCRIPTOR = _TLSCERTREADREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TLSCertReadReq) - )) -_sym_db.RegisterMessage(TLSCertReadReq) - -TLSCertRevokeReq = _reflection.GeneratedProtocolMessageType('TLSCertRevokeReq', (_message.Message,), dict( - DESCRIPTOR = _TLSCERTREVOKEREQ, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TLSCertRevokeReq) - )) -_sym_db.RegisterMessage(TLSCertRevokeReq) - -Cert = _reflection.GeneratedProtocolMessageType('Cert', (_message.Message,), dict( - DESCRIPTOR = _CERT, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.Cert) - )) -_sym_db.RegisterMessage(Cert) - -TCert = _reflection.GeneratedProtocolMessageType('TCert', (_message.Message,), dict( - - KeysEntry = _reflection.GeneratedProtocolMessageType('KeysEntry', (_message.Message,), dict( - DESCRIPTOR = _TCERT_KEYSENTRY, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCert.KeysEntry) - )) - , - DESCRIPTOR = _TCERT, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.TCert) - )) -_sym_db.RegisterMessage(TCert) -_sym_db.RegisterMessage(TCert.KeysEntry) - -CertSet = _reflection.GeneratedProtocolMessageType('CertSet', (_message.Message,), dict( - DESCRIPTOR = _CERTSET, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.CertSet) - )) -_sym_db.RegisterMessage(CertSet) - -CertSets = _reflection.GeneratedProtocolMessageType('CertSets', (_message.Message,), dict( - DESCRIPTOR = _CERTSETS, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.CertSets) - )) -_sym_db.RegisterMessage(CertSets) - -CertPair = _reflection.GeneratedProtocolMessageType('CertPair', (_message.Message,), dict( - DESCRIPTOR = _CERTPAIR, - __module__ = 'ca_pb2' - # @@protoc_insertion_point(class_scope:protos.CertPair) - )) -_sym_db.RegisterMessage(CertPair) - - -_TCERT_KEYSENTRY.has_options = True -_TCERT_KEYSENTRY._options = _descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')) -import abc -import six -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - -class BetaECAPServicer(object): - """Enrollment Certificate Authority (ECA). - - public service - """ - def ReadCACertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def CreateCertificatePair(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadCertificatePair(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadCertificateByHash(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificatePair(self, request, context): - """a user can revoke only his/her own cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaECAPStub(object): - """Enrollment Certificate Authority (ECA). - - public service - """ - def ReadCACertificate(self, request, timeout): - raise NotImplementedError() - ReadCACertificate.future = None - def CreateCertificatePair(self, request, timeout): - raise NotImplementedError() - CreateCertificatePair.future = None - def ReadCertificatePair(self, request, timeout): - raise NotImplementedError() - ReadCertificatePair.future = None - def ReadCertificateByHash(self, request, timeout): - raise NotImplementedError() - ReadCertificateByHash.future = None - def RevokeCertificatePair(self, request, timeout): - """a user can revoke only his/her own cert - """ - raise NotImplementedError() - RevokeCertificatePair.future = None - -def beta_create_ECAP_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.ECAP', 'CreateCertificatePair'): ca_pb2.ECertCreateReq.FromString, - ('protos.ECAP', 'ReadCACertificate'): ca_pb2.Empty.FromString, - ('protos.ECAP', 'ReadCertificateByHash'): ca_pb2.Hash.FromString, - ('protos.ECAP', 'ReadCertificatePair'): ca_pb2.ECertReadReq.FromString, - ('protos.ECAP', 'RevokeCertificatePair'): ca_pb2.ECertRevokeReq.FromString, - } - response_serializers = { - ('protos.ECAP', 'CreateCertificatePair'): ca_pb2.ECertCreateResp.SerializeToString, - ('protos.ECAP', 'ReadCACertificate'): ca_pb2.Cert.SerializeToString, - ('protos.ECAP', 'ReadCertificateByHash'): ca_pb2.Cert.SerializeToString, - ('protos.ECAP', 'ReadCertificatePair'): ca_pb2.CertPair.SerializeToString, - ('protos.ECAP', 'RevokeCertificatePair'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.ECAP', 'CreateCertificatePair'): face_utilities.unary_unary_inline(servicer.CreateCertificatePair), - ('protos.ECAP', 'ReadCACertificate'): face_utilities.unary_unary_inline(servicer.ReadCACertificate), - ('protos.ECAP', 'ReadCertificateByHash'): face_utilities.unary_unary_inline(servicer.ReadCertificateByHash), - ('protos.ECAP', 'ReadCertificatePair'): face_utilities.unary_unary_inline(servicer.ReadCertificatePair), - ('protos.ECAP', 'RevokeCertificatePair'): face_utilities.unary_unary_inline(servicer.RevokeCertificatePair), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_ECAP_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.ECAP', 'CreateCertificatePair'): ca_pb2.ECertCreateReq.SerializeToString, - ('protos.ECAP', 'ReadCACertificate'): ca_pb2.Empty.SerializeToString, - ('protos.ECAP', 'ReadCertificateByHash'): ca_pb2.Hash.SerializeToString, - ('protos.ECAP', 'ReadCertificatePair'): ca_pb2.ECertReadReq.SerializeToString, - ('protos.ECAP', 'RevokeCertificatePair'): ca_pb2.ECertRevokeReq.SerializeToString, - } - response_deserializers = { - ('protos.ECAP', 'CreateCertificatePair'): ca_pb2.ECertCreateResp.FromString, - ('protos.ECAP', 'ReadCACertificate'): ca_pb2.Cert.FromString, - ('protos.ECAP', 'ReadCertificateByHash'): ca_pb2.Cert.FromString, - ('protos.ECAP', 'ReadCertificatePair'): ca_pb2.CertPair.FromString, - ('protos.ECAP', 'RevokeCertificatePair'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'CreateCertificatePair': cardinality.Cardinality.UNARY_UNARY, - 'ReadCACertificate': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificateByHash': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificatePair': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificatePair': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.ECAP', cardinalities, options=stub_options) - -class BetaECAAServicer(object): - """admin service - """ - def RegisterUser(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadUserSet(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificate(self, request, context): - """an admin can revoke any cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def PublishCRL(self, request, context): - """publishes CRL in the blockchain - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaECAAStub(object): - """admin service - """ - def RegisterUser(self, request, timeout): - raise NotImplementedError() - RegisterUser.future = None - def ReadUserSet(self, request, timeout): - raise NotImplementedError() - ReadUserSet.future = None - def RevokeCertificate(self, request, timeout): - """an admin can revoke any cert - """ - raise NotImplementedError() - RevokeCertificate.future = None - def PublishCRL(self, request, timeout): - """publishes CRL in the blockchain - """ - raise NotImplementedError() - PublishCRL.future = None - -def beta_create_ECAA_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.ECAA', 'PublishCRL'): ca_pb2.ECertCRLReq.FromString, - ('protos.ECAA', 'ReadUserSet'): ca_pb2.ReadUserSetReq.FromString, - ('protos.ECAA', 'RegisterUser'): ca_pb2.RegisterUserReq.FromString, - ('protos.ECAA', 'RevokeCertificate'): ca_pb2.ECertRevokeReq.FromString, - } - response_serializers = { - ('protos.ECAA', 'PublishCRL'): ca_pb2.CAStatus.SerializeToString, - ('protos.ECAA', 'ReadUserSet'): ca_pb2.UserSet.SerializeToString, - ('protos.ECAA', 'RegisterUser'): ca_pb2.Token.SerializeToString, - ('protos.ECAA', 'RevokeCertificate'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.ECAA', 'PublishCRL'): face_utilities.unary_unary_inline(servicer.PublishCRL), - ('protos.ECAA', 'ReadUserSet'): face_utilities.unary_unary_inline(servicer.ReadUserSet), - ('protos.ECAA', 'RegisterUser'): face_utilities.unary_unary_inline(servicer.RegisterUser), - ('protos.ECAA', 'RevokeCertificate'): face_utilities.unary_unary_inline(servicer.RevokeCertificate), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_ECAA_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.ECAA', 'PublishCRL'): ca_pb2.ECertCRLReq.SerializeToString, - ('protos.ECAA', 'ReadUserSet'): ca_pb2.ReadUserSetReq.SerializeToString, - ('protos.ECAA', 'RegisterUser'): ca_pb2.RegisterUserReq.SerializeToString, - ('protos.ECAA', 'RevokeCertificate'): ca_pb2.ECertRevokeReq.SerializeToString, - } - response_deserializers = { - ('protos.ECAA', 'PublishCRL'): ca_pb2.CAStatus.FromString, - ('protos.ECAA', 'ReadUserSet'): ca_pb2.UserSet.FromString, - ('protos.ECAA', 'RegisterUser'): ca_pb2.Token.FromString, - ('protos.ECAA', 'RevokeCertificate'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'PublishCRL': cardinality.Cardinality.UNARY_UNARY, - 'ReadUserSet': cardinality.Cardinality.UNARY_UNARY, - 'RegisterUser': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificate': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.ECAA', cardinalities, options=stub_options) - -class BetaTCAPServicer(object): - """Transaction Certificate Authority (TCA). - - public service - """ - def ReadCACertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def CreateCertificateSet(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadCertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadCertificateSet(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificate(self, request, context): - """a user can revoke only his/her cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificateSet(self, request, context): - """a user can revoke only his/her certs - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaTCAPStub(object): - """Transaction Certificate Authority (TCA). - - public service - """ - def ReadCACertificate(self, request, timeout): - raise NotImplementedError() - ReadCACertificate.future = None - def CreateCertificateSet(self, request, timeout): - raise NotImplementedError() - CreateCertificateSet.future = None - def ReadCertificate(self, request, timeout): - raise NotImplementedError() - ReadCertificate.future = None - def ReadCertificateSet(self, request, timeout): - raise NotImplementedError() - ReadCertificateSet.future = None - def RevokeCertificate(self, request, timeout): - """a user can revoke only his/her cert - """ - raise NotImplementedError() - RevokeCertificate.future = None - def RevokeCertificateSet(self, request, timeout): - """a user can revoke only his/her certs - """ - raise NotImplementedError() - RevokeCertificateSet.future = None - -def beta_create_TCAP_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.TCAP', 'CreateCertificateSet'): ca_pb2.TCertCreateSetReq.FromString, - ('protos.TCAP', 'ReadCACertificate'): ca_pb2.Empty.FromString, - ('protos.TCAP', 'ReadCertificate'): ca_pb2.TCertReadReq.FromString, - ('protos.TCAP', 'ReadCertificateSet'): ca_pb2.TCertReadSetReq.FromString, - ('protos.TCAP', 'RevokeCertificate'): ca_pb2.TCertRevokeReq.FromString, - ('protos.TCAP', 'RevokeCertificateSet'): ca_pb2.TCertRevokeSetReq.FromString, - } - response_serializers = { - ('protos.TCAP', 'CreateCertificateSet'): ca_pb2.TCertCreateSetResp.SerializeToString, - ('protos.TCAP', 'ReadCACertificate'): ca_pb2.Cert.SerializeToString, - ('protos.TCAP', 'ReadCertificate'): ca_pb2.Cert.SerializeToString, - ('protos.TCAP', 'ReadCertificateSet'): ca_pb2.CertSet.SerializeToString, - ('protos.TCAP', 'RevokeCertificate'): ca_pb2.CAStatus.SerializeToString, - ('protos.TCAP', 'RevokeCertificateSet'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.TCAP', 'CreateCertificateSet'): face_utilities.unary_unary_inline(servicer.CreateCertificateSet), - ('protos.TCAP', 'ReadCACertificate'): face_utilities.unary_unary_inline(servicer.ReadCACertificate), - ('protos.TCAP', 'ReadCertificate'): face_utilities.unary_unary_inline(servicer.ReadCertificate), - ('protos.TCAP', 'ReadCertificateSet'): face_utilities.unary_unary_inline(servicer.ReadCertificateSet), - ('protos.TCAP', 'RevokeCertificate'): face_utilities.unary_unary_inline(servicer.RevokeCertificate), - ('protos.TCAP', 'RevokeCertificateSet'): face_utilities.unary_unary_inline(servicer.RevokeCertificateSet), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_TCAP_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.TCAP', 'CreateCertificateSet'): ca_pb2.TCertCreateSetReq.SerializeToString, - ('protos.TCAP', 'ReadCACertificate'): ca_pb2.Empty.SerializeToString, - ('protos.TCAP', 'ReadCertificate'): ca_pb2.TCertReadReq.SerializeToString, - ('protos.TCAP', 'ReadCertificateSet'): ca_pb2.TCertReadSetReq.SerializeToString, - ('protos.TCAP', 'RevokeCertificate'): ca_pb2.TCertRevokeReq.SerializeToString, - ('protos.TCAP', 'RevokeCertificateSet'): ca_pb2.TCertRevokeSetReq.SerializeToString, - } - response_deserializers = { - ('protos.TCAP', 'CreateCertificateSet'): ca_pb2.TCertCreateSetResp.FromString, - ('protos.TCAP', 'ReadCACertificate'): ca_pb2.Cert.FromString, - ('protos.TCAP', 'ReadCertificate'): ca_pb2.Cert.FromString, - ('protos.TCAP', 'ReadCertificateSet'): ca_pb2.CertSet.FromString, - ('protos.TCAP', 'RevokeCertificate'): ca_pb2.CAStatus.FromString, - ('protos.TCAP', 'RevokeCertificateSet'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'CreateCertificateSet': cardinality.Cardinality.UNARY_UNARY, - 'ReadCACertificate': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificate': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificateSet': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificate': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificateSet': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.TCAP', cardinalities, options=stub_options) - -class BetaTCAAServicer(object): - """admin service - """ - def ReadCertificateSets(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificate(self, request, context): - """an admin can revoke any cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificateSet(self, request, context): - """an admin can revoke any cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def PublishCRL(self, request, context): - """publishes CRL in the blockchain - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaTCAAStub(object): - """admin service - """ - def ReadCertificateSets(self, request, timeout): - raise NotImplementedError() - ReadCertificateSets.future = None - def RevokeCertificate(self, request, timeout): - """an admin can revoke any cert - """ - raise NotImplementedError() - RevokeCertificate.future = None - def RevokeCertificateSet(self, request, timeout): - """an admin can revoke any cert - """ - raise NotImplementedError() - RevokeCertificateSet.future = None - def PublishCRL(self, request, timeout): - """publishes CRL in the blockchain - """ - raise NotImplementedError() - PublishCRL.future = None - -def beta_create_TCAA_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.TCAA', 'PublishCRL'): ca_pb2.TCertCRLReq.FromString, - ('protos.TCAA', 'ReadCertificateSets'): ca_pb2.TCertReadSetsReq.FromString, - ('protos.TCAA', 'RevokeCertificate'): ca_pb2.TCertRevokeReq.FromString, - ('protos.TCAA', 'RevokeCertificateSet'): ca_pb2.TCertRevokeSetReq.FromString, - } - response_serializers = { - ('protos.TCAA', 'PublishCRL'): ca_pb2.CAStatus.SerializeToString, - ('protos.TCAA', 'ReadCertificateSets'): ca_pb2.CertSets.SerializeToString, - ('protos.TCAA', 'RevokeCertificate'): ca_pb2.CAStatus.SerializeToString, - ('protos.TCAA', 'RevokeCertificateSet'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.TCAA', 'PublishCRL'): face_utilities.unary_unary_inline(servicer.PublishCRL), - ('protos.TCAA', 'ReadCertificateSets'): face_utilities.unary_unary_inline(servicer.ReadCertificateSets), - ('protos.TCAA', 'RevokeCertificate'): face_utilities.unary_unary_inline(servicer.RevokeCertificate), - ('protos.TCAA', 'RevokeCertificateSet'): face_utilities.unary_unary_inline(servicer.RevokeCertificateSet), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_TCAA_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.TCAA', 'PublishCRL'): ca_pb2.TCertCRLReq.SerializeToString, - ('protos.TCAA', 'ReadCertificateSets'): ca_pb2.TCertReadSetsReq.SerializeToString, - ('protos.TCAA', 'RevokeCertificate'): ca_pb2.TCertRevokeReq.SerializeToString, - ('protos.TCAA', 'RevokeCertificateSet'): ca_pb2.TCertRevokeSetReq.SerializeToString, - } - response_deserializers = { - ('protos.TCAA', 'PublishCRL'): ca_pb2.CAStatus.FromString, - ('protos.TCAA', 'ReadCertificateSets'): ca_pb2.CertSets.FromString, - ('protos.TCAA', 'RevokeCertificate'): ca_pb2.CAStatus.FromString, - ('protos.TCAA', 'RevokeCertificateSet'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'PublishCRL': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificateSets': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificate': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificateSet': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.TCAA', cardinalities, options=stub_options) - -class BetaTLSCAPServicer(object): - """TLS Certificate Authority (TLSCA) - - public service - """ - def ReadCACertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def CreateCertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ReadCertificate(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def RevokeCertificate(self, request, context): - """a user can revoke only his/her cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaTLSCAPStub(object): - """TLS Certificate Authority (TLSCA) - - public service - """ - def ReadCACertificate(self, request, timeout): - raise NotImplementedError() - ReadCACertificate.future = None - def CreateCertificate(self, request, timeout): - raise NotImplementedError() - CreateCertificate.future = None - def ReadCertificate(self, request, timeout): - raise NotImplementedError() - ReadCertificate.future = None - def RevokeCertificate(self, request, timeout): - """a user can revoke only his/her cert - """ - raise NotImplementedError() - RevokeCertificate.future = None - -def beta_create_TLSCAP_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.TLSCAP', 'CreateCertificate'): ca_pb2.TLSCertCreateReq.FromString, - ('protos.TLSCAP', 'ReadCACertificate'): ca_pb2.Empty.FromString, - ('protos.TLSCAP', 'ReadCertificate'): ca_pb2.TLSCertReadReq.FromString, - ('protos.TLSCAP', 'RevokeCertificate'): ca_pb2.TLSCertRevokeReq.FromString, - } - response_serializers = { - ('protos.TLSCAP', 'CreateCertificate'): ca_pb2.TLSCertCreateResp.SerializeToString, - ('protos.TLSCAP', 'ReadCACertificate'): ca_pb2.Cert.SerializeToString, - ('protos.TLSCAP', 'ReadCertificate'): ca_pb2.Cert.SerializeToString, - ('protos.TLSCAP', 'RevokeCertificate'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.TLSCAP', 'CreateCertificate'): face_utilities.unary_unary_inline(servicer.CreateCertificate), - ('protos.TLSCAP', 'ReadCACertificate'): face_utilities.unary_unary_inline(servicer.ReadCACertificate), - ('protos.TLSCAP', 'ReadCertificate'): face_utilities.unary_unary_inline(servicer.ReadCertificate), - ('protos.TLSCAP', 'RevokeCertificate'): face_utilities.unary_unary_inline(servicer.RevokeCertificate), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_TLSCAP_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.TLSCAP', 'CreateCertificate'): ca_pb2.TLSCertCreateReq.SerializeToString, - ('protos.TLSCAP', 'ReadCACertificate'): ca_pb2.Empty.SerializeToString, - ('protos.TLSCAP', 'ReadCertificate'): ca_pb2.TLSCertReadReq.SerializeToString, - ('protos.TLSCAP', 'RevokeCertificate'): ca_pb2.TLSCertRevokeReq.SerializeToString, - } - response_deserializers = { - ('protos.TLSCAP', 'CreateCertificate'): ca_pb2.TLSCertCreateResp.FromString, - ('protos.TLSCAP', 'ReadCACertificate'): ca_pb2.Cert.FromString, - ('protos.TLSCAP', 'ReadCertificate'): ca_pb2.Cert.FromString, - ('protos.TLSCAP', 'RevokeCertificate'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'CreateCertificate': cardinality.Cardinality.UNARY_UNARY, - 'ReadCACertificate': cardinality.Cardinality.UNARY_UNARY, - 'ReadCertificate': cardinality.Cardinality.UNARY_UNARY, - 'RevokeCertificate': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.TLSCAP', cardinalities, options=stub_options) - -class BetaTLSCAAServicer(object): - """admin service - """ - def RevokeCertificate(self, request, context): - """an admin can revoke any cert - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaTLSCAAStub(object): - """admin service - """ - def RevokeCertificate(self, request, timeout): - """an admin can revoke any cert - """ - raise NotImplementedError() - RevokeCertificate.future = None - -def beta_create_TLSCAA_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import ca_pb2 - import ca_pb2 - request_deserializers = { - ('protos.TLSCAA', 'RevokeCertificate'): ca_pb2.TLSCertRevokeReq.FromString, - } - response_serializers = { - ('protos.TLSCAA', 'RevokeCertificate'): ca_pb2.CAStatus.SerializeToString, - } - method_implementations = { - ('protos.TLSCAA', 'RevokeCertificate'): face_utilities.unary_unary_inline(servicer.RevokeCertificate), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_TLSCAA_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import ca_pb2 - import ca_pb2 - request_serializers = { - ('protos.TLSCAA', 'RevokeCertificate'): ca_pb2.TLSCertRevokeReq.SerializeToString, - } - response_deserializers = { - ('protos.TLSCAA', 'RevokeCertificate'): ca_pb2.CAStatus.FromString, - } - cardinalities = { - 'RevokeCertificate': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.TLSCAA', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/chaincode_pb2.py b/bddtests/chaincode_pb2.py deleted file mode 100644 index 8c390f8c099..00000000000 --- a/bddtests/chaincode_pb2.py +++ /dev/null @@ -1,1030 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: chaincode.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -import chaincodeevent_pb2 as chaincodeevent__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='chaincode.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x0f\x63haincode.proto\x12\x06protos\x1a\x14\x63haincodeevent.proto\x1a\x1fgoogle/protobuf/timestamp.proto\")\n\x0b\x43haincodeID\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\x1e\n\x0e\x43haincodeInput\x12\x0c\n\x04\x61rgs\x18\x01 \x03(\x0c\"\xd6\x02\n\rChaincodeSpec\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.protos.ChaincodeSpec.Type\x12(\n\x0b\x63haincodeID\x18\x02 \x01(\x0b\x32\x13.protos.ChaincodeID\x12\'\n\x07\x63torMsg\x18\x03 \x01(\x0b\x32\x16.protos.ChaincodeInput\x12\x0f\n\x07timeout\x18\x04 \x01(\x05\x12\x15\n\rsecureContext\x18\x05 \x01(\t\x12:\n\x14\x63onfidentialityLevel\x18\x06 \x01(\x0e\x32\x1c.protos.ConfidentialityLevel\x12\x10\n\x08metadata\x18\x07 \x01(\x0c\x12\x12\n\nattributes\x18\x08 \x03(\t\">\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\n\n\x06GOLANG\x10\x01\x12\x08\n\x04NODE\x10\x02\x12\x07\n\x03\x43\x41R\x10\x03\x12\x08\n\x04JAVA\x10\x04\"\x86\x02\n\x17\x43haincodeDeploymentSpec\x12,\n\rchaincodeSpec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x31\n\reffectiveDate\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x63odePackage\x18\x03 \x01(\x0c\x12\x45\n\x07\x65xecEnv\x18\x04 \x01(\x0e\x32\x34.protos.ChaincodeDeploymentSpec.ExecutionEnvironment\".\n\x14\x45xecutionEnvironment\x12\n\n\x06\x44OCKER\x10\x00\x12\n\n\x06SYSTEM\x10\x01\"`\n\x17\x43haincodeInvocationSpec\x12,\n\rchaincodeSpec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x17\n\x0fidGenerationAlg\x18\x02 \x01(\t\"\xbf\x01\n\x18\x43haincodeSecurityContext\x12\x12\n\ncallerCert\x18\x01 \x01(\x0c\x12\x12\n\ncallerSign\x18\x02 \x01(\x0c\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x0f\n\x07\x62inding\x18\x04 \x01(\x0c\x12\x10\n\x08metadata\x18\x05 \x01(\x0c\x12\x16\n\x0eparentMetadata\x18\x06 \x01(\x0c\x12/\n\x0btxTimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x04\n\x10\x43haincodeMessage\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.protos.ChaincodeMessage.Type\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x0c\n\x04txid\x18\x04 \x01(\t\x12\x39\n\x0fsecurityContext\x18\x05 \x01(\x0b\x32 .protos.ChaincodeSecurityContext\x12.\n\x0e\x63haincodeEvent\x18\x06 \x01(\x0b\x32\x16.protos.ChaincodeEvent\"\xe6\x02\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\x0c\n\x08REGISTER\x10\x01\x12\x0e\n\nREGISTERED\x10\x02\x12\x08\n\x04INIT\x10\x03\x12\t\n\x05READY\x10\x04\x12\x0f\n\x0bTRANSACTION\x10\x05\x12\r\n\tCOMPLETED\x10\x06\x12\t\n\x05\x45RROR\x10\x07\x12\r\n\tGET_STATE\x10\x08\x12\r\n\tPUT_STATE\x10\t\x12\r\n\tDEL_STATE\x10\n\x12\x14\n\x10INVOKE_CHAINCODE\x10\x0b\x12\x10\n\x0cINVOKE_QUERY\x10\x0c\x12\x0c\n\x08RESPONSE\x10\r\x12\t\n\x05QUERY\x10\x0e\x12\x13\n\x0fQUERY_COMPLETED\x10\x0f\x12\x0f\n\x0bQUERY_ERROR\x10\x10\x12\x15\n\x11GET_STATE_BY_RANGE\x10\x11\x12\x1a\n\x16GET_STATE_BY_RANGE_NEXT\x10\x12\x12\x1b\n\x17GET_STATE_BY_RANGE_CLOSE\x10\x13\x12\r\n\tKEEPALIVE\x10\x14\"*\n\x0cPutStateInfo\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"3\n\x0fGetStateByRange\x12\x10\n\x08startKey\x18\x01 \x01(\t\x12\x0e\n\x06\x65ndKey\x18\x02 \x01(\t\"!\n\x13GetStateByRangeNext\x12\n\n\x02ID\x18\x01 \x01(\t\"\"\n\x14GetStateByRangeClose\x12\n\n\x02ID\x18\x01 \x01(\t\"5\n\x17GetStateByRangeKeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"n\n\x17GetStateByRangeResponse\x12\x36\n\rkeysAndValues\x18\x01 \x03(\x0b\x32\x1f.protos.GetStateByRangeKeyValue\x12\x0f\n\x07hasMore\x18\x02 \x01(\x08\x12\n\n\x02ID\x18\x03 \x01(\t*4\n\x14\x43onfidentialityLevel\x12\n\n\x06PUBLIC\x10\x00\x12\x10\n\x0c\x43ONFIDENTIAL\x10\x01\x32X\n\x10\x43haincodeSupport\x12\x44\n\x08Register\x12\x18.protos.ChaincodeMessage\x1a\x18.protos.ChaincodeMessage\"\x00(\x01\x30\x01\x42\x18\n\x16org.hyperledger.protosb\x06proto3') - , - dependencies=[chaincodeevent__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -_CONFIDENTIALITYLEVEL = _descriptor.EnumDescriptor( - name='ConfidentialityLevel', - full_name='protos.ConfidentialityLevel', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='PUBLIC', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CONFIDENTIAL', index=1, number=1, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=2006, - serialized_end=2058, -) -_sym_db.RegisterEnumDescriptor(_CONFIDENTIALITYLEVEL) - -ConfidentialityLevel = enum_type_wrapper.EnumTypeWrapper(_CONFIDENTIALITYLEVEL) -PUBLIC = 0 -CONFIDENTIAL = 1 - - -_CHAINCODESPEC_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.ChaincodeSpec.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GOLANG', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NODE', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CAR', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='JAVA', index=4, number=4, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=438, - serialized_end=500, -) -_sym_db.RegisterEnumDescriptor(_CHAINCODESPEC_TYPE) - -_CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT = _descriptor.EnumDescriptor( - name='ExecutionEnvironment', - full_name='protos.ChaincodeDeploymentSpec.ExecutionEnvironment', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='DOCKER', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYSTEM', index=1, number=1, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=719, - serialized_end=765, -) -_sym_db.RegisterEnumDescriptor(_CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT) - -_CHAINCODEMESSAGE_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.ChaincodeMessage.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='REGISTER', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='REGISTERED', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INIT', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='READY', index=4, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='TRANSACTION', index=5, number=5, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='COMPLETED', index=6, number=6, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ERROR', index=7, number=7, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE', index=8, number=8, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PUT_STATE', index=9, number=9, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DEL_STATE', index=10, number=10, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INVOKE_CHAINCODE', index=11, number=11, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INVOKE_QUERY', index=12, number=12, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='RESPONSE', index=13, number=13, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='QUERY', index=14, number=14, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='QUERY_COMPLETED', index=15, number=15, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='QUERY_ERROR', index=16, number=16, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE_BY_RANGE', index=17, number=17, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE_BY_RANGE_NEXT', index=18, number=18, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE_BY_RANGE_CLOSE', index=19, number=19, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='KEEPALIVE', index=20, number=20, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=1311, - serialized_end=1669, -) -_sym_db.RegisterEnumDescriptor(_CHAINCODEMESSAGE_TYPE) - - -_CHAINCODEID = _descriptor.Descriptor( - name='ChaincodeID', - full_name='protos.ChaincodeID', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='path', full_name='protos.ChaincodeID.path', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='name', full_name='protos.ChaincodeID.name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=82, - serialized_end=123, -) - - -_CHAINCODEINPUT = _descriptor.Descriptor( - name='ChaincodeInput', - full_name='protos.ChaincodeInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='args', full_name='protos.ChaincodeInput.args', index=0, - number=1, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=125, - serialized_end=155, -) - - -_CHAINCODESPEC = _descriptor.Descriptor( - name='ChaincodeSpec', - full_name='protos.ChaincodeSpec', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.ChaincodeSpec.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chaincodeID', full_name='protos.ChaincodeSpec.chaincodeID', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='ctorMsg', full_name='protos.ChaincodeSpec.ctorMsg', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timeout', full_name='protos.ChaincodeSpec.timeout', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='secureContext', full_name='protos.ChaincodeSpec.secureContext', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='confidentialityLevel', full_name='protos.ChaincodeSpec.confidentialityLevel', index=5, - number=6, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='metadata', full_name='protos.ChaincodeSpec.metadata', index=6, - number=7, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='attributes', full_name='protos.ChaincodeSpec.attributes', index=7, - number=8, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CHAINCODESPEC_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=158, - serialized_end=500, -) - - -_CHAINCODEDEPLOYMENTSPEC = _descriptor.Descriptor( - name='ChaincodeDeploymentSpec', - full_name='protos.ChaincodeDeploymentSpec', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='chaincodeSpec', full_name='protos.ChaincodeDeploymentSpec.chaincodeSpec', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='effectiveDate', full_name='protos.ChaincodeDeploymentSpec.effectiveDate', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='codePackage', full_name='protos.ChaincodeDeploymentSpec.codePackage', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='execEnv', full_name='protos.ChaincodeDeploymentSpec.execEnv', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=503, - serialized_end=765, -) - - -_CHAINCODEINVOCATIONSPEC = _descriptor.Descriptor( - name='ChaincodeInvocationSpec', - full_name='protos.ChaincodeInvocationSpec', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='chaincodeSpec', full_name='protos.ChaincodeInvocationSpec.chaincodeSpec', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='idGenerationAlg', full_name='protos.ChaincodeInvocationSpec.idGenerationAlg', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=767, - serialized_end=863, -) - - -_CHAINCODESECURITYCONTEXT = _descriptor.Descriptor( - name='ChaincodeSecurityContext', - full_name='protos.ChaincodeSecurityContext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='callerCert', full_name='protos.ChaincodeSecurityContext.callerCert', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='callerSign', full_name='protos.ChaincodeSecurityContext.callerSign', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.ChaincodeSecurityContext.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='binding', full_name='protos.ChaincodeSecurityContext.binding', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='metadata', full_name='protos.ChaincodeSecurityContext.metadata', index=4, - number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='parentMetadata', full_name='protos.ChaincodeSecurityContext.parentMetadata', index=5, - number=6, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='txTimestamp', full_name='protos.ChaincodeSecurityContext.txTimestamp', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=866, - serialized_end=1057, -) - - -_CHAINCODEMESSAGE = _descriptor.Descriptor( - name='ChaincodeMessage', - full_name='protos.ChaincodeMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.ChaincodeMessage.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.ChaincodeMessage.timestamp', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.ChaincodeMessage.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='txid', full_name='protos.ChaincodeMessage.txid', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='securityContext', full_name='protos.ChaincodeMessage.securityContext', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chaincodeEvent', full_name='protos.ChaincodeMessage.chaincodeEvent', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CHAINCODEMESSAGE_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1060, - serialized_end=1669, -) - - -_PUTSTATEINFO = _descriptor.Descriptor( - name='PutStateInfo', - full_name='protos.PutStateInfo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.PutStateInfo.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='protos.PutStateInfo.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1671, - serialized_end=1713, -) - - -_GETSTATEBYRANGE = _descriptor.Descriptor( - name='GetStateByRange', - full_name='protos.GetStateByRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='startKey', full_name='protos.GetStateByRange.startKey', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='endKey', full_name='protos.GetStateByRange.endKey', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1715, - serialized_end=1766, -) - - -_GETSTATEBYRANGENEXT = _descriptor.Descriptor( - name='GetStateByRangeNext', - full_name='protos.GetStateByRangeNext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ID', full_name='protos.GetStateByRangeNext.ID', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1768, - serialized_end=1801, -) - - -_GETSTATEBYRANGECLOSE = _descriptor.Descriptor( - name='GetStateByRangeClose', - full_name='protos.GetStateByRangeClose', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ID', full_name='protos.GetStateByRangeClose.ID', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1803, - serialized_end=1837, -) - - -_GETSTATEBYRANGEKEYVALUE = _descriptor.Descriptor( - name='GetStateByRangeKeyValue', - full_name='protos.GetStateByRangeKeyValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.GetStateByRangeKeyValue.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='protos.GetStateByRangeKeyValue.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1839, - serialized_end=1892, -) - - -_GETSTATEBYRANGERESPONSE = _descriptor.Descriptor( - name='GetStateByRangeResponse', - full_name='protos.GetStateByRangeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keysAndValues', full_name='protos.GetStateByRangeResponse.keysAndValues', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='hasMore', full_name='protos.GetStateByRangeResponse.hasMore', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='ID', full_name='protos.GetStateByRangeResponse.ID', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1894, - serialized_end=2004, -) - -_CHAINCODESPEC.fields_by_name['type'].enum_type = _CHAINCODESPEC_TYPE -_CHAINCODESPEC.fields_by_name['chaincodeID'].message_type = _CHAINCODEID -_CHAINCODESPEC.fields_by_name['ctorMsg'].message_type = _CHAINCODEINPUT -_CHAINCODESPEC.fields_by_name['confidentialityLevel'].enum_type = _CONFIDENTIALITYLEVEL -_CHAINCODESPEC_TYPE.containing_type = _CHAINCODESPEC -_CHAINCODEDEPLOYMENTSPEC.fields_by_name['chaincodeSpec'].message_type = _CHAINCODESPEC -_CHAINCODEDEPLOYMENTSPEC.fields_by_name['effectiveDate'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CHAINCODEDEPLOYMENTSPEC.fields_by_name['execEnv'].enum_type = _CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT -_CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT.containing_type = _CHAINCODEDEPLOYMENTSPEC -_CHAINCODEINVOCATIONSPEC.fields_by_name['chaincodeSpec'].message_type = _CHAINCODESPEC -_CHAINCODESECURITYCONTEXT.fields_by_name['txTimestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CHAINCODEMESSAGE.fields_by_name['type'].enum_type = _CHAINCODEMESSAGE_TYPE -_CHAINCODEMESSAGE.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CHAINCODEMESSAGE.fields_by_name['securityContext'].message_type = _CHAINCODESECURITYCONTEXT -_CHAINCODEMESSAGE.fields_by_name['chaincodeEvent'].message_type = chaincodeevent__pb2._CHAINCODEEVENT -_CHAINCODEMESSAGE_TYPE.containing_type = _CHAINCODEMESSAGE -_GETSTATEBYRANGERESPONSE.fields_by_name['keysAndValues'].message_type = _GETSTATEBYRANGEKEYVALUE -DESCRIPTOR.message_types_by_name['ChaincodeID'] = _CHAINCODEID -DESCRIPTOR.message_types_by_name['ChaincodeInput'] = _CHAINCODEINPUT -DESCRIPTOR.message_types_by_name['ChaincodeSpec'] = _CHAINCODESPEC -DESCRIPTOR.message_types_by_name['ChaincodeDeploymentSpec'] = _CHAINCODEDEPLOYMENTSPEC -DESCRIPTOR.message_types_by_name['ChaincodeInvocationSpec'] = _CHAINCODEINVOCATIONSPEC -DESCRIPTOR.message_types_by_name['ChaincodeSecurityContext'] = _CHAINCODESECURITYCONTEXT -DESCRIPTOR.message_types_by_name['ChaincodeMessage'] = _CHAINCODEMESSAGE -DESCRIPTOR.message_types_by_name['PutStateInfo'] = _PUTSTATEINFO -DESCRIPTOR.message_types_by_name['GetStateByRange'] = _GETSTATEBYRANGE -DESCRIPTOR.message_types_by_name['GetStateByRangeNext'] = _GETSTATEBYRANGENEXT -DESCRIPTOR.message_types_by_name['GetStateByRangeClose'] = _GETSTATEBYRANGECLOSE -DESCRIPTOR.message_types_by_name['GetStateByRangeKeyValue'] = _GETSTATEBYRANGEKEYVALUE -DESCRIPTOR.message_types_by_name['GetStateByRangeResponse'] = _GETSTATEBYRANGERESPONSE -DESCRIPTOR.enum_types_by_name['ConfidentialityLevel'] = _CONFIDENTIALITYLEVEL - -ChaincodeID = _reflection.GeneratedProtocolMessageType('ChaincodeID', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEID, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeID) - )) -_sym_db.RegisterMessage(ChaincodeID) - -ChaincodeInput = _reflection.GeneratedProtocolMessageType('ChaincodeInput', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEINPUT, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeInput) - )) -_sym_db.RegisterMessage(ChaincodeInput) - -ChaincodeSpec = _reflection.GeneratedProtocolMessageType('ChaincodeSpec', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODESPEC, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeSpec) - )) -_sym_db.RegisterMessage(ChaincodeSpec) - -ChaincodeDeploymentSpec = _reflection.GeneratedProtocolMessageType('ChaincodeDeploymentSpec', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEDEPLOYMENTSPEC, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeDeploymentSpec) - )) -_sym_db.RegisterMessage(ChaincodeDeploymentSpec) - -ChaincodeInvocationSpec = _reflection.GeneratedProtocolMessageType('ChaincodeInvocationSpec', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEINVOCATIONSPEC, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeInvocationSpec) - )) -_sym_db.RegisterMessage(ChaincodeInvocationSpec) - -ChaincodeSecurityContext = _reflection.GeneratedProtocolMessageType('ChaincodeSecurityContext', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODESECURITYCONTEXT, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeSecurityContext) - )) -_sym_db.RegisterMessage(ChaincodeSecurityContext) - -ChaincodeMessage = _reflection.GeneratedProtocolMessageType('ChaincodeMessage', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEMESSAGE, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeMessage) - )) -_sym_db.RegisterMessage(ChaincodeMessage) - -PutStateInfo = _reflection.GeneratedProtocolMessageType('PutStateInfo', (_message.Message,), dict( - DESCRIPTOR = _PUTSTATEINFO, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.PutStateInfo) - )) -_sym_db.RegisterMessage(PutStateInfo) - -GetStateByRange = _reflection.GeneratedProtocolMessageType('GetStateByRange', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGE, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRange) - )) -_sym_db.RegisterMessage(GetStateByRange) - -GetStateByRangeNext = _reflection.GeneratedProtocolMessageType('GetStateByRangeNext', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGENEXT, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRangeNext) - )) -_sym_db.RegisterMessage(GetStateByRangeNext) - -GetStateByRangeClose = _reflection.GeneratedProtocolMessageType('GetStateByRangeClose', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGECLOSE, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRangeClose) - )) -_sym_db.RegisterMessage(GetStateByRangeClose) - -GetStateByRangeKeyValue = _reflection.GeneratedProtocolMessageType('GetStateByRangeKeyValue', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGEKEYVALUE, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRangeKeyValue) - )) -_sym_db.RegisterMessage(GetStateByRangeKeyValue) - -GetStateByRangeResponse = _reflection.GeneratedProtocolMessageType('GetStateByRangeResponse', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGERESPONSE, - __module__ = 'chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRangeResponse) - )) -_sym_db.RegisterMessage(GetStateByRangeResponse) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\026org.hyperledger.protos')) -import grpc -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - - -class ChaincodeSupportStub(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Register = channel.stream_stream( - '/protos.ChaincodeSupport/Register', - request_serializer=ChaincodeMessage.SerializeToString, - response_deserializer=ChaincodeMessage.FromString, - ) - - -class ChaincodeSupportServicer(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def Register(self, request_iterator, context): - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ChaincodeSupportServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Register': grpc.stream_stream_rpc_method_handler( - servicer.Register, - request_deserializer=ChaincodeMessage.FromString, - response_serializer=ChaincodeMessage.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'protos.ChaincodeSupport', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - -class BetaChaincodeSupportServicer(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - def Register(self, request_iterator, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - - -class BetaChaincodeSupportStub(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - def Register(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): - raise NotImplementedError() - - -def beta_create_ChaincodeSupport_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - request_deserializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, - } - response_serializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, - } - method_implementations = { - ('protos.ChaincodeSupport', 'Register'): face_utilities.stream_stream_inline(servicer.Register), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - - -def beta_create_ChaincodeSupport_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - request_serializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, - } - response_deserializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, - } - cardinalities = { - 'Register': cardinality.Cardinality.STREAM_STREAM, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.ChaincodeSupport', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/chaincode_rbac.feature b/bddtests/chaincode_rbac.feature deleted file mode 100644 index ac644948938..00000000000 --- a/bddtests/chaincode_rbac.feature +++ /dev/null @@ -1,230 +0,0 @@ -# -# Test Hyperledger Chaincodes using various RBAC mechanisms -# -# Tags that can be used and will affect test internals: -# -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# -@preV1 -@feature_chaincode_rbac -Feature: Role Based Access Control (RBAC) - As a HyperLedger developer - I want various mechanisms available for implementing RBAC within Chaincode - - #@doNotDecompose - @issue_1207 - Scenario Outline: test a chaincode showing how to implement role-based access control using TCerts with no attributes - - Given we compose "" - And I wait "5" seconds - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I register with CA supplying username "alice" and secret "CMS10pEQlB16" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - #Acquire a Application-TCert for binh (NOTE: application TCert is NEVER used for signing fabric TXs) - When user "binhn" requests a new application TCert - # Binhn is assuming the application ROLE of Admin by using his own TCert - And user "binhn" stores their last result as "TCERT_APP_ADMIN" - - # Deploy, in this case Binh is assinging himself as the Admin for the RBAC chaincode. - When user "binhn" sets metadata to their stored value "TCERT_APP_ADMIN" - And user "binhn" deploys chaincode "github.com/hyperledger/fabric/examples/chaincode/go/rbac_tcerts_no_attrs" aliased as "rbac_tcerts_no_attrs" with ctor "init" and args - || - || - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # When we refer to any party, we actually mean a specific application TCert for that party - - #Acquire a Application-TCert for alice, and supplies to binhn (NOTE: application TCert is NEVER used for signing fabric TXs) - When user "alice" requests a new application TCert - And user "alice" stores their last result as "TCERT_APP_ALICE_1" - # Alice gives binhn her application TCert (usually OUT-OF-BAND) - And user "alice" gives stored value "TCERT_APP_ALICE_1" to "binhn" - - - # binhn is assigning the role of 'writer' to alice - When "binhn" uses application TCert "TCERT_APP_ADMIN" to assign role "writer" to application TCert "TCERT_APP_ALICE_1" - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And "binhn"'s last transaction should have succeeded - - - # Alice attempts to assign a role to binh, but this will fail as she does NOT have permission. - When "alice" uses application TCert "TCERT_APP_ALICE_1" to assign role "writer" to application TCert "TCERT_APP_ALICE_1" - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And "alice"'s last transaction should have failed with message that contains "The invoker does not have the required roles" - - #When "Alice" writes value "Alice's value" - #Then invoke should succeed - - #When "Bob" reads value - #Then the result should be "Alice's value" - - #When "Alice" reads value - #Then should fail with failure "Permissed denied" - - - # TODO: Must manage TCert expiration for all parties involved. - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 120 | - - - #@doNotDecompose - @issue_RBAC_TCERT_With_Attributes - Scenario Outline: test a chaincode showing how to implement role-based access control using TCerts with attributes - - Given we compose "" - And I wait "5" seconds - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I register with CA supplying username "alice" and secret "8Y7WIrLX0A8G" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - #Acquire a batch of TCerts for binh and store the TCertOwner key material associated with the batch. PreK0 which is per TCert. - When user "binhn" requests a batch of TCerts of size "1" with attributes: - | role | - | admin | - And user "binhn" stores their last result as "BATCH_OF_TCERTS" - # - - # Deploy, in this case Binh is assinging himself as the Admin for the RBAC chaincode. - And user "binhn" deploys chaincode "github.com/hyperledger/fabric/examples/chaincode/go/rbac_tcerts_with_attrs" with ctor "init" to "vp0" - || - || - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # When we refer to any party, we actually mean a specific application TCert for that party - - #Acquire a Application-TCert for alice, and supplies to binhn (NOTE: application TCert is NEVER used for signing fabric TXs) - When user "alice" requests a new application TCert - And user "alice" stores their last result as "TCERT_APP_ALICE_1" - # Alice gives binhn her application TCert (usually OUT-OF-BAND) - And user "alice" gives stored value "TCERT_APP_ALICE_1" to "binhn" - - - # binhn is assigning the role of 'writer' to alice - When "binhn" uses application TCert "TCERT_APP_ADMIN" to assign role "writer" to application TCert "TCERT_APP_ALICE_1" - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - - # Alice attempts to assign a role to binh, but this will fail as she does NOT have permission. The check is currently - # to make sure the TX does NOT appear on the chain. - When "alice" uses application TCert "TCERT_APP_ALICE_1" to assign role "writer" to application TCert "TCERT_APP_ALICE_1" - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And transaction should have failed with message "Permission denied" - - - #When "Administrator" assigns role "reader" to "Bob" - #Then invoke should succeed - - #When "Bob" assigns role "reader" to "Bob" - #Then invoke should fail with failure "Permissed denied" - - #When "Alice" writes value "Alice's value" - #Then invoke should succeed - - #When "Bob" reads value - #Then the result should be "Alice's value" - - #When "Alice" reads value - #Then should fail with failure "Permissed denied" - - - # TODO: Must manage TCert expiration for all parties involved. - -# When I invoke chaincode "rbac_tcerts_no_attrs" function name "addRole" on "vp0" -# |arg1|arg2|arg3| -# | a | b | 20 | -# Then I should have received a transactionID -# Then I wait up to "10" seconds for transaction to be committed to peers: -# | vp0 | vp1 | vp2 | vp3 | - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - - #@doNotDecompose - @issue_1565 - Scenario Outline: test chaincode to chaincode invocation - - Given we compose "" - And I wait "5" seconds - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I register with CA supplying username "alice" and secret "CMS10pEQlB16" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy the first chaincode - When user "binhn" deploys chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" aliased as "chaincode_example02" with ctor "init" and args - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And "binhn"'s last transaction should have succeeded - - # Deploy the second chaincode - When user "binhn" deploys chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example05" aliased as "chaincode_example05" with ctor "init" and args - | arg1 | arg2 | - | sum | 0 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And "binhn"'s last transaction should have succeeded - - - # Invoke chaincode_example05 which in turn will invoke chaincode_example02. NOTE: Binhn must pass a reference to the first chaincode - Given user "binhn" stores a reference to chaincode "chaincode_example02" as "cc1" - When user "binhn" invokes chaincode "chaincode_example05" function name "invoke" with args - | arg1 | arg2 | - | {cc1} | sum | - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - And "binhn"'s last transaction should have succeeded - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | diff --git a/bddtests/chaincodeevent_pb2.py b/bddtests/chaincodeevent_pb2.py deleted file mode 100644 index 0387eab6bf0..00000000000 --- a/bddtests/chaincodeevent_pb2.py +++ /dev/null @@ -1,97 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: chaincodeevent.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='chaincodeevent.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x14\x63haincodeevent.proto\x12\x06protos\"W\n\x0e\x43haincodeEvent\x12\x13\n\x0b\x63haincodeID\x18\x01 \x01(\t\x12\x0c\n\x04txID\x18\x02 \x01(\t\x12\x11\n\teventName\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\x42\x18\n\x16org.hyperledger.protosb\x06proto3') -) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_CHAINCODEEVENT = _descriptor.Descriptor( - name='ChaincodeEvent', - full_name='protos.ChaincodeEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='chaincodeID', full_name='protos.ChaincodeEvent.chaincodeID', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='txID', full_name='protos.ChaincodeEvent.txID', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='eventName', full_name='protos.ChaincodeEvent.eventName', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.ChaincodeEvent.payload', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=32, - serialized_end=119, -) - -DESCRIPTOR.message_types_by_name['ChaincodeEvent'] = _CHAINCODEEVENT - -ChaincodeEvent = _reflection.GeneratedProtocolMessageType('ChaincodeEvent', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEEVENT, - __module__ = 'chaincodeevent_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeEvent) - )) -_sym_db.RegisterMessage(ChaincodeEvent) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\026org.hyperledger.protos')) -import grpc -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/common/common_pb2.py b/bddtests/common/common_pb2.py index eab47a61580..0ee84e67953 100644 --- a/bddtests/common/common_pb2.py +++ b/bddtests/common/common_pb2.py @@ -21,7 +21,7 @@ name='common/common.proto', package='common', syntax='proto3', - serialized_pb=_b('\n\x13\x63ommon/common.proto\x12\x06\x63ommon\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1b\n\nLastConfig\x12\r\n\x05index\x18\x01 \x01(\x04\"H\n\x08Metadata\x12\r\n\x05value\x18\x01 \x01(\x0c\x12-\n\nsignatures\x18\x02 \x03(\x0b\x32\x19.common.MetadataSignature\"@\n\x11MetadataSignature\x12\x18\n\x10signature_header\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"j\n\x06Header\x12-\n\x0e\x63hannel_header\x18\x01 \x01(\x0b\x32\x15.common.ChannelHeader\x12\x31\n\x10signature_header\x18\x02 \x01(\x0b\x32\x17.common.SignatureHeader\"\xa2\x01\n\rChannelHeader\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nchannel_id\x18\x04 \x01(\t\x12\r\n\x05tx_id\x18\x05 \x01(\t\x12\r\n\x05\x65poch\x18\x06 \x01(\x04\x12\x11\n\textension\x18\x07 \x01(\x0c\"1\n\x0fSignatureHeader\x12\x0f\n\x07\x63reator\x18\x01 \x01(\x0c\x12\r\n\x05nonce\x18\x02 \x01(\x0c\"7\n\x07Payload\x12\x1e\n\x06header\x18\x01 \x01(\x0b\x32\x0e.common.Header\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\".\n\x08\x45nvelope\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"v\n\x05\x42lock\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.common.BlockHeader\x12\x1f\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x11.common.BlockData\x12\'\n\x08metadata\x18\x03 \x01(\x0b\x32\x15.common.BlockMetadata\"G\n\x0b\x42lockHeader\x12\x0e\n\x06number\x18\x01 \x01(\x04\x12\x15\n\rprevious_hash\x18\x02 \x01(\x0c\x12\x11\n\tdata_hash\x18\x03 \x01(\x0c\"\x19\n\tBlockData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x0c\"!\n\rBlockMetadata\x12\x10\n\x08metadata\x18\x01 \x03(\x0c*\xaa\x01\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x07SUCCESS\x10\xc8\x01\x12\x10\n\x0b\x42\x41\x44_REQUEST\x10\x90\x03\x12\x0e\n\tFORBIDDEN\x10\x93\x03\x12\x0e\n\tNOT_FOUND\x10\x94\x03\x12\x1d\n\x18REQUEST_ENTITY_TOO_LARGE\x10\x9d\x03\x12\x1a\n\x15INTERNAL_SERVER_ERROR\x10\xf4\x03\x12\x18\n\x13SERVICE_UNAVAILABLE\x10\xf7\x03*\x82\x01\n\nHeaderType\x12\x0b\n\x07MESSAGE\x10\x00\x12\n\n\x06\x43ONFIG\x10\x01\x12\x11\n\rCONFIG_UPDATE\x10\x02\x12\x18\n\x14\x45NDORSER_TRANSACTION\x10\x03\x12\x17\n\x13ORDERER_TRANSACTION\x10\x04\x12\x15\n\x11\x44\x45LIVER_SEEK_INFO\x10\x05*[\n\x12\x42lockMetadataIndex\x12\x0e\n\nSIGNATURES\x10\x00\x12\x0f\n\x0bLAST_CONFIG\x10\x01\x12\x17\n\x13TRANSACTIONS_FILTER\x10\x02\x12\x0b\n\x07ORDERER\x10\x03\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') + serialized_pb=_b('\n\x13\x63ommon/common.proto\x12\x06\x63ommon\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1b\n\nLastConfig\x12\r\n\x05index\x18\x01 \x01(\x04\"H\n\x08Metadata\x12\r\n\x05value\x18\x01 \x01(\x0c\x12-\n\nsignatures\x18\x02 \x03(\x0b\x32\x19.common.MetadataSignature\"@\n\x11MetadataSignature\x12\x18\n\x10signature_header\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\":\n\x06Header\x12\x16\n\x0e\x63hannel_header\x18\x01 \x01(\x0c\x12\x18\n\x10signature_header\x18\x02 \x01(\x0c\"\xa2\x01\n\rChannelHeader\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nchannel_id\x18\x04 \x01(\t\x12\r\n\x05tx_id\x18\x05 \x01(\t\x12\r\n\x05\x65poch\x18\x06 \x01(\x04\x12\x11\n\textension\x18\x07 \x01(\x0c\"1\n\x0fSignatureHeader\x12\x0f\n\x07\x63reator\x18\x01 \x01(\x0c\x12\r\n\x05nonce\x18\x02 \x01(\x0c\"7\n\x07Payload\x12\x1e\n\x06header\x18\x01 \x01(\x0b\x32\x0e.common.Header\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\".\n\x08\x45nvelope\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"v\n\x05\x42lock\x12#\n\x06header\x18\x01 \x01(\x0b\x32\x13.common.BlockHeader\x12\x1f\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x11.common.BlockData\x12\'\n\x08metadata\x18\x03 \x01(\x0b\x32\x15.common.BlockMetadata\"G\n\x0b\x42lockHeader\x12\x0e\n\x06number\x18\x01 \x01(\x04\x12\x15\n\rprevious_hash\x18\x02 \x01(\x0c\x12\x11\n\tdata_hash\x18\x03 \x01(\x0c\"\x19\n\tBlockData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x0c\"!\n\rBlockMetadata\x12\x10\n\x08metadata\x18\x01 \x03(\x0c*\xaa\x01\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x07SUCCESS\x10\xc8\x01\x12\x10\n\x0b\x42\x41\x44_REQUEST\x10\x90\x03\x12\x0e\n\tFORBIDDEN\x10\x93\x03\x12\x0e\n\tNOT_FOUND\x10\x94\x03\x12\x1d\n\x18REQUEST_ENTITY_TOO_LARGE\x10\x9d\x03\x12\x1a\n\x15INTERNAL_SERVER_ERROR\x10\xf4\x03\x12\x18\n\x13SERVICE_UNAVAILABLE\x10\xf7\x03*\x82\x01\n\nHeaderType\x12\x0b\n\x07MESSAGE\x10\x00\x12\n\n\x06\x43ONFIG\x10\x01\x12\x11\n\rCONFIG_UPDATE\x10\x02\x12\x18\n\x14\x45NDORSER_TRANSACTION\x10\x03\x12\x17\n\x13ORDERER_TRANSACTION\x10\x04\x12\x15\n\x11\x44\x45LIVER_SEEK_INFO\x10\x05*[\n\x12\x42lockMetadataIndex\x12\x0e\n\nSIGNATURES\x10\x00\x12\x0f\n\x0bLAST_CONFIG\x10\x01\x12\x17\n\x13TRANSACTIONS_FILTER\x10\x02\x12\x0b\n\x07ORDERER\x10\x03\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') , dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -67,8 +67,8 @@ ], containing_type=None, options=None, - serialized_start=918, - serialized_end=1088, + serialized_start=870, + serialized_end=1040, ) _sym_db.RegisterEnumDescriptor(_STATUS) @@ -106,8 +106,8 @@ ], containing_type=None, options=None, - serialized_start=1091, - serialized_end=1221, + serialized_start=1043, + serialized_end=1173, ) _sym_db.RegisterEnumDescriptor(_HEADERTYPE) @@ -137,8 +137,8 @@ ], containing_type=None, options=None, - serialized_start=1223, - serialized_end=1314, + serialized_start=1175, + serialized_end=1266, ) _sym_db.RegisterEnumDescriptor(_BLOCKMETADATAINDEX) @@ -280,15 +280,15 @@ fields=[ _descriptor.FieldDescriptor( name='channel_header', full_name='common.Header.channel_header', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( name='signature_header', full_name='common.Header.signature_header', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -305,7 +305,7 @@ oneofs=[ ], serialized_start=233, - serialized_end=339, + serialized_end=291, ) @@ -377,8 +377,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=342, - serialized_end=504, + serialized_start=294, + serialized_end=456, ) @@ -415,8 +415,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=506, - serialized_end=555, + serialized_start=458, + serialized_end=507, ) @@ -453,8 +453,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=557, - serialized_end=612, + serialized_start=509, + serialized_end=564, ) @@ -491,8 +491,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=614, - serialized_end=660, + serialized_start=566, + serialized_end=612, ) @@ -536,8 +536,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=662, - serialized_end=780, + serialized_start=614, + serialized_end=732, ) @@ -581,8 +581,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=782, - serialized_end=853, + serialized_start=734, + serialized_end=805, ) @@ -612,8 +612,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=855, - serialized_end=880, + serialized_start=807, + serialized_end=832, ) @@ -643,13 +643,11 @@ extension_ranges=[], oneofs=[ ], - serialized_start=882, - serialized_end=915, + serialized_start=834, + serialized_end=867, ) _METADATA.fields_by_name['signatures'].message_type = _METADATASIGNATURE -_HEADER.fields_by_name['channel_header'].message_type = _CHANNELHEADER -_HEADER.fields_by_name['signature_header'].message_type = _SIGNATUREHEADER _CHANNELHEADER.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _PAYLOAD.fields_by_name['header'].message_type = _HEADER _BLOCK.fields_by_name['header'].message_type = _BLOCKHEADER diff --git a/bddtests/common/common_pb2_grpc.py b/bddtests/common/common_pb2_grpc.py index c374a4d7d5b..d5557c12314 100644 --- a/bddtests/common/common_pb2_grpc.py +++ b/bddtests/common/common_pb2_grpc.py @@ -1,3 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities diff --git a/bddtests/common/configtx_pb2.py b/bddtests/common/configtx_pb2.py index 0f37e3e44a5..fb095302dc6 100644 --- a/bddtests/common/configtx_pb2.py +++ b/bddtests/common/configtx_pb2.py @@ -21,7 +21,7 @@ name='common/configtx.proto', package='common', syntax='proto3', - serialized_pb=_b('\n\x15\x63ommon/configtx.proto\x12\x06\x63ommon\x1a\x13\x63ommon/common.proto\x1a\x15\x63ommon/policies.proto\"W\n\x0e\x43onfigEnvelope\x12\x1e\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x0e.common.Config\x12%\n\x0blast_update\x18\x02 \x01(\x0b\x32\x10.common.Envelope\"\x9d\x03\n\x11\x43onfigGroupSchema\x12\x35\n\x06groups\x18\x01 \x03(\x0b\x32%.common.ConfigGroupSchema.GroupsEntry\x12\x35\n\x06values\x18\x02 \x03(\x0b\x32%.common.ConfigGroupSchema.ValuesEntry\x12\x39\n\x08policies\x18\x03 \x03(\x0b\x32\'.common.ConfigGroupSchema.PoliciesEntry\x1aH\n\x0bGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.common.ConfigGroupSchema:\x02\x38\x01\x1aH\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.common.ConfigValueSchema:\x02\x38\x01\x1aK\n\rPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.common.ConfigPolicySchema:\x02\x38\x01\"\x13\n\x11\x43onfigValueSchema\"\x14\n\x12\x43onfigPolicySchema\"U\n\x06\x43onfig\x12%\n\x06header\x18\x01 \x01(\x0b\x32\x15.common.ChannelHeader\x12$\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup\"Z\n\x14\x43onfigUpdateEnvelope\x12\x15\n\rconfig_update\x18\x01 \x01(\x0c\x12+\n\nsignatures\x18\x02 \x03(\x0b\x32\x17.common.ConfigSignature\"\x84\x01\n\x0c\x43onfigUpdate\x12%\n\x06header\x18\x01 \x01(\x0b\x32\x15.common.ChannelHeader\x12%\n\x08read_set\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup\x12&\n\twrite_set\x18\x03 \x01(\x0b\x32\x13.common.ConfigGroup\"\x98\x03\n\x0b\x43onfigGroup\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12/\n\x06groups\x18\x02 \x03(\x0b\x32\x1f.common.ConfigGroup.GroupsEntry\x12/\n\x06values\x18\x03 \x03(\x0b\x32\x1f.common.ConfigGroup.ValuesEntry\x12\x33\n\x08policies\x18\x04 \x03(\x0b\x32!.common.ConfigGroup.PoliciesEntry\x12\x12\n\nmod_policy\x18\x05 \x01(\t\x1a\x42\n\x0bGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup:\x02\x38\x01\x1a\x42\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.common.ConfigValue:\x02\x38\x01\x1a\x45\n\rPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.common.ConfigPolicy:\x02\x38\x01\"A\n\x0b\x43onfigValue\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\x12\x12\n\nmod_policy\x18\x03 \x01(\t\"S\n\x0c\x43onfigPolicy\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12\x1e\n\x06policy\x18\x02 \x01(\x0b\x32\x0e.common.Policy\x12\x12\n\nmod_policy\x18\x03 \x01(\t\">\n\x0f\x43onfigSignature\x12\x18\n\x10signature_header\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') + serialized_pb=_b('\n\x15\x63ommon/configtx.proto\x12\x06\x63ommon\x1a\x13\x63ommon/common.proto\x1a\x15\x63ommon/policies.proto\"W\n\x0e\x43onfigEnvelope\x12\x1e\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x0e.common.Config\x12%\n\x0blast_update\x18\x02 \x01(\x0b\x32\x10.common.Envelope\"\x9d\x03\n\x11\x43onfigGroupSchema\x12\x35\n\x06groups\x18\x01 \x03(\x0b\x32%.common.ConfigGroupSchema.GroupsEntry\x12\x35\n\x06values\x18\x02 \x03(\x0b\x32%.common.ConfigGroupSchema.ValuesEntry\x12\x39\n\x08policies\x18\x03 \x03(\x0b\x32\'.common.ConfigGroupSchema.PoliciesEntry\x1aH\n\x0bGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.common.ConfigGroupSchema:\x02\x38\x01\x1aH\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.common.ConfigValueSchema:\x02\x38\x01\x1aK\n\rPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.common.ConfigPolicySchema:\x02\x38\x01\"\x13\n\x11\x43onfigValueSchema\"\x14\n\x12\x43onfigPolicySchema\"F\n\x06\x43onfig\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12*\n\rchannel_group\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup\"Z\n\x14\x43onfigUpdateEnvelope\x12\x15\n\rconfig_update\x18\x01 \x01(\x0c\x12+\n\nsignatures\x18\x02 \x03(\x0b\x32\x17.common.ConfigSignature\"q\n\x0c\x43onfigUpdate\x12\x12\n\nchannel_id\x18\x01 \x01(\t\x12%\n\x08read_set\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup\x12&\n\twrite_set\x18\x03 \x01(\x0b\x32\x13.common.ConfigGroup\"\x98\x03\n\x0b\x43onfigGroup\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12/\n\x06groups\x18\x02 \x03(\x0b\x32\x1f.common.ConfigGroup.GroupsEntry\x12/\n\x06values\x18\x03 \x03(\x0b\x32\x1f.common.ConfigGroup.ValuesEntry\x12\x33\n\x08policies\x18\x04 \x03(\x0b\x32!.common.ConfigGroup.PoliciesEntry\x12\x12\n\nmod_policy\x18\x05 \x01(\t\x1a\x42\n\x0bGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.common.ConfigGroup:\x02\x38\x01\x1a\x42\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\"\n\x05value\x18\x02 \x01(\x0b\x32\x13.common.ConfigValue:\x02\x38\x01\x1a\x45\n\rPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.common.ConfigPolicy:\x02\x38\x01\"A\n\x0b\x43onfigValue\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\x12\x12\n\nmod_policy\x18\x03 \x01(\t\"S\n\x0c\x43onfigPolicy\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12\x1e\n\x06policy\x18\x02 \x01(\x0b\x32\x0e.common.Policy\x12\x12\n\nmod_policy\x18\x03 \x01(\t\">\n\x0f\x43onfigSignature\x12\x18\n\x10signature_header\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') , dependencies=[common_dot_common__pb2.DESCRIPTOR,common_dot_policies__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -279,14 +279,14 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='header', full_name='common.Config.header', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='sequence', full_name='common.Config.sequence', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='channel', full_name='common.Config.channel', index=1, + name='channel_group', full_name='common.Config.channel_group', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -305,7 +305,7 @@ oneofs=[ ], serialized_start=625, - serialized_end=710, + serialized_end=695, ) @@ -342,8 +342,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=712, - serialized_end=802, + serialized_start=697, + serialized_end=787, ) @@ -355,9 +355,9 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='header', full_name='common.ConfigUpdate.header', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='channel_id', full_name='common.ConfigUpdate.channel_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -387,8 +387,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=805, - serialized_end=937, + serialized_start=789, + serialized_end=902, ) @@ -425,8 +425,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1143, - serialized_end=1209, + serialized_start=1108, + serialized_end=1174, ) _CONFIGGROUP_VALUESENTRY = _descriptor.Descriptor( @@ -462,8 +462,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1211, - serialized_end=1277, + serialized_start=1176, + serialized_end=1242, ) _CONFIGGROUP_POLICIESENTRY = _descriptor.Descriptor( @@ -499,8 +499,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1279, - serialized_end=1348, + serialized_start=1244, + serialized_end=1313, ) _CONFIGGROUP = _descriptor.Descriptor( @@ -557,8 +557,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=940, - serialized_end=1348, + serialized_start=905, + serialized_end=1313, ) @@ -602,8 +602,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1350, - serialized_end=1415, + serialized_start=1315, + serialized_end=1380, ) @@ -647,8 +647,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1417, - serialized_end=1500, + serialized_start=1382, + serialized_end=1465, ) @@ -685,8 +685,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1502, - serialized_end=1564, + serialized_start=1467, + serialized_end=1529, ) _CONFIGENVELOPE.fields_by_name['config'].message_type = _CONFIG @@ -700,10 +700,8 @@ _CONFIGGROUPSCHEMA.fields_by_name['groups'].message_type = _CONFIGGROUPSCHEMA_GROUPSENTRY _CONFIGGROUPSCHEMA.fields_by_name['values'].message_type = _CONFIGGROUPSCHEMA_VALUESENTRY _CONFIGGROUPSCHEMA.fields_by_name['policies'].message_type = _CONFIGGROUPSCHEMA_POLICIESENTRY -_CONFIG.fields_by_name['header'].message_type = common_dot_common__pb2._CHANNELHEADER -_CONFIG.fields_by_name['channel'].message_type = _CONFIGGROUP +_CONFIG.fields_by_name['channel_group'].message_type = _CONFIGGROUP _CONFIGUPDATEENVELOPE.fields_by_name['signatures'].message_type = _CONFIGSIGNATURE -_CONFIGUPDATE.fields_by_name['header'].message_type = common_dot_common__pb2._CHANNELHEADER _CONFIGUPDATE.fields_by_name['read_set'].message_type = _CONFIGGROUP _CONFIGUPDATE.fields_by_name['write_set'].message_type = _CONFIGGROUP _CONFIGGROUP_GROUPSENTRY.fields_by_name['value'].message_type = _CONFIGGROUP diff --git a/bddtests/common/configtx_pb2_grpc.py b/bddtests/common/configtx_pb2_grpc.py index c374a4d7d5b..d5557c12314 100644 --- a/bddtests/common/configtx_pb2_grpc.py +++ b/bddtests/common/configtx_pb2_grpc.py @@ -1,3 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities diff --git a/bddtests/common/configuration_pb2_grpc.py b/bddtests/common/configuration_pb2_grpc.py index c374a4d7d5b..d5557c12314 100644 --- a/bddtests/common/configuration_pb2_grpc.py +++ b/bddtests/common/configuration_pb2_grpc.py @@ -1,3 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities diff --git a/bddtests/common/ledger_pb2.py b/bddtests/common/ledger_pb2.py new file mode 100644 index 00000000000..10ab16c1954 --- /dev/null +++ b/bddtests/common/ledger_pb2.py @@ -0,0 +1,95 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: common/ledger.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='common/ledger.proto', + package='common', + syntax='proto3', + serialized_pb=_b('\n\x13\x63ommon/ledger.proto\x12\x06\x63ommon\"U\n\x0e\x42lockchainInfo\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x18\n\x10\x63urrentBlockHash\x18\x02 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x03 \x01(\x0c\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_BLOCKCHAININFO = _descriptor.Descriptor( + name='BlockchainInfo', + full_name='common.BlockchainInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='height', full_name='common.BlockchainInfo.height', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='currentBlockHash', full_name='common.BlockchainInfo.currentBlockHash', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='previousBlockHash', full_name='common.BlockchainInfo.previousBlockHash', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=31, + serialized_end=116, +) + +DESCRIPTOR.message_types_by_name['BlockchainInfo'] = _BLOCKCHAININFO + +BlockchainInfo = _reflection.GeneratedProtocolMessageType('BlockchainInfo', (_message.Message,), dict( + DESCRIPTOR = _BLOCKCHAININFO, + __module__ = 'common.ledger_pb2' + # @@protoc_insertion_point(class_scope:common.BlockchainInfo) + )) +_sym_db.RegisterMessage(BlockchainInfo) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z+github.com/hyperledger/fabric/protos/common')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/common/ledger_pb2_grpc.py b/bddtests/common/ledger_pb2_grpc.py new file mode 100644 index 00000000000..d5557c12314 --- /dev/null +++ b/bddtests/common/ledger_pb2_grpc.py @@ -0,0 +1,5 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + diff --git a/bddtests/common/msp_principal_pb2.py b/bddtests/common/msp_principal_pb2.py index 83542f955f6..f9ebdd7605a 100644 --- a/bddtests/common/msp_principal_pb2.py +++ b/bddtests/common/msp_principal_pb2.py @@ -19,7 +19,7 @@ name='common/msp_principal.proto', package='common', syntax='proto3', - serialized_pb=_b('\n\x1a\x63ommon/msp_principal.proto\x12\x06\x63ommon\"\xb0\x01\n\x0cMSPPrincipal\x12\x44\n\x17PrincipalClassification\x18\x01 \x01(\x0e\x32#.common.MSPPrincipal.Classification\x12\x11\n\tPrincipal\x18\x03 \x01(\x0c\"G\n\x0e\x43lassification\x12\r\n\tByMSPRole\x10\x00\x12\x16\n\x12\x42yOrganizationUnit\x10\x01\x12\x0e\n\nByIdentity\x10\x02\"M\n\x10OrganizationUnit\x12\x15\n\rMSPIdentifier\x18\x01 \x01(\t\x12\"\n\x1aOrganizationUnitIdentifier\x18\x02 \x01(\t\"q\n\x07MSPRole\x12\x15\n\rMSPIdentifier\x18\x01 \x01(\t\x12)\n\x04Role\x18\x02 \x01(\x0e\x32\x1b.common.MSPRole.MSPRoleType\"$\n\x0bMSPRoleType\x12\n\n\x06Member\x10\x00\x12\t\n\x05\x41\x64min\x10\x01\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') + serialized_pb=_b('\n\x1a\x63ommon/msp_principal.proto\x12\x06\x63ommon\"\xa9\x01\n\x0cMSPPrincipal\x12\x45\n\x18principal_classification\x18\x01 \x01(\x0e\x32#.common.MSPPrincipal.Classification\x12\x11\n\tprincipal\x18\x02 \x01(\x0c\"?\n\x0e\x43lassification\x12\x08\n\x04ROLE\x10\x00\x12\x15\n\x11ORGANIZATION_UNIT\x10\x01\x12\x0c\n\x08IDENTITY\x10\x02\"q\n\x10OrganizationUnit\x12\x16\n\x0emsp_identifier\x18\x01 \x01(\t\x12&\n\x1eorganizational_unit_identifier\x18\x02 \x01(\t\x12\x1d\n\x15\x63\x65rtifiers_identifier\x18\x03 \x01(\x0c\"r\n\x07MSPRole\x12\x16\n\x0emsp_identifier\x18\x01 \x01(\t\x12)\n\x04Role\x18\x02 \x01(\x0e\x32\x1b.common.MSPRole.MSPRoleType\"$\n\x0bMSPRoleType\x12\n\n\x06MEMBER\x10\x00\x12\t\n\x05\x41\x44MIN\x10\x01\x42-Z+github.com/hyperledger/fabric/protos/commonb\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -32,22 +32,22 @@ file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( - name='ByMSPRole', index=0, number=0, + name='ROLE', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( - name='ByOrganizationUnit', index=1, number=1, + name='ORGANIZATION_UNIT', index=1, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( - name='ByIdentity', index=2, number=2, + name='IDENTITY', index=2, number=2, options=None, type=None), ], containing_type=None, options=None, - serialized_start=144, - serialized_end=215, + serialized_start=145, + serialized_end=208, ) _sym_db.RegisterEnumDescriptor(_MSPPRINCIPAL_CLASSIFICATION) @@ -58,18 +58,18 @@ file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( - name='Member', index=0, number=0, + name='MEMBER', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( - name='Admin', index=1, number=1, + name='ADMIN', index=1, number=1, options=None, type=None), ], containing_type=None, options=None, - serialized_start=373, - serialized_end=409, + serialized_start=403, + serialized_end=439, ) _sym_db.RegisterEnumDescriptor(_MSPROLE_MSPROLETYPE) @@ -82,15 +82,15 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='PrincipalClassification', full_name='common.MSPPrincipal.PrincipalClassification', index=0, + name='principal_classification', full_name='common.MSPPrincipal.principal_classification', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='Principal', full_name='common.MSPPrincipal.Principal', index=1, - number=3, type=12, cpp_type=9, label=1, + name='principal', full_name='common.MSPPrincipal.principal', index=1, + number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -109,7 +109,7 @@ oneofs=[ ], serialized_start=39, - serialized_end=215, + serialized_end=208, ) @@ -121,19 +121,26 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='MSPIdentifier', full_name='common.OrganizationUnit.MSPIdentifier', index=0, + name='msp_identifier', full_name='common.OrganizationUnit.msp_identifier', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='OrganizationUnitIdentifier', full_name='common.OrganizationUnit.OrganizationUnitIdentifier', index=1, + name='organizational_unit_identifier', full_name='common.OrganizationUnit.organizational_unit_identifier', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='certifiers_identifier', full_name='common.OrganizationUnit.certifiers_identifier', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -146,8 +153,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=217, - serialized_end=294, + serialized_start=210, + serialized_end=323, ) @@ -159,7 +166,7 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='MSPIdentifier', full_name='common.MSPRole.MSPIdentifier', index=0, + name='msp_identifier', full_name='common.MSPRole.msp_identifier', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -185,11 +192,11 @@ extension_ranges=[], oneofs=[ ], - serialized_start=296, - serialized_end=409, + serialized_start=325, + serialized_end=439, ) -_MSPPRINCIPAL.fields_by_name['PrincipalClassification'].enum_type = _MSPPRINCIPAL_CLASSIFICATION +_MSPPRINCIPAL.fields_by_name['principal_classification'].enum_type = _MSPPRINCIPAL_CLASSIFICATION _MSPPRINCIPAL_CLASSIFICATION.containing_type = _MSPPRINCIPAL _MSPROLE.fields_by_name['Role'].enum_type = _MSPROLE_MSPROLETYPE _MSPROLE_MSPROLETYPE.containing_type = _MSPROLE diff --git a/bddtests/common/msp_principal_pb2_grpc.py b/bddtests/common/msp_principal_pb2_grpc.py index c374a4d7d5b..d5557c12314 100644 --- a/bddtests/common/msp_principal_pb2_grpc.py +++ b/bddtests/common/msp_principal_pb2_grpc.py @@ -1,3 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities diff --git a/bddtests/common/policies_pb2_grpc.py b/bddtests/common/policies_pb2_grpc.py index c374a4d7d5b..d5557c12314 100644 --- a/bddtests/common/policies_pb2_grpc.py +++ b/bddtests/common/policies_pb2_grpc.py @@ -1,3 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities diff --git a/bddtests/compose-defaults.yml b/bddtests/compose-defaults.yml index 62d85d83837..475eaaf2d8d 100644 --- a/bddtests/compose-defaults.yml +++ b/bddtests/compose-defaults.yml @@ -16,7 +16,7 @@ services: # $$GOPATH (double dollar) required to prevent docker-compose doing its own # substitution before the value gets to the container #command: sh -c "exec $$GOPATH/src/github.com/hyperledger/fabric/bddtests/scripts/start-peer.sh" - command: sh -c "sleep 2; peer node start" + command: sh -c "sleep 2; peer node start --peer-defaultchain=false" # Use these options if coverage desired for peers #image: hyperledger/fabric-peer-coverage diff --git a/bddtests/devops_pb2.py b/bddtests/devops_pb2.py deleted file mode 100644 index 5318489b35e..00000000000 --- a/bddtests/devops_pb2.py +++ /dev/null @@ -1,581 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: devops.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -import chaincode_pb2 as chaincode__pb2 -import fabric_pb2 as fabric__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='devops.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x0c\x64\x65vops.proto\x12\x06protos\x1a\x0f\x63haincode.proto\x1a\x0c\x66\x61\x62ric.proto\"0\n\x06Secret\x12\x10\n\x08\x65nrollId\x18\x01 \x01(\t\x12\x14\n\x0c\x65nrollSecret\x18\x02 \x01(\t\"L\n\nSigmaInput\x12\x1e\n\x06secret\x18\x01 \x01(\x0b\x32\x0e.protos.Secret\x12\x10\n\x08\x61ppTCert\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"g\n\x12\x45xecuteWithBinding\x12@\n\x17\x63haincodeInvocationSpec\x18\x01 \x01(\x0b\x32\x1f.protos.ChaincodeInvocationSpec\x12\x0f\n\x07\x62inding\x18\x02 \x01(\x0c\"A\n\x0bSigmaOutput\x12\r\n\x05tcert\x18\x01 \x01(\x0c\x12\r\n\x05sigma\x18\x02 \x01(\x0c\x12\x14\n\x0c\x61sn1Encoding\x18\x03 \x01(\x0c\"\xba\x01\n\x0b\x42uildResult\x12.\n\x06status\x18\x01 \x01(\x0e\x32\x1e.protos.BuildResult.StatusCode\x12\x0b\n\x03msg\x18\x02 \x01(\t\x12\x37\n\x0e\x64\x65ploymentSpec\x18\x03 \x01(\x0b\x32\x1f.protos.ChaincodeDeploymentSpec\"5\n\nStatusCode\x12\r\n\tUNDEFINED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x0b\n\x07\x46\x41ILURE\x10\x02\"-\n\x12TransactionRequest\x12\x17\n\x0ftransactionUuid\x18\x01 \x01(\t2\xfe\x04\n\x06\x44\x65vops\x12+\n\x05Login\x12\x0e.protos.Secret\x1a\x10.protos.Response\"\x00\x12\x41\n\x05\x42uild\x12\x15.protos.ChaincodeSpec\x1a\x1f.protos.ChaincodeDeploymentSpec\"\x00\x12\x42\n\x06\x44\x65ploy\x12\x15.protos.ChaincodeSpec\x1a\x1f.protos.ChaincodeDeploymentSpec\"\x00\x12=\n\x06Invoke\x12\x1f.protos.ChaincodeInvocationSpec\x1a\x10.protos.Response\"\x00\x12<\n\x05Query\x12\x1f.protos.ChaincodeInvocationSpec\x1a\x10.protos.Response\"\x00\x12\x46\n\x14GetTransactionResult\x12\x1a.protos.TransactionRequest\x1a\x10.protos.Response\"\x00\x12=\n\x17\x45XP_GetApplicationTCert\x12\x0e.protos.Secret\x1a\x10.protos.Response\"\x00\x12\x36\n\x10\x45XP_PrepareForTx\x12\x0e.protos.Secret\x1a\x10.protos.Response\"\x00\x12:\n\x10\x45XP_ProduceSigma\x12\x12.protos.SigmaInput\x1a\x10.protos.Response\"\x00\x12H\n\x16\x45XP_ExecuteWithBinding\x12\x1a.protos.ExecuteWithBinding\x1a\x10.protos.Response\"\x00\x62\x06proto3') - , - dependencies=[chaincode__pb2.DESCRIPTOR,fabric__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_BUILDRESULT_STATUSCODE = _descriptor.EnumDescriptor( - name='StatusCode', - full_name='protos.BuildResult.StatusCode', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SUCCESS', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FAILURE', index=2, number=2, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=489, - serialized_end=542, -) -_sym_db.RegisterEnumDescriptor(_BUILDRESULT_STATUSCODE) - - -_SECRET = _descriptor.Descriptor( - name='Secret', - full_name='protos.Secret', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='enrollId', full_name='protos.Secret.enrollId', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='enrollSecret', full_name='protos.Secret.enrollSecret', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=55, - serialized_end=103, -) - - -_SIGMAINPUT = _descriptor.Descriptor( - name='SigmaInput', - full_name='protos.SigmaInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='secret', full_name='protos.SigmaInput.secret', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='appTCert', full_name='protos.SigmaInput.appTCert', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='data', full_name='protos.SigmaInput.data', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=105, - serialized_end=181, -) - - -_EXECUTEWITHBINDING = _descriptor.Descriptor( - name='ExecuteWithBinding', - full_name='protos.ExecuteWithBinding', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='chaincodeInvocationSpec', full_name='protos.ExecuteWithBinding.chaincodeInvocationSpec', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='binding', full_name='protos.ExecuteWithBinding.binding', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=183, - serialized_end=286, -) - - -_SIGMAOUTPUT = _descriptor.Descriptor( - name='SigmaOutput', - full_name='protos.SigmaOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='tcert', full_name='protos.SigmaOutput.tcert', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sigma', full_name='protos.SigmaOutput.sigma', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='asn1Encoding', full_name='protos.SigmaOutput.asn1Encoding', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=288, - serialized_end=353, -) - - -_BUILDRESULT = _descriptor.Descriptor( - name='BuildResult', - full_name='protos.BuildResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='protos.BuildResult.status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='msg', full_name='protos.BuildResult.msg', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='deploymentSpec', full_name='protos.BuildResult.deploymentSpec', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _BUILDRESULT_STATUSCODE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=356, - serialized_end=542, -) - - -_TRANSACTIONREQUEST = _descriptor.Descriptor( - name='TransactionRequest', - full_name='protos.TransactionRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='transactionUuid', full_name='protos.TransactionRequest.transactionUuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=544, - serialized_end=589, -) - -_SIGMAINPUT.fields_by_name['secret'].message_type = _SECRET -_EXECUTEWITHBINDING.fields_by_name['chaincodeInvocationSpec'].message_type = chaincode__pb2._CHAINCODEINVOCATIONSPEC -_BUILDRESULT.fields_by_name['status'].enum_type = _BUILDRESULT_STATUSCODE -_BUILDRESULT.fields_by_name['deploymentSpec'].message_type = chaincode__pb2._CHAINCODEDEPLOYMENTSPEC -_BUILDRESULT_STATUSCODE.containing_type = _BUILDRESULT -DESCRIPTOR.message_types_by_name['Secret'] = _SECRET -DESCRIPTOR.message_types_by_name['SigmaInput'] = _SIGMAINPUT -DESCRIPTOR.message_types_by_name['ExecuteWithBinding'] = _EXECUTEWITHBINDING -DESCRIPTOR.message_types_by_name['SigmaOutput'] = _SIGMAOUTPUT -DESCRIPTOR.message_types_by_name['BuildResult'] = _BUILDRESULT -DESCRIPTOR.message_types_by_name['TransactionRequest'] = _TRANSACTIONREQUEST - -Secret = _reflection.GeneratedProtocolMessageType('Secret', (_message.Message,), dict( - DESCRIPTOR = _SECRET, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.Secret) - )) -_sym_db.RegisterMessage(Secret) - -SigmaInput = _reflection.GeneratedProtocolMessageType('SigmaInput', (_message.Message,), dict( - DESCRIPTOR = _SIGMAINPUT, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.SigmaInput) - )) -_sym_db.RegisterMessage(SigmaInput) - -ExecuteWithBinding = _reflection.GeneratedProtocolMessageType('ExecuteWithBinding', (_message.Message,), dict( - DESCRIPTOR = _EXECUTEWITHBINDING, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.ExecuteWithBinding) - )) -_sym_db.RegisterMessage(ExecuteWithBinding) - -SigmaOutput = _reflection.GeneratedProtocolMessageType('SigmaOutput', (_message.Message,), dict( - DESCRIPTOR = _SIGMAOUTPUT, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.SigmaOutput) - )) -_sym_db.RegisterMessage(SigmaOutput) - -BuildResult = _reflection.GeneratedProtocolMessageType('BuildResult', (_message.Message,), dict( - DESCRIPTOR = _BUILDRESULT, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.BuildResult) - )) -_sym_db.RegisterMessage(BuildResult) - -TransactionRequest = _reflection.GeneratedProtocolMessageType('TransactionRequest', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTIONREQUEST, - __module__ = 'devops_pb2' - # @@protoc_insertion_point(class_scope:protos.TransactionRequest) - )) -_sym_db.RegisterMessage(TransactionRequest) - - -import abc -import six -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - -class BetaDevopsServicer(object): - """Interface exported by the server. - """ - def Login(self, request, context): - """Log in - passed Secret object and returns Response object, where - msg is the security context to be used in subsequent invocations - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def Build(self, request, context): - """Build the chaincode package. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def Deploy(self, request, context): - """Deploy the chaincode package to the chain. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def Invoke(self, request, context): - """Invoke chaincode. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def Query(self, request, context): - """Invoke chaincode. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def GetTransactionResult(self, request, context): - """Request a TransactionResult. The Response.Msg will contain the TransactionResult if successfully found the transaction in the chain. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def EXP_GetApplicationTCert(self, request, context): - """Retrieve a TCert. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def EXP_PrepareForTx(self, request, context): - """Prepare for performing a TX, which will return a binding that can later be used to sign and then execute a transaction. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def EXP_ProduceSigma(self, request, context): - """Prepare for performing a TX, which will return a binding that can later be used to sign and then execute a transaction. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def EXP_ExecuteWithBinding(self, request, context): - """Execute a transaction with a specific binding - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaDevopsStub(object): - """Interface exported by the server. - """ - def Login(self, request, timeout): - """Log in - passed Secret object and returns Response object, where - msg is the security context to be used in subsequent invocations - """ - raise NotImplementedError() - Login.future = None - def Build(self, request, timeout): - """Build the chaincode package. - """ - raise NotImplementedError() - Build.future = None - def Deploy(self, request, timeout): - """Deploy the chaincode package to the chain. - """ - raise NotImplementedError() - Deploy.future = None - def Invoke(self, request, timeout): - """Invoke chaincode. - """ - raise NotImplementedError() - Invoke.future = None - def Query(self, request, timeout): - """Invoke chaincode. - """ - raise NotImplementedError() - Query.future = None - def GetTransactionResult(self, request, timeout): - """Request a TransactionResult. The Response.Msg will contain the TransactionResult if successfully found the transaction in the chain. - """ - raise NotImplementedError() - GetTransactionResult.future = None - def EXP_GetApplicationTCert(self, request, timeout): - """Retrieve a TCert. - """ - raise NotImplementedError() - EXP_GetApplicationTCert.future = None - def EXP_PrepareForTx(self, request, timeout): - """Prepare for performing a TX, which will return a binding that can later be used to sign and then execute a transaction. - """ - raise NotImplementedError() - EXP_PrepareForTx.future = None - def EXP_ProduceSigma(self, request, timeout): - """Prepare for performing a TX, which will return a binding that can later be used to sign and then execute a transaction. - """ - raise NotImplementedError() - EXP_ProduceSigma.future = None - def EXP_ExecuteWithBinding(self, request, timeout): - """Execute a transaction with a specific binding - """ - raise NotImplementedError() - EXP_ExecuteWithBinding.future = None - -def beta_create_Devops_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import devops_pb2 - import fabric_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import fabric_pb2 - import chaincode_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - request_deserializers = { - ('protos.Devops', 'Build'): chaincode_pb2.ChaincodeSpec.FromString, - ('protos.Devops', 'Deploy'): chaincode_pb2.ChaincodeSpec.FromString, - ('protos.Devops', 'EXP_ExecuteWithBinding'): devops_pb2.ExecuteWithBinding.FromString, - ('protos.Devops', 'EXP_GetApplicationTCert'): devops_pb2.Secret.FromString, - ('protos.Devops', 'EXP_PrepareForTx'): devops_pb2.Secret.FromString, - ('protos.Devops', 'EXP_ProduceSigma'): devops_pb2.SigmaInput.FromString, - ('protos.Devops', 'GetTransactionResult'): devops_pb2.TransactionRequest.FromString, - ('protos.Devops', 'Invoke'): chaincode_pb2.ChaincodeInvocationSpec.FromString, - ('protos.Devops', 'Login'): devops_pb2.Secret.FromString, - ('protos.Devops', 'Query'): chaincode_pb2.ChaincodeInvocationSpec.FromString, - } - response_serializers = { - ('protos.Devops', 'Build'): chaincode_pb2.ChaincodeDeploymentSpec.SerializeToString, - ('protos.Devops', 'Deploy'): chaincode_pb2.ChaincodeDeploymentSpec.SerializeToString, - ('protos.Devops', 'EXP_ExecuteWithBinding'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'EXP_GetApplicationTCert'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'EXP_PrepareForTx'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'EXP_ProduceSigma'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'GetTransactionResult'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'Invoke'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'Login'): fabric_pb2.Response.SerializeToString, - ('protos.Devops', 'Query'): fabric_pb2.Response.SerializeToString, - } - method_implementations = { - ('protos.Devops', 'Build'): face_utilities.unary_unary_inline(servicer.Build), - ('protos.Devops', 'Deploy'): face_utilities.unary_unary_inline(servicer.Deploy), - ('protos.Devops', 'EXP_ExecuteWithBinding'): face_utilities.unary_unary_inline(servicer.EXP_ExecuteWithBinding), - ('protos.Devops', 'EXP_GetApplicationTCert'): face_utilities.unary_unary_inline(servicer.EXP_GetApplicationTCert), - ('protos.Devops', 'EXP_PrepareForTx'): face_utilities.unary_unary_inline(servicer.EXP_PrepareForTx), - ('protos.Devops', 'EXP_ProduceSigma'): face_utilities.unary_unary_inline(servicer.EXP_ProduceSigma), - ('protos.Devops', 'GetTransactionResult'): face_utilities.unary_unary_inline(servicer.GetTransactionResult), - ('protos.Devops', 'Invoke'): face_utilities.unary_unary_inline(servicer.Invoke), - ('protos.Devops', 'Login'): face_utilities.unary_unary_inline(servicer.Login), - ('protos.Devops', 'Query'): face_utilities.unary_unary_inline(servicer.Query), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_Devops_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import devops_pb2 - import fabric_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import chaincode_pb2 - import fabric_pb2 - import chaincode_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - import devops_pb2 - import fabric_pb2 - request_serializers = { - ('protos.Devops', 'Build'): chaincode_pb2.ChaincodeSpec.SerializeToString, - ('protos.Devops', 'Deploy'): chaincode_pb2.ChaincodeSpec.SerializeToString, - ('protos.Devops', 'EXP_ExecuteWithBinding'): devops_pb2.ExecuteWithBinding.SerializeToString, - ('protos.Devops', 'EXP_GetApplicationTCert'): devops_pb2.Secret.SerializeToString, - ('protos.Devops', 'EXP_PrepareForTx'): devops_pb2.Secret.SerializeToString, - ('protos.Devops', 'EXP_ProduceSigma'): devops_pb2.SigmaInput.SerializeToString, - ('protos.Devops', 'GetTransactionResult'): devops_pb2.TransactionRequest.SerializeToString, - ('protos.Devops', 'Invoke'): chaincode_pb2.ChaincodeInvocationSpec.SerializeToString, - ('protos.Devops', 'Login'): devops_pb2.Secret.SerializeToString, - ('protos.Devops', 'Query'): chaincode_pb2.ChaincodeInvocationSpec.SerializeToString, - } - response_deserializers = { - ('protos.Devops', 'Build'): chaincode_pb2.ChaincodeDeploymentSpec.FromString, - ('protos.Devops', 'Deploy'): chaincode_pb2.ChaincodeDeploymentSpec.FromString, - ('protos.Devops', 'EXP_ExecuteWithBinding'): fabric_pb2.Response.FromString, - ('protos.Devops', 'EXP_GetApplicationTCert'): fabric_pb2.Response.FromString, - ('protos.Devops', 'EXP_PrepareForTx'): fabric_pb2.Response.FromString, - ('protos.Devops', 'EXP_ProduceSigma'): fabric_pb2.Response.FromString, - ('protos.Devops', 'GetTransactionResult'): fabric_pb2.Response.FromString, - ('protos.Devops', 'Invoke'): fabric_pb2.Response.FromString, - ('protos.Devops', 'Login'): fabric_pb2.Response.FromString, - ('protos.Devops', 'Query'): fabric_pb2.Response.FromString, - } - cardinalities = { - 'Build': cardinality.Cardinality.UNARY_UNARY, - 'Deploy': cardinality.Cardinality.UNARY_UNARY, - 'EXP_ExecuteWithBinding': cardinality.Cardinality.UNARY_UNARY, - 'EXP_GetApplicationTCert': cardinality.Cardinality.UNARY_UNARY, - 'EXP_PrepareForTx': cardinality.Cardinality.UNARY_UNARY, - 'EXP_ProduceSigma': cardinality.Cardinality.UNARY_UNARY, - 'GetTransactionResult': cardinality.Cardinality.UNARY_UNARY, - 'Invoke': cardinality.Cardinality.UNARY_UNARY, - 'Login': cardinality.Cardinality.UNARY_UNARY, - 'Query': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.Devops', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/docker-compose-1-devmode.yml b/bddtests/docker-compose-1-devmode.yml deleted file mode 100644 index a29e936b6b3..00000000000 --- a/bddtests/docker-compose-1-devmode.yml +++ /dev/null @@ -1,22 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - command: peer node start --peer-chaincodedev - -ccenv: - image: hyperledger/fabric-ccenv - environment: - - CORE_CHAINCODE_ID_NAME=testCC - - CORE_PEER_ADDRESS=vp0:7051 - # $$GOPATH (double dollar) required to prevent docker-compose doing its own - # substitution before the value gets to the container - command: | - sh -c " - go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 - exec $$GOPATH/bin/chaincode_example02 - " - links: - - vp0 diff --git a/bddtests/docker-compose-1-empty.yml b/bddtests/docker-compose-1-empty.yml deleted file mode 100644 index 75a1edf9070..00000000000 --- a/bddtests/docker-compose-1-empty.yml +++ /dev/null @@ -1,3 +0,0 @@ -empty: - image: hyperledger/fabric-src - command: bash -c "sleep inf" diff --git a/bddtests/docker-compose-1-exp.yml b/bddtests/docker-compose-1-exp.yml deleted file mode 100644 index 9173c1f6026..00000000000 --- a/bddtests/docker-compose-1-exp.yml +++ /dev/null @@ -1,8 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - ports: - - 7053:7053 diff --git a/bddtests/docker-compose-1.yml b/bddtests/docker-compose-1.yml deleted file mode 100644 index dbad207779e..00000000000 --- a/bddtests/docker-compose-1.yml +++ /dev/null @@ -1,7 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - diff --git a/bddtests/docker-compose-2-tls-basic.yml b/bddtests/docker-compose-2-tls-basic.yml deleted file mode 100644 index 8e3f6229d1a..00000000000 --- a/bddtests/docker-compose-2-tls-basic.yml +++ /dev/null @@ -1,19 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - - CORE_PEER_TLS_ENABLED=true - - CORE_PEER_TLS_SERVERHOSTOVERRIDE=OBC - - CORE_PEER_TLS_CERT_FILE=./bddtests/tlsca.cert - - CORE_PEER_TLS_KEY_FILE=./bddtests/tlsca.priv - -vp1: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 diff --git a/bddtests/docker-compose-2.yml b/bddtests/docker-compose-2.yml deleted file mode 100644 index aaf205ac629..00000000000 --- a/bddtests/docker-compose-2.yml +++ /dev/null @@ -1,17 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - - CORE_PEER_DISCOVERY_PERIOD=1s - - CORE_PEER_DISCOVERY_TOUCHPERIOD=1s - -vp1: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 diff --git a/bddtests/docker-compose-3.yml b/bddtests/docker-compose-3.yml deleted file mode 100644 index 261f688f34c..00000000000 --- a/bddtests/docker-compose-3.yml +++ /dev/null @@ -1,24 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - -vp1: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp2: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 diff --git a/bddtests/docker-compose-4-consensus-base.yml b/bddtests/docker-compose-4-consensus-base.yml deleted file mode 100644 index 08d1ab3770c..00000000000 --- a/bddtests/docker-compose-4-consensus-base.yml +++ /dev/null @@ -1,24 +0,0 @@ -vpBase: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_SECURITY_ENABLED=true - - CORE_PEER_PKI_ECA_PADDR=membersrvc0:7054 - - CORE_PEER_PKI_TCA_PADDR=membersrvc0:7054 - - CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:7054 - - CORE_PEER_PKI_TLS_ROOTCERT_FILE=./bddtests/tlsca.cert - # TODO: Currently required due to issue reading obbca configuration location - - CORE_PBFT_GENERAL_N=4 - # The checkpoint interval in sequence numbers - - CORE_PBFT_GENERAL_K=2 - -vpBatch: - extends: - service: vpBase - environment: - - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft - - CORE_PBFT_GENERAL_TIMEOUT_REQUEST=10s - - CORE_PBFT_GENERAL_MODE=batch - # TODO: This is used for testing as to assure deployment goes through to block - - CORE_PBFT_GENERAL_BATCHSIZE=1 diff --git a/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml b/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml deleted file mode 100644 index 2652cb01297..00000000000 --- a/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml +++ /dev/null @@ -1,55 +0,0 @@ -membersrvc0: - extends: - file: compose-defaults.yml - service: membersrvc - -vp0: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp0 - - CORE_SECURITY_ENROLLID=test_vp0 - - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT - links: - - membersrvc0 - -vp1: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp1 - - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy - links: - - membersrvc0 - - vp0 - -vp2: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp2 - - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ - links: - - membersrvc0 - - vp0 - -vp3: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp3 - - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL - - CORE_PBFT_GENERAL_BYZANTINE=true - links: - - membersrvc0 - - vp0 diff --git a/bddtests/docker-compose-4-consensus-batch.yml b/bddtests/docker-compose-4-consensus-batch.yml deleted file mode 100644 index 100e71ec346..00000000000 --- a/bddtests/docker-compose-4-consensus-batch.yml +++ /dev/null @@ -1,58 +0,0 @@ -membersrvc0: - extends: - file: compose-defaults.yml - service: membersrvc - -vp0: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp0 - - CORE_SECURITY_ENROLLID=test_vp0 - - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT - - CORE_PEER_PROFILE_ENABLED=true - links: - - membersrvc0 -# ports: -# - 7050:6060 - - -vp1: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp1 - - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy - links: - - membersrvc0 - - vp0 - -vp2: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp2 - - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ - links: - - membersrvc0 - - vp0 - -vp3: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBatch - environment: - - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp3 - - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL - links: - - membersrvc0 - - vp0 diff --git a/bddtests/docker-compose-4-consensus-noops.yml b/bddtests/docker-compose-4-consensus-noops.yml deleted file mode 100644 index 7ba08ae1b0c..00000000000 --- a/bddtests/docker-compose-4-consensus-noops.yml +++ /dev/null @@ -1,56 +0,0 @@ -membersrvc0: - extends: - file: compose-defaults.yml - service: membersrvc - -vp0: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBase - environment: - - CORE_PEER_ID=vp0 - - CORE_SECURITY_ENROLLID=test_vp0 - - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT - links: - - membersrvc0 - ports: - - 7050:7050 - -vp1: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBase - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp1 - - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy - links: - - membersrvc0 - - vp0 - -vp2: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBase - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp2 - - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ - links: - - membersrvc0 - - vp0 - -vp3: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBase - environment: - - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_SECURITY_ENROLLID=test_vp3 - - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL - links: - - membersrvc0 - - vp0 diff --git a/bddtests/docker-compose-4-consensus-nvp0.yml b/bddtests/docker-compose-4-consensus-nvp0.yml deleted file mode 100644 index 455027c719a..00000000000 --- a/bddtests/docker-compose-4-consensus-nvp0.yml +++ /dev/null @@ -1,13 +0,0 @@ -nvp0: - extends: - file: docker-compose-4-consensus-base.yml - service: vpBase - environment: - - CORE_PEER_VALIDATOR_ENABLED=false - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - - CORE_PEER_ID=nvp0 - - CORE_SECURITY_ENROLLID=test_nvp0 - - CORE_SECURITY_ENROLLSECRET=iywrPBDEPl0K - links: - - membersrvc0 - - vp0 diff --git a/bddtests/docker-compose-4-consensus-vp3-byzantine.yml b/bddtests/docker-compose-4-consensus-vp3-byzantine.yml deleted file mode 100644 index b64857f60e8..00000000000 --- a/bddtests/docker-compose-4-consensus-vp3-byzantine.yml +++ /dev/null @@ -1,3 +0,0 @@ -vp3: - environment: - - CORE_PBFT_GENERAL_BYZANTINE=true diff --git a/bddtests/docker-compose-4.yml b/bddtests/docker-compose-4.yml deleted file mode 100644 index fa1ca1e78af..00000000000 --- a/bddtests/docker-compose-4.yml +++ /dev/null @@ -1,33 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - -vp1: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp2: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp3: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 diff --git a/bddtests/docker-compose-5.yml b/bddtests/docker-compose-5.yml deleted file mode 100644 index 6149dd0affa..00000000000 --- a/bddtests/docker-compose-5.yml +++ /dev/null @@ -1,42 +0,0 @@ -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - -vp1: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp2: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp3: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 - -vp4: - extends: - service: vp0 - environment: - - CORE_PEER_ID=vp4 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - links: - - vp0 diff --git a/bddtests/docker-compose-next-4.yml b/bddtests/docker-compose-next-4.yml index 29e8e93fa1e..0741a5b3107 100644 --- a/bddtests/docker-compose-next-4.yml +++ b/bddtests/docker-compose-next-4.yml @@ -8,6 +8,7 @@ services: service: orderer0 environment: - ORDERER_GENERAL_LOCALMSPDIR=${ORDERER0_ORDERER_GENERAL_LOCALMSPDIR} + - ORDERER_GENERAL_LOCALMSPID=${ORDERER0_ORDERER_GENERAL_LOCALMSPID} peer0: @@ -19,6 +20,7 @@ services: - CORE_PEER_PROFILE_ENABLED=true - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_MSPCONFIGPATH=${PEER0_CORE_PEER_MSPCFGPATH} + - CORE_PEER_LOCALMSPID=${PEER0_CORE_PEER_LOCALMSPID} depends_on: - orderer0 # ports: @@ -34,6 +36,7 @@ services: - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_MSPCONFIGPATH=${PEER1_CORE_PEER_MSPCFGPATH} + - CORE_PEER_LOCALMSPID=${PEER1_CORE_PEER_LOCALMSPID} depends_on: - orderer0 - peer0 @@ -47,6 +50,7 @@ services: - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_MSPCONFIGPATH=${PEER2_CORE_PEER_MSPCFGPATH} + - CORE_PEER_LOCALMSPID=${PEER2_CORE_PEER_LOCALMSPID} depends_on: - orderer0 - peer0 @@ -60,6 +64,7 @@ services: - CORE_PEER_GOSSIP_BOOTSTRAP=peer0:7051 - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer0:7050 - CORE_PEER_MSPCONFIGPATH=${PEER3_CORE_PEER_MSPCFGPATH} + - CORE_PEER_LOCALMSPID=${PEER3_CORE_PEER_LOCALMSPID} depends_on: - orderer0 - peer0 diff --git a/bddtests/docker-compose-rest.yml b/bddtests/docker-compose-rest.yml deleted file mode 100644 index c062c7da350..00000000000 --- a/bddtests/docker-compose-rest.yml +++ /dev/null @@ -1,17 +0,0 @@ -membersrvc0: - extends: - file: compose-defaults.yml - service: membersrvc - -vp0: - extends: - file: compose-defaults.yml - service: vp - environment: - - CORE_PEER_ID=vp0 - - CORE_SECURITY_ENABLED=true - - CORE_PEER_PKI_ECA_PADDR=membersrvc0:7054 - - CORE_PEER_PKI_TCA_PADDR=membersrvc0:7054 - - CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:7054 - links: - - membersrvc0 \ No newline at end of file diff --git a/bddtests/docker-compose-sdk-node.yml b/bddtests/docker-compose-sdk-node.yml deleted file mode 100644 index 4db31fd2c48..00000000000 --- a/bddtests/docker-compose-sdk-node.yml +++ /dev/null @@ -1,11 +0,0 @@ -sampleApp0: - image: hyperledger-sdk-node - environment: - - MEMBERSRVC_ADDRESS=membersrvc0:7054 - - PEER_ADDRESS=vp0:7051 - - KEY_VALUE_STORE=/tmp/hl_sdk_node_key_value_store - # Startup of peer must be delayed to allow membersrvc to come up first - command: node sampleSDKApp - links: - - membersrvc0 - - vp0 diff --git a/bddtests/docker-membersrvc-attributes-enabled.yml b/bddtests/docker-membersrvc-attributes-enabled.yml deleted file mode 100644 index 0269d51ef7e..00000000000 --- a/bddtests/docker-membersrvc-attributes-enabled.yml +++ /dev/null @@ -1,3 +0,0 @@ -membersrvc0: - environment: - - MEMBERSRVC_CA_ACA_ENABLED=true diff --git a/bddtests/docker-membersrvc-attributes-encryption-enabled.yml b/bddtests/docker-membersrvc-attributes-encryption-enabled.yml deleted file mode 100644 index 6bb3978cee7..00000000000 --- a/bddtests/docker-membersrvc-attributes-encryption-enabled.yml +++ /dev/null @@ -1,3 +0,0 @@ -membersrvc0: - environment: - - MEMBERSRVC_CA_TCA_ATTRIBUTE-ENCRYPTION_ENABLED=true diff --git a/bddtests/environment.py b/bddtests/environment.py index a3dd873c549..ad21576a6fb 100644 --- a/bddtests/environment.py +++ b/bddtests/environment.py @@ -4,6 +4,7 @@ from steps.bdd_test_util import cli_call from steps.contexthelper import ContextHelper from steps.coverage import saveCoverageFiles, createCoverageAggregate +from steps.bootstrap_util import getDirectory def coverageEnabled(context): return context.config.userdata.get("coverage", "false") == "true" @@ -20,6 +21,11 @@ def before_step(context, step): contextHelper = ContextHelper.GetHelper(context=context) contextHelper.before_step(step) +def after_step(context, step): + contextHelper = ContextHelper.GetHelper(context=context) + contextHelper.after_step(step) + + def before_scenario(context, scenario): contextHelper = ContextHelper.GetHelper(context=context) contextHelper.before_scenario(scenario) @@ -61,7 +67,8 @@ def after_scenario(context, scenario): containerNames = [containerData.containerName for containerData in context.compose_containers] saveCoverageFiles("coverage", scenario.name.replace(" ", "_"), containerNames, "cov") context.composition.decompose() - + # Ask the directory to cleanup + getDirectory(context).cleanup() # stop any running peer that could get in the way before starting the tests def before_all(context): diff --git a/bddtests/events_pb2.py b/bddtests/events_pb2.py deleted file mode 100644 index 8903e46b02c..00000000000 --- a/bddtests/events_pb2.py +++ /dev/null @@ -1,313 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: events.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -import fabric_pb2 as fabric__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='events.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x0c\x65vents.proto\x12\x06protos\x1a\x0c\x66\x61\x62ric.proto\"\x88\x01\n\x08Interest\x12\x11\n\teventType\x18\x01 \x01(\t\x12\x33\n\x0cresponseType\x18\x02 \x01(\x0e\x32\x1d.protos.Interest.ResponseType\"4\n\x0cResponseType\x12\x0c\n\x08\x44ONTSEND\x10\x00\x12\x0c\n\x08PROTOBUF\x10\x01\x12\x08\n\x04JSON\x10\x02\",\n\x08Register\x12 \n\x06\x65vents\x18\x01 \x03(\x0b\x32\x10.protos.Interest\"-\n\x07Generic\x12\x11\n\teventType\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"z\n\x05\x45vent\x12$\n\x08register\x18\x01 \x01(\x0b\x32\x10.protos.RegisterH\x00\x12\x1e\n\x05\x62lock\x18\x02 \x01(\x0b\x32\r.protos.BlockH\x00\x12\"\n\x07generic\x18\x03 \x01(\x0b\x32\x0f.protos.GenericH\x00\x42\x07\n\x05\x45vent24\n\x06\x45vents\x12*\n\x04\x43hat\x12\r.protos.Event\x1a\r.protos.Event\"\x00(\x01\x30\x01\x62\x06proto3') - , - dependencies=[fabric__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_INTEREST_RESPONSETYPE = _descriptor.EnumDescriptor( - name='ResponseType', - full_name='protos.Interest.ResponseType', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='DONTSEND', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PROTOBUF', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='JSON', index=2, number=2, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=123, - serialized_end=175, -) -_sym_db.RegisterEnumDescriptor(_INTEREST_RESPONSETYPE) - - -_INTEREST = _descriptor.Descriptor( - name='Interest', - full_name='protos.Interest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='eventType', full_name='protos.Interest.eventType', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='responseType', full_name='protos.Interest.responseType', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _INTEREST_RESPONSETYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=39, - serialized_end=175, -) - - -_REGISTER = _descriptor.Descriptor( - name='Register', - full_name='protos.Register', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='events', full_name='protos.Register.events', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=177, - serialized_end=221, -) - - -_GENERIC = _descriptor.Descriptor( - name='Generic', - full_name='protos.Generic', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='eventType', full_name='protos.Generic.eventType', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Generic.payload', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=223, - serialized_end=268, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='protos.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='register', full_name='protos.Event.register', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='block', full_name='protos.Event.block', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='generic', full_name='protos.Event.generic', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='Event', full_name='protos.Event.Event', - index=0, containing_type=None, fields=[]), - ], - serialized_start=270, - serialized_end=392, -) - -_INTEREST.fields_by_name['responseType'].enum_type = _INTEREST_RESPONSETYPE -_INTEREST_RESPONSETYPE.containing_type = _INTEREST -_REGISTER.fields_by_name['events'].message_type = _INTEREST -_EVENT.fields_by_name['register'].message_type = _REGISTER -_EVENT.fields_by_name['block'].message_type = fabric__pb2._BLOCK -_EVENT.fields_by_name['generic'].message_type = _GENERIC -_EVENT.oneofs_by_name['Event'].fields.append( - _EVENT.fields_by_name['register']) -_EVENT.fields_by_name['register'].containing_oneof = _EVENT.oneofs_by_name['Event'] -_EVENT.oneofs_by_name['Event'].fields.append( - _EVENT.fields_by_name['block']) -_EVENT.fields_by_name['block'].containing_oneof = _EVENT.oneofs_by_name['Event'] -_EVENT.oneofs_by_name['Event'].fields.append( - _EVENT.fields_by_name['generic']) -_EVENT.fields_by_name['generic'].containing_oneof = _EVENT.oneofs_by_name['Event'] -DESCRIPTOR.message_types_by_name['Interest'] = _INTEREST -DESCRIPTOR.message_types_by_name['Register'] = _REGISTER -DESCRIPTOR.message_types_by_name['Generic'] = _GENERIC -DESCRIPTOR.message_types_by_name['Event'] = _EVENT - -Interest = _reflection.GeneratedProtocolMessageType('Interest', (_message.Message,), dict( - DESCRIPTOR = _INTEREST, - __module__ = 'events_pb2' - # @@protoc_insertion_point(class_scope:protos.Interest) - )) -_sym_db.RegisterMessage(Interest) - -Register = _reflection.GeneratedProtocolMessageType('Register', (_message.Message,), dict( - DESCRIPTOR = _REGISTER, - __module__ = 'events_pb2' - # @@protoc_insertion_point(class_scope:protos.Register) - )) -_sym_db.RegisterMessage(Register) - -Generic = _reflection.GeneratedProtocolMessageType('Generic', (_message.Message,), dict( - DESCRIPTOR = _GENERIC, - __module__ = 'events_pb2' - # @@protoc_insertion_point(class_scope:protos.Generic) - )) -_sym_db.RegisterMessage(Generic) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), dict( - DESCRIPTOR = _EVENT, - __module__ = 'events_pb2' - # @@protoc_insertion_point(class_scope:protos.Event) - )) -_sym_db.RegisterMessage(Event) - - -import abc -import six -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - -class BetaEventsServicer(object): - """Interface exported by the events server - """ - def Chat(self, request_iterator, context): - """event chatting using Event - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaEventsStub(object): - """Interface exported by the events server - """ - def Chat(self, request_iterator, timeout): - """event chatting using Event - """ - raise NotImplementedError() - -def beta_create_Events_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import events_pb2 - import events_pb2 - request_deserializers = { - ('protos.Events', 'Chat'): events_pb2.Event.FromString, - } - response_serializers = { - ('protos.Events', 'Chat'): events_pb2.Event.SerializeToString, - } - method_implementations = { - ('protos.Events', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_Events_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import events_pb2 - import events_pb2 - request_serializers = { - ('protos.Events', 'Chat'): events_pb2.Event.SerializeToString, - } - response_deserializers = { - ('protos.Events', 'Chat'): events_pb2.Event.FromString, - } - cardinalities = { - 'Chat': cardinality.Cardinality.STREAM_STREAM, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.Events', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/fabric_next_pb2.py b/bddtests/fabric_next_pb2.py deleted file mode 100644 index e2c667a2309..00000000000 --- a/bddtests/fabric_next_pb2.py +++ /dev/null @@ -1,696 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: fabric_next.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='fabric_next.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x11\x66\x61\x62ric_next.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\"@\n\x08\x45nvelope\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12!\n\x07message\x18\x02 \x01(\x0b\x32\x10.protos.Message2\"\x90\x02\n\x08Message2\x12#\n\x04type\x18\x01 \x01(\x0e\x32\x15.protos.Message2.Type\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12-\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\"\x8d\x01\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\r\n\tDISCOVERY\x10\x01\x12\x08\n\x04SYNC\x10\x02\x12\x0c\n\x08PROPOSAL\x10\x03\x12\x10\n\x0cPROPOSAL_SET\x10\x04\x12\x13\n\x0fPROPOSAL_RESULT\x10\x05\x12\x17\n\x13PROPOSAL_SET_RESULT\x10\x06\x12\x0f\n\x0bTRANSACTION\x10\x07\"r\n\x08Proposal\x12#\n\x04type\x18\x01 \x01(\x0e\x32\x15.protos.Proposal.Type\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"$\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\r\n\tCHAINCODE\x10\x01\"=\n\tResponse2\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"\x1d\n\x0fSystemChaincode\x12\n\n\x02id\x18\x01 \x01(\t\"\x96\x01\n\x06\x41\x63tion\x12\x14\n\x0cproposalHash\x18\x01 \x01(\x0c\x12\x18\n\x10simulationResult\x18\x02 \x01(\x0c\x12\x0e\n\x06\x65vents\x18\x03 \x03(\x0c\x12%\n\x04\x65scc\x18\x04 \x01(\x0b\x32\x17.protos.SystemChaincode\x12%\n\x04vscc\x18\x05 \x01(\x0b\x32\x17.protos.SystemChaincode\" \n\x0b\x45ndorsement\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"v\n\x10ProposalResponse\x12#\n\x08response\x18\x01 \x01(\x0b\x32\x11.protos.Response2\x12\x13\n\x0b\x61\x63tionBytes\x18\x02 \x01(\x0c\x12(\n\x0b\x65ndorsement\x18\x03 \x01(\x0b\x32\x13.protos.Endorsement\"g\n\x0e\x45ndorsedAction\x12\x13\n\x0b\x61\x63tionBytes\x18\x01 \x01(\x0c\x12)\n\x0c\x65ndorsements\x18\x02 \x03(\x0b\x32\x13.protos.Endorsement\x12\x15\n\rproposalBytes\x18\x03 \x01(\x0c\"?\n\x0cTransaction2\x12/\n\x0f\x65ndorsedActions\x18\x01 \x03(\x0b\x32\x16.protos.EndorsedAction2K\n\x08\x45ndorser\x12?\n\x0fProcessProposal\x12\x10.protos.Proposal\x1a\x18.protos.ProposalResponse\"\x00\x62\x06proto3') - , - dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_MESSAGE2_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.Message2.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISCOVERY', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PROPOSAL', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PROPOSAL_SET', index=4, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PROPOSAL_RESULT', index=5, number=5, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PROPOSAL_SET_RESULT', index=6, number=6, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='TRANSACTION', index=7, number=7, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=260, - serialized_end=401, -) -_sym_db.RegisterEnumDescriptor(_MESSAGE2_TYPE) - -_PROPOSAL_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.Proposal.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE', index=1, number=1, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=481, - serialized_end=517, -) -_sym_db.RegisterEnumDescriptor(_PROPOSAL_TYPE) - - -_ENVELOPE = _descriptor.Descriptor( - name='Envelope', - full_name='protos.Envelope', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='signature', full_name='protos.Envelope.signature', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='message', full_name='protos.Envelope.message', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=62, - serialized_end=126, -) - - -_MESSAGE2 = _descriptor.Descriptor( - name='Message2', - full_name='protos.Message2', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.Message2.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='version', full_name='protos.Message2.version', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.Message2.timestamp', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Message2.payload', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _MESSAGE2_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=129, - serialized_end=401, -) - - -_PROPOSAL = _descriptor.Descriptor( - name='Proposal', - full_name='protos.Proposal', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.Proposal.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.Proposal.id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Proposal.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _PROPOSAL_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=403, - serialized_end=517, -) - - -_RESPONSE2 = _descriptor.Descriptor( - name='Response2', - full_name='protos.Response2', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='protos.Response2.status', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='message', full_name='protos.Response2.message', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Response2.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=519, - serialized_end=580, -) - - -_SYSTEMCHAINCODE = _descriptor.Descriptor( - name='SystemChaincode', - full_name='protos.SystemChaincode', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.SystemChaincode.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=582, - serialized_end=611, -) - - -_ACTION = _descriptor.Descriptor( - name='Action', - full_name='protos.Action', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='proposalHash', full_name='protos.Action.proposalHash', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='simulationResult', full_name='protos.Action.simulationResult', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='events', full_name='protos.Action.events', index=2, - number=3, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='escc', full_name='protos.Action.escc', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='vscc', full_name='protos.Action.vscc', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=614, - serialized_end=764, -) - - -_ENDORSEMENT = _descriptor.Descriptor( - name='Endorsement', - full_name='protos.Endorsement', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='signature', full_name='protos.Endorsement.signature', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=766, - serialized_end=798, -) - - -_PROPOSALRESPONSE = _descriptor.Descriptor( - name='ProposalResponse', - full_name='protos.ProposalResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='response', full_name='protos.ProposalResponse.response', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='actionBytes', full_name='protos.ProposalResponse.actionBytes', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='endorsement', full_name='protos.ProposalResponse.endorsement', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=800, - serialized_end=918, -) - - -_ENDORSEDACTION = _descriptor.Descriptor( - name='EndorsedAction', - full_name='protos.EndorsedAction', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='actionBytes', full_name='protos.EndorsedAction.actionBytes', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='endorsements', full_name='protos.EndorsedAction.endorsements', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='proposalBytes', full_name='protos.EndorsedAction.proposalBytes', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1023, -) - - -_TRANSACTION2 = _descriptor.Descriptor( - name='Transaction2', - full_name='protos.Transaction2', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='endorsedActions', full_name='protos.Transaction2.endorsedActions', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1025, - serialized_end=1088, -) - -_ENVELOPE.fields_by_name['message'].message_type = _MESSAGE2 -_MESSAGE2.fields_by_name['type'].enum_type = _MESSAGE2_TYPE -_MESSAGE2.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_MESSAGE2_TYPE.containing_type = _MESSAGE2 -_PROPOSAL.fields_by_name['type'].enum_type = _PROPOSAL_TYPE -_PROPOSAL_TYPE.containing_type = _PROPOSAL -_ACTION.fields_by_name['escc'].message_type = _SYSTEMCHAINCODE -_ACTION.fields_by_name['vscc'].message_type = _SYSTEMCHAINCODE -_PROPOSALRESPONSE.fields_by_name['response'].message_type = _RESPONSE2 -_PROPOSALRESPONSE.fields_by_name['endorsement'].message_type = _ENDORSEMENT -_ENDORSEDACTION.fields_by_name['endorsements'].message_type = _ENDORSEMENT -_TRANSACTION2.fields_by_name['endorsedActions'].message_type = _ENDORSEDACTION -DESCRIPTOR.message_types_by_name['Envelope'] = _ENVELOPE -DESCRIPTOR.message_types_by_name['Message2'] = _MESSAGE2 -DESCRIPTOR.message_types_by_name['Proposal'] = _PROPOSAL -DESCRIPTOR.message_types_by_name['Response2'] = _RESPONSE2 -DESCRIPTOR.message_types_by_name['SystemChaincode'] = _SYSTEMCHAINCODE -DESCRIPTOR.message_types_by_name['Action'] = _ACTION -DESCRIPTOR.message_types_by_name['Endorsement'] = _ENDORSEMENT -DESCRIPTOR.message_types_by_name['ProposalResponse'] = _PROPOSALRESPONSE -DESCRIPTOR.message_types_by_name['EndorsedAction'] = _ENDORSEDACTION -DESCRIPTOR.message_types_by_name['Transaction2'] = _TRANSACTION2 - -Envelope = _reflection.GeneratedProtocolMessageType('Envelope', (_message.Message,), dict( - DESCRIPTOR = _ENVELOPE, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Envelope) - )) -_sym_db.RegisterMessage(Envelope) - -Message2 = _reflection.GeneratedProtocolMessageType('Message2', (_message.Message,), dict( - DESCRIPTOR = _MESSAGE2, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Message2) - )) -_sym_db.RegisterMessage(Message2) - -Proposal = _reflection.GeneratedProtocolMessageType('Proposal', (_message.Message,), dict( - DESCRIPTOR = _PROPOSAL, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Proposal) - )) -_sym_db.RegisterMessage(Proposal) - -Response2 = _reflection.GeneratedProtocolMessageType('Response2', (_message.Message,), dict( - DESCRIPTOR = _RESPONSE2, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Response2) - )) -_sym_db.RegisterMessage(Response2) - -SystemChaincode = _reflection.GeneratedProtocolMessageType('SystemChaincode', (_message.Message,), dict( - DESCRIPTOR = _SYSTEMCHAINCODE, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.SystemChaincode) - )) -_sym_db.RegisterMessage(SystemChaincode) - -Action = _reflection.GeneratedProtocolMessageType('Action', (_message.Message,), dict( - DESCRIPTOR = _ACTION, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Action) - )) -_sym_db.RegisterMessage(Action) - -Endorsement = _reflection.GeneratedProtocolMessageType('Endorsement', (_message.Message,), dict( - DESCRIPTOR = _ENDORSEMENT, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Endorsement) - )) -_sym_db.RegisterMessage(Endorsement) - -ProposalResponse = _reflection.GeneratedProtocolMessageType('ProposalResponse', (_message.Message,), dict( - DESCRIPTOR = _PROPOSALRESPONSE, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.ProposalResponse) - )) -_sym_db.RegisterMessage(ProposalResponse) - -EndorsedAction = _reflection.GeneratedProtocolMessageType('EndorsedAction', (_message.Message,), dict( - DESCRIPTOR = _ENDORSEDACTION, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.EndorsedAction) - )) -_sym_db.RegisterMessage(EndorsedAction) - -Transaction2 = _reflection.GeneratedProtocolMessageType('Transaction2', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTION2, - __module__ = 'fabric_next_pb2' - # @@protoc_insertion_point(class_scope:protos.Transaction2) - )) -_sym_db.RegisterMessage(Transaction2) - - -import grpc -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - - -class EndorserStub(object): - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ProcessProposal = channel.unary_unary( - '/protos.Endorser/ProcessProposal', - request_serializer=Proposal.SerializeToString, - response_deserializer=ProposalResponse.FromString, - ) - - -class EndorserServicer(object): - - def ProcessProposal(self, request, context): - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_EndorserServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ProcessProposal': grpc.unary_unary_rpc_method_handler( - servicer.ProcessProposal, - request_deserializer=Proposal.FromString, - response_serializer=ProposalResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'protos.Endorser', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - -class BetaEndorserServicer(object): - def ProcessProposal(self, request, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - - -class BetaEndorserStub(object): - def ProcessProposal(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - raise NotImplementedError() - ProcessProposal.future = None - - -def beta_create_Endorser_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - request_deserializers = { - ('protos.Endorser', 'ProcessProposal'): Proposal.FromString, - } - response_serializers = { - ('protos.Endorser', 'ProcessProposal'): ProposalResponse.SerializeToString, - } - method_implementations = { - ('protos.Endorser', 'ProcessProposal'): face_utilities.unary_unary_inline(servicer.ProcessProposal), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - - -def beta_create_Endorser_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - request_serializers = { - ('protos.Endorser', 'ProcessProposal'): Proposal.SerializeToString, - } - response_deserializers = { - ('protos.Endorser', 'ProcessProposal'): ProposalResponse.FromString, - } - cardinalities = { - 'ProcessProposal': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.Endorser', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/fabric_pb2.py b/bddtests/fabric_pb2.py deleted file mode 100644 index b3b87b7ad5b..00000000000 --- a/bddtests/fabric_pb2.py +++ /dev/null @@ -1,1354 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: fabric.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -import chaincode_pb2 as chaincode__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='fabric.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x0c\x66\x61\x62ric.proto\x12\x06protos\x1a\x0f\x63haincode.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc5\x03\n\x0bTransaction\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.protos.Transaction.Type\x12\x13\n\x0b\x63haincodeID\x18\x02 \x01(\x0c\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x10\n\x08metadata\x18\x04 \x01(\x0c\x12\x0c\n\x04uuid\x18\x05 \x01(\t\x12-\n\ttimestamp\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\x14\x63onfidentialityLevel\x18\x07 \x01(\x0e\x32\x1c.protos.ConfidentialityLevel\x12&\n\x1e\x63onfidentialityProtocolVersion\x18\x08 \x01(\t\x12\r\n\x05nonce\x18\t \x01(\x0c\x12\x14\n\x0ctoValidators\x18\n \x01(\x0c\x12\x0c\n\x04\x63\x65rt\x18\x0b \x01(\x0c\x12\x11\n\tsignature\x18\x0c \x01(\x0c\"o\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\x14\n\x10\x43HAINCODE_DEPLOY\x10\x01\x12\x14\n\x10\x43HAINCODE_INVOKE\x10\x02\x12\x13\n\x0f\x43HAINCODE_QUERY\x10\x03\x12\x17\n\x13\x43HAINCODE_TERMINATE\x10\x04\"=\n\x10TransactionBlock\x12)\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x13.protos.Transaction\"S\n\x11TransactionResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x0e\n\x06result\x18\x02 \x01(\x0c\x12\x11\n\terrorCode\x18\x03 \x01(\r\x12\r\n\x05\x65rror\x18\x04 \x01(\t\"\xe5\x01\n\x05\x42lock\x12\x0f\n\x07version\x18\x01 \x01(\r\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12)\n\x0ctransactions\x18\x03 \x03(\x0b\x32\x13.protos.Transaction\x12\x11\n\tstateHash\x18\x04 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x05 \x01(\x0c\x12\x19\n\x11\x63onsensusMetadata\x18\x06 \x01(\x0c\x12(\n\x0bnonHashData\x18\x07 \x01(\x0b\x32\x13.protos.NonHashData\"U\n\x0e\x42lockchainInfo\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x18\n\x10\x63urrentBlockHash\x18\x02 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x03 \x01(\x0c\"\x84\x01\n\x0bNonHashData\x12>\n\x1alocalLedgerCommitTimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x12transactionResults\x18\x02 \x03(\x0b\x32\x19.protos.TransactionResult\")\n\x0bPeerAddress\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\x05\"\x16\n\x06PeerID\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xac\x01\n\x0cPeerEndpoint\x12\x1a\n\x02ID\x18\x01 \x01(\x0b\x32\x0e.protos.PeerID\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\'\n\x04type\x18\x03 \x01(\x0e\x32\x19.protos.PeerEndpoint.Type\x12\r\n\x05pkiID\x18\x04 \x01(\x0c\"7\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\r\n\tVALIDATOR\x10\x01\x12\x11\n\rNON_VALIDATOR\x10\x02\"3\n\x0cPeersMessage\x12#\n\x05peers\x18\x01 \x03(\x0b\x32\x14.protos.PeerEndpoint\"j\n\x0cHelloMessage\x12*\n\x0cpeerEndpoint\x18\x01 \x01(\x0b\x32\x14.protos.PeerEndpoint\x12.\n\x0e\x62lockchainInfo\x18\x02 \x01(\x0b\x32\x16.protos.BlockchainInfo\"\xca\x03\n\x07Message\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.protos.Message.Type\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x11\n\tsignature\x18\x04 \x01(\x0c\"\xc7\x02\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\x0e\n\nDISC_HELLO\x10\x01\x12\x13\n\x0f\x44ISC_DISCONNECT\x10\x02\x12\x12\n\x0e\x44ISC_GET_PEERS\x10\x03\x12\x0e\n\nDISC_PEERS\x10\x04\x12\x0f\n\x0b\x44ISC_NEWMSG\x10\x05\x12\x15\n\x11\x43HAIN_TRANSACTION\x10\x06\x12\x13\n\x0fSYNC_GET_BLOCKS\x10\x0b\x12\x0f\n\x0bSYNC_BLOCKS\x10\x0c\x12\x14\n\x10SYNC_BLOCK_ADDED\x10\r\x12\x1b\n\x17SYNC_STATE_GET_SNAPSHOT\x10\x0e\x12\x17\n\x13SYNC_STATE_SNAPSHOT\x10\x0f\x12\x19\n\x15SYNC_STATE_GET_DELTAS\x10\x10\x12\x15\n\x11SYNC_STATE_DELTAS\x10\x11\x12\x0c\n\x08RESPONSE\x10\x14\x12\r\n\tCONSENSUS\x10\x15\"}\n\x08Response\x12+\n\x06status\x18\x01 \x01(\x0e\x32\x1b.protos.Response.StatusCode\x12\x0b\n\x03msg\x18\x02 \x01(\x0c\"7\n\nStatusCode\x12\r\n\tUNDEFINED\x10\x00\x12\x0c\n\x07SUCCESS\x10\xc8\x01\x12\x0c\n\x07\x46\x41ILURE\x10\xf4\x03\">\n\nBlockState\x12\x1c\n\x05\x62lock\x18\x01 \x01(\x0b\x32\r.protos.Block\x12\x12\n\nstateDelta\x18\x02 \x01(\x0c\",\n\x0eSyncBlockRange\x12\r\n\x05start\x18\x01 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x04\"R\n\nSyncBlocks\x12%\n\x05range\x18\x01 \x01(\x0b\x32\x16.protos.SyncBlockRange\x12\x1d\n\x06\x62locks\x18\x02 \x03(\x0b\x32\r.protos.Block\"1\n\x18SyncStateSnapshotRequest\x12\x15\n\rcorrelationId\x18\x01 \x01(\x04\"|\n\x11SyncStateSnapshot\x12\r\n\x05\x64\x65lta\x18\x01 \x01(\x0c\x12\x10\n\x08sequence\x18\x02 \x01(\x04\x12\x13\n\x0b\x62lockNumber\x18\x03 \x01(\x04\x12\x31\n\x07request\x18\x04 \x01(\x0b\x32 .protos.SyncStateSnapshotRequest\"?\n\x16SyncStateDeltasRequest\x12%\n\x05range\x18\x01 \x01(\x0b\x32\x16.protos.SyncBlockRange\"H\n\x0fSyncStateDeltas\x12%\n\x05range\x18\x01 \x01(\x0b\x32\x16.protos.SyncBlockRange\x12\x0e\n\x06\x64\x65ltas\x18\x02 \x03(\x0c\x32u\n\x04Peer\x12.\n\x04\x43hat\x12\x0f.protos.Message\x1a\x0f.protos.Message\"\x00(\x01\x30\x01\x12=\n\x12ProcessTransaction\x12\x13.protos.Transaction\x1a\x10.protos.Response\"\x00\x62\x06proto3') - , - dependencies=[chaincode__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_TRANSACTION_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.Transaction.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE_DEPLOY', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE_INVOKE', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE_QUERY', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE_TERMINATE', index=4, number=4, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=417, - serialized_end=528, -) -_sym_db.RegisterEnumDescriptor(_TRANSACTION_TYPE) - -_PEERENDPOINT_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.PeerEndpoint.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='VALIDATOR', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NON_VALIDATOR', index=2, number=2, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=1317, - serialized_end=1372, -) -_sym_db.RegisterEnumDescriptor(_PEERENDPOINT_TYPE) - -_MESSAGE_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.Message.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISC_HELLO', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISC_DISCONNECT', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISC_GET_PEERS', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISC_PEERS', index=4, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DISC_NEWMSG', index=5, number=5, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAIN_TRANSACTION', index=6, number=6, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_GET_BLOCKS', index=7, number=11, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_BLOCKS', index=8, number=12, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_BLOCK_ADDED', index=9, number=13, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_STATE_GET_SNAPSHOT', index=10, number=14, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_STATE_SNAPSHOT', index=11, number=15, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_STATE_GET_DELTAS', index=12, number=16, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SYNC_STATE_DELTAS', index=13, number=17, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='RESPONSE', index=14, number=20, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CONSENSUS', index=15, number=21, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=1667, - serialized_end=1994, -) -_sym_db.RegisterEnumDescriptor(_MESSAGE_TYPE) - -_RESPONSE_STATUSCODE = _descriptor.EnumDescriptor( - name='StatusCode', - full_name='protos.Response.StatusCode', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SUCCESS', index=1, number=200, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='FAILURE', index=2, number=500, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=2066, - serialized_end=2121, -) -_sym_db.RegisterEnumDescriptor(_RESPONSE_STATUSCODE) - - -_TRANSACTION = _descriptor.Descriptor( - name='Transaction', - full_name='protos.Transaction', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.Transaction.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chaincodeID', full_name='protos.Transaction.chaincodeID', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Transaction.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='metadata', full_name='protos.Transaction.metadata', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='uuid', full_name='protos.Transaction.uuid', index=4, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.Transaction.timestamp', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='confidentialityLevel', full_name='protos.Transaction.confidentialityLevel', index=6, - number=7, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='confidentialityProtocolVersion', full_name='protos.Transaction.confidentialityProtocolVersion', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='nonce', full_name='protos.Transaction.nonce', index=8, - number=9, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='toValidators', full_name='protos.Transaction.toValidators', index=9, - number=10, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='cert', full_name='protos.Transaction.cert', index=10, - number=11, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='signature', full_name='protos.Transaction.signature', index=11, - number=12, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _TRANSACTION_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=75, - serialized_end=528, -) - - -_TRANSACTIONBLOCK = _descriptor.Descriptor( - name='TransactionBlock', - full_name='protos.TransactionBlock', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='transactions', full_name='protos.TransactionBlock.transactions', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=530, - serialized_end=591, -) - - -_TRANSACTIONRESULT = _descriptor.Descriptor( - name='TransactionResult', - full_name='protos.TransactionResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='protos.TransactionResult.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='result', full_name='protos.TransactionResult.result', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='errorCode', full_name='protos.TransactionResult.errorCode', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='error', full_name='protos.TransactionResult.error', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=593, - serialized_end=676, -) - - -_BLOCK = _descriptor.Descriptor( - name='Block', - full_name='protos.Block', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='version', full_name='protos.Block.version', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.Block.timestamp', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='transactions', full_name='protos.Block.transactions', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='stateHash', full_name='protos.Block.stateHash', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='previousBlockHash', full_name='protos.Block.previousBlockHash', index=4, - number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='consensusMetadata', full_name='protos.Block.consensusMetadata', index=5, - number=6, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='nonHashData', full_name='protos.Block.nonHashData', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=679, - serialized_end=908, -) - - -_BLOCKCHAININFO = _descriptor.Descriptor( - name='BlockchainInfo', - full_name='protos.BlockchainInfo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='height', full_name='protos.BlockchainInfo.height', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='currentBlockHash', full_name='protos.BlockchainInfo.currentBlockHash', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='previousBlockHash', full_name='protos.BlockchainInfo.previousBlockHash', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=910, - serialized_end=995, -) - - -_NONHASHDATA = _descriptor.Descriptor( - name='NonHashData', - full_name='protos.NonHashData', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='localLedgerCommitTimestamp', full_name='protos.NonHashData.localLedgerCommitTimestamp', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='transactionResults', full_name='protos.NonHashData.transactionResults', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=998, - serialized_end=1130, -) - - -_PEERADDRESS = _descriptor.Descriptor( - name='PeerAddress', - full_name='protos.PeerAddress', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='host', full_name='protos.PeerAddress.host', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='port', full_name='protos.PeerAddress.port', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1132, - serialized_end=1173, -) - - -_PEERID = _descriptor.Descriptor( - name='PeerID', - full_name='protos.PeerID', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='protos.PeerID.name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1175, - serialized_end=1197, -) - - -_PEERENDPOINT = _descriptor.Descriptor( - name='PeerEndpoint', - full_name='protos.PeerEndpoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ID', full_name='protos.PeerEndpoint.ID', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='address', full_name='protos.PeerEndpoint.address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='type', full_name='protos.PeerEndpoint.type', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='pkiID', full_name='protos.PeerEndpoint.pkiID', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _PEERENDPOINT_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1200, - serialized_end=1372, -) - - -_PEERSMESSAGE = _descriptor.Descriptor( - name='PeersMessage', - full_name='protos.PeersMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='peers', full_name='protos.PeersMessage.peers', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1374, - serialized_end=1425, -) - - -_HELLOMESSAGE = _descriptor.Descriptor( - name='HelloMessage', - full_name='protos.HelloMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='peerEndpoint', full_name='protos.HelloMessage.peerEndpoint', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='blockchainInfo', full_name='protos.HelloMessage.blockchainInfo', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1427, - serialized_end=1533, -) - - -_MESSAGE = _descriptor.Descriptor( - name='Message', - full_name='protos.Message', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.Message.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.Message.timestamp', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.Message.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='signature', full_name='protos.Message.signature', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _MESSAGE_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1536, - serialized_end=1994, -) - - -_RESPONSE = _descriptor.Descriptor( - name='Response', - full_name='protos.Response', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='protos.Response.status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='msg', full_name='protos.Response.msg', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _RESPONSE_STATUSCODE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1996, - serialized_end=2121, -) - - -_BLOCKSTATE = _descriptor.Descriptor( - name='BlockState', - full_name='protos.BlockState', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='block', full_name='protos.BlockState.block', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='stateDelta', full_name='protos.BlockState.stateDelta', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2123, - serialized_end=2185, -) - - -_SYNCBLOCKRANGE = _descriptor.Descriptor( - name='SyncBlockRange', - full_name='protos.SyncBlockRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='start', full_name='protos.SyncBlockRange.start', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='end', full_name='protos.SyncBlockRange.end', index=1, - number=2, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2187, - serialized_end=2231, -) - - -_SYNCBLOCKS = _descriptor.Descriptor( - name='SyncBlocks', - full_name='protos.SyncBlocks', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='range', full_name='protos.SyncBlocks.range', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='blocks', full_name='protos.SyncBlocks.blocks', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2233, - serialized_end=2315, -) - - -_SYNCSTATESNAPSHOTREQUEST = _descriptor.Descriptor( - name='SyncStateSnapshotRequest', - full_name='protos.SyncStateSnapshotRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='correlationId', full_name='protos.SyncStateSnapshotRequest.correlationId', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2317, - serialized_end=2366, -) - - -_SYNCSTATESNAPSHOT = _descriptor.Descriptor( - name='SyncStateSnapshot', - full_name='protos.SyncStateSnapshot', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='delta', full_name='protos.SyncStateSnapshot.delta', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='sequence', full_name='protos.SyncStateSnapshot.sequence', index=1, - number=2, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='blockNumber', full_name='protos.SyncStateSnapshot.blockNumber', index=2, - number=3, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='request', full_name='protos.SyncStateSnapshot.request', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2368, - serialized_end=2492, -) - - -_SYNCSTATEDELTASREQUEST = _descriptor.Descriptor( - name='SyncStateDeltasRequest', - full_name='protos.SyncStateDeltasRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='range', full_name='protos.SyncStateDeltasRequest.range', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2494, - serialized_end=2557, -) - - -_SYNCSTATEDELTAS = _descriptor.Descriptor( - name='SyncStateDeltas', - full_name='protos.SyncStateDeltas', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='range', full_name='protos.SyncStateDeltas.range', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='deltas', full_name='protos.SyncStateDeltas.deltas', index=1, - number=2, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2559, - serialized_end=2631, -) - -_TRANSACTION.fields_by_name['type'].enum_type = _TRANSACTION_TYPE -_TRANSACTION.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TRANSACTION.fields_by_name['confidentialityLevel'].enum_type = chaincode__pb2._CONFIDENTIALITYLEVEL -_TRANSACTION_TYPE.containing_type = _TRANSACTION -_TRANSACTIONBLOCK.fields_by_name['transactions'].message_type = _TRANSACTION -_BLOCK.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BLOCK.fields_by_name['transactions'].message_type = _TRANSACTION -_BLOCK.fields_by_name['nonHashData'].message_type = _NONHASHDATA -_NONHASHDATA.fields_by_name['localLedgerCommitTimestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_NONHASHDATA.fields_by_name['transactionResults'].message_type = _TRANSACTIONRESULT -_PEERENDPOINT.fields_by_name['ID'].message_type = _PEERID -_PEERENDPOINT.fields_by_name['type'].enum_type = _PEERENDPOINT_TYPE -_PEERENDPOINT_TYPE.containing_type = _PEERENDPOINT -_PEERSMESSAGE.fields_by_name['peers'].message_type = _PEERENDPOINT -_HELLOMESSAGE.fields_by_name['peerEndpoint'].message_type = _PEERENDPOINT -_HELLOMESSAGE.fields_by_name['blockchainInfo'].message_type = _BLOCKCHAININFO -_MESSAGE.fields_by_name['type'].enum_type = _MESSAGE_TYPE -_MESSAGE.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_MESSAGE_TYPE.containing_type = _MESSAGE -_RESPONSE.fields_by_name['status'].enum_type = _RESPONSE_STATUSCODE -_RESPONSE_STATUSCODE.containing_type = _RESPONSE -_BLOCKSTATE.fields_by_name['block'].message_type = _BLOCK -_SYNCBLOCKS.fields_by_name['range'].message_type = _SYNCBLOCKRANGE -_SYNCBLOCKS.fields_by_name['blocks'].message_type = _BLOCK -_SYNCSTATESNAPSHOT.fields_by_name['request'].message_type = _SYNCSTATESNAPSHOTREQUEST -_SYNCSTATEDELTASREQUEST.fields_by_name['range'].message_type = _SYNCBLOCKRANGE -_SYNCSTATEDELTAS.fields_by_name['range'].message_type = _SYNCBLOCKRANGE -DESCRIPTOR.message_types_by_name['Transaction'] = _TRANSACTION -DESCRIPTOR.message_types_by_name['TransactionBlock'] = _TRANSACTIONBLOCK -DESCRIPTOR.message_types_by_name['TransactionResult'] = _TRANSACTIONRESULT -DESCRIPTOR.message_types_by_name['Block'] = _BLOCK -DESCRIPTOR.message_types_by_name['BlockchainInfo'] = _BLOCKCHAININFO -DESCRIPTOR.message_types_by_name['NonHashData'] = _NONHASHDATA -DESCRIPTOR.message_types_by_name['PeerAddress'] = _PEERADDRESS -DESCRIPTOR.message_types_by_name['PeerID'] = _PEERID -DESCRIPTOR.message_types_by_name['PeerEndpoint'] = _PEERENDPOINT -DESCRIPTOR.message_types_by_name['PeersMessage'] = _PEERSMESSAGE -DESCRIPTOR.message_types_by_name['HelloMessage'] = _HELLOMESSAGE -DESCRIPTOR.message_types_by_name['Message'] = _MESSAGE -DESCRIPTOR.message_types_by_name['Response'] = _RESPONSE -DESCRIPTOR.message_types_by_name['BlockState'] = _BLOCKSTATE -DESCRIPTOR.message_types_by_name['SyncBlockRange'] = _SYNCBLOCKRANGE -DESCRIPTOR.message_types_by_name['SyncBlocks'] = _SYNCBLOCKS -DESCRIPTOR.message_types_by_name['SyncStateSnapshotRequest'] = _SYNCSTATESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name['SyncStateSnapshot'] = _SYNCSTATESNAPSHOT -DESCRIPTOR.message_types_by_name['SyncStateDeltasRequest'] = _SYNCSTATEDELTASREQUEST -DESCRIPTOR.message_types_by_name['SyncStateDeltas'] = _SYNCSTATEDELTAS - -Transaction = _reflection.GeneratedProtocolMessageType('Transaction', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTION, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.Transaction) - )) -_sym_db.RegisterMessage(Transaction) - -TransactionBlock = _reflection.GeneratedProtocolMessageType('TransactionBlock', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTIONBLOCK, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.TransactionBlock) - )) -_sym_db.RegisterMessage(TransactionBlock) - -TransactionResult = _reflection.GeneratedProtocolMessageType('TransactionResult', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTIONRESULT, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.TransactionResult) - )) -_sym_db.RegisterMessage(TransactionResult) - -Block = _reflection.GeneratedProtocolMessageType('Block', (_message.Message,), dict( - DESCRIPTOR = _BLOCK, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.Block) - )) -_sym_db.RegisterMessage(Block) - -BlockchainInfo = _reflection.GeneratedProtocolMessageType('BlockchainInfo', (_message.Message,), dict( - DESCRIPTOR = _BLOCKCHAININFO, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.BlockchainInfo) - )) -_sym_db.RegisterMessage(BlockchainInfo) - -NonHashData = _reflection.GeneratedProtocolMessageType('NonHashData', (_message.Message,), dict( - DESCRIPTOR = _NONHASHDATA, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.NonHashData) - )) -_sym_db.RegisterMessage(NonHashData) - -PeerAddress = _reflection.GeneratedProtocolMessageType('PeerAddress', (_message.Message,), dict( - DESCRIPTOR = _PEERADDRESS, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.PeerAddress) - )) -_sym_db.RegisterMessage(PeerAddress) - -PeerID = _reflection.GeneratedProtocolMessageType('PeerID', (_message.Message,), dict( - DESCRIPTOR = _PEERID, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.PeerID) - )) -_sym_db.RegisterMessage(PeerID) - -PeerEndpoint = _reflection.GeneratedProtocolMessageType('PeerEndpoint', (_message.Message,), dict( - DESCRIPTOR = _PEERENDPOINT, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.PeerEndpoint) - )) -_sym_db.RegisterMessage(PeerEndpoint) - -PeersMessage = _reflection.GeneratedProtocolMessageType('PeersMessage', (_message.Message,), dict( - DESCRIPTOR = _PEERSMESSAGE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.PeersMessage) - )) -_sym_db.RegisterMessage(PeersMessage) - -HelloMessage = _reflection.GeneratedProtocolMessageType('HelloMessage', (_message.Message,), dict( - DESCRIPTOR = _HELLOMESSAGE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.HelloMessage) - )) -_sym_db.RegisterMessage(HelloMessage) - -Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict( - DESCRIPTOR = _MESSAGE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.Message) - )) -_sym_db.RegisterMessage(Message) - -Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), dict( - DESCRIPTOR = _RESPONSE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.Response) - )) -_sym_db.RegisterMessage(Response) - -BlockState = _reflection.GeneratedProtocolMessageType('BlockState', (_message.Message,), dict( - DESCRIPTOR = _BLOCKSTATE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.BlockState) - )) -_sym_db.RegisterMessage(BlockState) - -SyncBlockRange = _reflection.GeneratedProtocolMessageType('SyncBlockRange', (_message.Message,), dict( - DESCRIPTOR = _SYNCBLOCKRANGE, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncBlockRange) - )) -_sym_db.RegisterMessage(SyncBlockRange) - -SyncBlocks = _reflection.GeneratedProtocolMessageType('SyncBlocks', (_message.Message,), dict( - DESCRIPTOR = _SYNCBLOCKS, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncBlocks) - )) -_sym_db.RegisterMessage(SyncBlocks) - -SyncStateSnapshotRequest = _reflection.GeneratedProtocolMessageType('SyncStateSnapshotRequest', (_message.Message,), dict( - DESCRIPTOR = _SYNCSTATESNAPSHOTREQUEST, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncStateSnapshotRequest) - )) -_sym_db.RegisterMessage(SyncStateSnapshotRequest) - -SyncStateSnapshot = _reflection.GeneratedProtocolMessageType('SyncStateSnapshot', (_message.Message,), dict( - DESCRIPTOR = _SYNCSTATESNAPSHOT, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncStateSnapshot) - )) -_sym_db.RegisterMessage(SyncStateSnapshot) - -SyncStateDeltasRequest = _reflection.GeneratedProtocolMessageType('SyncStateDeltasRequest', (_message.Message,), dict( - DESCRIPTOR = _SYNCSTATEDELTASREQUEST, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncStateDeltasRequest) - )) -_sym_db.RegisterMessage(SyncStateDeltasRequest) - -SyncStateDeltas = _reflection.GeneratedProtocolMessageType('SyncStateDeltas', (_message.Message,), dict( - DESCRIPTOR = _SYNCSTATEDELTAS, - __module__ = 'fabric_pb2' - # @@protoc_insertion_point(class_scope:protos.SyncStateDeltas) - )) -_sym_db.RegisterMessage(SyncStateDeltas) - - -import abc -import six -from grpc.beta import implementations as beta_implementations -from grpc.beta import interfaces as beta_interfaces -from grpc.framework.common import cardinality -from grpc.framework.interfaces.face import utilities as face_utilities - -class BetaPeerServicer(object): - """Interface exported by the server. - """ - def Chat(self, request_iterator, context): - """Accepts a stream of Message during chat session, while receiving - other Message (e.g. from other peers). - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ProcessTransaction(self, request, context): - """Process a transaction from a remote source. - """ - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - -class BetaPeerStub(object): - """Interface exported by the server. - """ - def Chat(self, request_iterator, timeout): - """Accepts a stream of Message during chat session, while receiving - other Message (e.g. from other peers). - """ - raise NotImplementedError() - def ProcessTransaction(self, request, timeout): - """Process a transaction from a remote source. - """ - raise NotImplementedError() - ProcessTransaction.future = None - -def beta_create_Peer_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - import fabric_pb2 - import fabric_pb2 - import fabric_pb2 - import fabric_pb2 - request_deserializers = { - ('protos.Peer', 'Chat'): fabric_pb2.Message.FromString, - ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Transaction.FromString, - } - response_serializers = { - ('protos.Peer', 'Chat'): fabric_pb2.Message.SerializeToString, - ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Response.SerializeToString, - } - method_implementations = { - ('protos.Peer', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat), - ('protos.Peer', 'ProcessTransaction'): face_utilities.unary_unary_inline(servicer.ProcessTransaction), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - -def beta_create_Peer_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - import fabric_pb2 - import fabric_pb2 - import fabric_pb2 - import fabric_pb2 - request_serializers = { - ('protos.Peer', 'Chat'): fabric_pb2.Message.SerializeToString, - ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Transaction.SerializeToString, - } - response_deserializers = { - ('protos.Peer', 'Chat'): fabric_pb2.Message.FromString, - ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Response.FromString, - } - cardinalities = { - 'Chat': cardinality.Cardinality.STREAM_STREAM, - 'ProcessTransaction': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.Peer', cardinalities, options=stub_options) -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/features/bootstrap.feature b/bddtests/features/bootstrap.feature index 9392ebb4a16..da3d190413a 100644 --- a/bddtests/features/bootstrap.feature +++ b/bddtests/features/bootstrap.feature @@ -80,6 +80,7 @@ Feature: Bootstrap And the following application developers are defined for peer organizations and each saves their cert as alias | Developer | ChainCreationPolicyName | Organization | AliasSavedUnder | | dev0Org0 | chainCreatePolicy1 | peerOrg0 | dev0Org0App1 | + | dev0Org1 | chainCreatePolicy1 | peerOrg1 | dev0Org1App1 | # Need Consortium MSP info and # need to add the ChannelWriters ConfigItem (using ChannelWriters ref name), @@ -120,61 +121,139 @@ Feature: Bootstrap | com.acme.blockchain.jdoe.Channel1 | 0 | 0 | Then user "dev0Org0" should get a delivery "genesisBlockForMyNewChannel" from "orderer0" of "1" blocks with "1" messages within "1" seconds + Given user "dev0Org0" gives "genesisBlockForMyNewChannel" to user "dev0Org1" # This is entry point for joining an existing channel When user "dev0Org0" using cert alias "dev0Org0App1" requests to join channel using genesis block "genesisBlockForMyNewChannel" on peers with result "joinChannelResult" | Peer | | peer0 | - | peer2 | - Then user "dev0Org0" expects result code for "joinChannelResult" of "200" from peers: | Peer | | peer0 | - | peer2 | + + # This is entry point for joining an existing channel + When user "dev0Org1" using cert alias "dev0Org1App1" requests to join channel using genesis block "genesisBlockForMyNewChannel" on peers with result "joinChannelResult" + | Peer | + | peer2 | + + Then user "dev0Org1" expects result code for "joinChannelResult" of "200" from peers: + | Peer | + | peer2 | # Entry point for invoking on an existing channel When user "dev0Org0" creates a chaincode spec "cc_spec" with name "example02" of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with args | funcName | arg1 | arg2 | arg3 | arg4 | | init | a | 100 | b | 200 | - #And user "binhn" creates a deployment spec "cc_deploy_spec" using chaincode spec "cc_spec" and devops on peer "vp0" - #And user "binhn" creates a deployment proposal "proposal1" using chaincode deployment spec "cc_deploy_spec" + # Under the covers, create a deployment spec, etc. + And user "dev0Org0" using cert alias "dev0Org0App1" creates a install proposal "installProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec" + + And user "dev0Org0" sends proposal "installProposal1" to endorsers with timeout of "30" seconds with proposal responses "installProposalResponses": + | Endorser | + | peer0 | + | peer2 | + + Then user "dev0Org0" expects proposal responses "installProposalResponses" with status "200" from endorsers: + | Endorser | + | peer0 | + | peer2 | # Under the covers, create a deployment spec, etc. - And user "dev0Org0" using cert alias "dev0Org0App1" creates a deployment proposal "proposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec" + When user "dev0Org0" using cert alias "dev0Org0App1" creates a instantiate proposal "instantiateProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "cc_spec" - And user "dev0Org0" sends proposal "proposal1" to endorsers with timeout of "30" seconds with proposal responses "deploymentProposalResponses": + And user "dev0Org0" sends proposal "instantiateProposal1" to endorsers with timeout of "30" seconds with proposal responses "instantiateProposalResponses": | Endorser | | peer0 | | peer2 | - Then user "dev0Org0" expects proposal responses "deploymentProposalResponses" with status "200" from endorsers: + Then user "dev0Org0" expects proposal responses "instantiateProposalResponses" with status "200" from endorsers: | Endorser | | peer0 | | peer2 | - And user "dev0Org0" expects proposal responses "deploymentProposalResponses" each have the same value from endorsers: + And user "dev0Org0" expects proposal responses "instantiateProposalResponses" each have the same value from endorsers: | Endorser | | peer0 | | peer2 | - When user "dev0Org0" creates a transaction "deploymentTransaction1" from proposal responses "deploymentProposalResponses" + When the user "dev0Org0" creates transaction "instantiateTx1" from proposal "instantiateProposal1" and proposal responses "instantiateProposalResponses" for channel "com.acme.blockchain.jdoe.Channel1" - And the user "dev0Org0" broadcasts transaction "deploymentTransaction1" on channel "com.acme.blockchain.jdoe.Channel1" to orderer "orderer0" + And the user "dev0Org0" broadcasts transaction "instantiateTx1" to orderer "orderer0" on channel "com.acme.blockchain.jdoe.Channel1" - # Sleep as the deliver takes a bit + # Sleep as the deliver takes a bit to have the first block ready And I wait "2" seconds - When user "dev0Org0" connects to deliver function on orderer "orderer0" And user "dev0Org0" sends deliver a seek request on orderer "orderer0" with properties: - | ChainId | Start | End | - | com.acme.blockchain.jdoe.Channel1 | 1 | 1 | + | ChainId | Start | End | + | com.acme.blockchain.jdoe.Channel1 | 1 | 1 | + + Then user "dev0Org0" should get a delivery "deliveredInstantiateTx1Block" from "orderer0" of "1" blocks with "1" messages within "1" seconds + + # Sleep as the deliver takes a bit to have the first block ready + And I wait "1" seconds + + + # Entry point for invoking on an existing channel + When user "dev0Org0" creates a chaincode invocation spec "querySpec1" using spec "cc_spec" with input: + | funcName | arg1 | + | query | a | + + # Under the covers, create a deployment spec, etc. + And user "dev0Org0" using cert alias "dev0Org0App1" creates a proposal "queryProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "querySpec1" + + And user "dev0Org0" sends proposal "queryProposal1" to endorsers with timeout of "30" seconds with proposal responses "queryProposal1Responses": + | Endorser | + | peer0 | + | peer2 | + + Then user "dev0Org0" expects proposal responses "queryProposal1Responses" with status "200" from endorsers: + | Endorser | + | peer0 | + | peer2 | + + And user "dev0Org0" expects proposal responses "queryProposal1Responses" each have the same value from endorsers: + | Endorser | + | peer0 | + | peer2 | + + + # Entry point for invoking on an existing channel + When user "dev0Org0" creates a chaincode invocation spec "invocationSpec1" using spec "cc_spec" with input: + | funcName | arg1 | arg2 | arg3 | + | invoke | a | b | 10 | + + # Under the covers, create a deployment spec, etc. + And user "dev0Org0" using cert alias "dev0Org0App1" creates a proposal "invokeProposal1" for channel "com.acme.blockchain.jdoe.Channel1" using chaincode spec "invocationSpec1" + + And user "dev0Org0" sends proposal "invokeProposal1" to endorsers with timeout of "30" seconds with proposal responses "invokeProposal1Responses": + | Endorser | + | peer0 | + | peer2 | + + Then user "dev0Org0" expects proposal responses "invokeProposal1Responses" with status "200" from endorsers: + | Endorser | + | peer0 | + | peer2 | + + And user "dev0Org0" expects proposal responses "invokeProposal1Responses" each have the same value from endorsers: + | Endorser | + | peer0 | + | peer2 | + + When the user "dev0Org0" creates transaction "invokeTx1" from proposal "invokeProposal1" and proposal responses "invokeProposal1Responses" for channel "com.acme.blockchain.jdoe.Channel1" + + And the user "dev0Org0" broadcasts transaction "invokeTx1" to orderer "orderer0" on channel "com.acme.blockchain.jdoe.Channel1" + + # Sleep as the deliver takes a bit to have the first block ready + And I wait "2" seconds - Then user "dev0Org0" should get a delivery "deploymentTransaction11Block" from "orderer0" of "1" blocks with "1" messages within "1" seconds + And user "dev0Org0" sends deliver a seek request on orderer "orderer0" with properties: + | ChainId | Start | End | + | com.acme.blockchain.jdoe.Channel1 | 2 | 2 | - # TODO: Add a peer query stanza here + Then user "dev0Org0" should get a delivery "deliveredInvokeTx1Block" from "orderer0" of "1" blocks with "1" messages within "1" seconds # TODO: Once events are working, consider listen event listener as well. diff --git a/bddtests/gossip/message_pb2.py b/bddtests/gossip/message_pb2.py new file mode 100644 index 00000000000..52e69f1a981 --- /dev/null +++ b/bddtests/gossip/message_pb2.py @@ -0,0 +1,1561 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: gossip/message.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='gossip/message.proto', + package='gossip', + syntax='proto3', + serialized_pb=_b('\n\x14gossip/message.proto\x12\x06gossip\"9\n\x13SignedGossipMessage\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xcb\x07\n\rGossipMessage\x12\r\n\x05nonce\x18\x01 \x01(\x04\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\x0c\x12&\n\x03tag\x18\x03 \x01(\x0e\x32\x19.gossip.GossipMessage.Tag\x12\x11\n\tsignature\x18\x04 \x01(\x0c\x12(\n\x08\x61liveMsg\x18\x05 \x01(\x0b\x32\x14.gossip.AliveMessageH\x00\x12+\n\x06memReq\x18\x06 \x01(\x0b\x32\x19.gossip.MembershipRequestH\x00\x12,\n\x06memRes\x18\x07 \x01(\x0b\x32\x1a.gossip.MembershipResponseH\x00\x12&\n\x07\x64\x61taMsg\x18\x08 \x01(\x0b\x32\x13.gossip.DataMessageH\x00\x12$\n\x05hello\x18\t \x01(\x0b\x32\x13.gossip.GossipHelloH\x00\x12%\n\x07\x64\x61taDig\x18\n \x01(\x0b\x32\x12.gossip.DataDigestH\x00\x12&\n\x07\x64\x61taReq\x18\x0b \x01(\x0b\x32\x13.gossip.DataRequestH\x00\x12(\n\ndataUpdate\x18\x0c \x01(\x0b\x32\x12.gossip.DataUpdateH\x00\x12\x1e\n\x05\x65mpty\x18\r \x01(\x0b\x32\r.gossip.EmptyH\x00\x12%\n\x04\x63onn\x18\x0e \x01(\x0b\x32\x15.gossip.ConnEstablishH\x00\x12&\n\tstateInfo\x18\x0f \x01(\x0b\x32\x11.gossip.StateInfoH\x00\x12\x32\n\rstateSnapshot\x18\x10 \x01(\x0b\x32\x19.gossip.StateInfoSnapshotH\x00\x12\x38\n\x10stateInfoPullReq\x18\x11 \x01(\x0b\x32\x1c.gossip.StateInfoPullRequestH\x00\x12\x32\n\x0cstateRequest\x18\x12 \x01(\x0b\x32\x1a.gossip.RemoteStateRequestH\x00\x12\x34\n\rstateResponse\x18\x13 \x01(\x0b\x32\x1b.gossip.RemoteStateResponseH\x00\x12\x32\n\rleadershipMsg\x18\x14 \x01(\x0b\x32\x19.gossip.LeadershipMessageH\x00\x12,\n\x0cpeerIdentity\x18\x15 \x01(\x0b\x32\x14.gossip.PeerIdentityH\x00\"_\n\x03Tag\x12\r\n\tUNDEFINED\x10\x00\x12\t\n\x05\x45MPTY\x10\x01\x12\x0c\n\x08ORG_ONLY\x10\x02\x12\r\n\tCHAN_ONLY\x10\x03\x12\x10\n\x0c\x43HAN_AND_ORG\x10\x04\x12\x0f\n\x0b\x43HAN_OR_ORG\x10\x05\x42\t\n\x07\x63ontent\"Q\n\tStateInfo\x12\x10\n\x08metadata\x18\x01 \x01(\x0c\x12#\n\ttimestamp\x18\x02 \x01(\x0b\x32\x10.gossip.PeerTime\x12\r\n\x05pkiID\x18\x03 \x01(\x0c\"<\n\x11StateInfoSnapshot\x12\'\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x15.gossip.GossipMessage\"\x16\n\x14StateInfoPullRequest\":\n\rConnEstablish\x12\r\n\x05pkiID\x18\x01 \x01(\x0c\x12\x0c\n\x04\x63\x65rt\x18\x02 \x01(\x0c\x12\x0c\n\x04hash\x18\x03 \x01(\x0c\"=\n\x0cPeerIdentity\x12\r\n\x05pkiID\x18\x01 \x01(\x0c\x12\x0c\n\x04\x63\x65rt\x18\x02 \x01(\x0c\x12\x10\n\x08metadata\x18\x03 \x01(\x0c\"S\n\x0b\x44\x61taRequest\x12\r\n\x05nonce\x18\x01 \x01(\x04\x12\x0f\n\x07\x64igests\x18\x02 \x03(\t\x12$\n\x07msgType\x18\x03 \x01(\x0e\x32\x13.gossip.PullMsgType\"T\n\x0bGossipHello\x12\r\n\x05nonce\x18\x01 \x01(\x04\x12\x10\n\x08metadata\x18\x02 \x01(\x0c\x12$\n\x07msgType\x18\x03 \x01(\x0e\x32\x13.gossip.PullMsgType\"f\n\nDataUpdate\x12\r\n\x05nonce\x18\x01 \x01(\x04\x12#\n\x04\x64\x61ta\x18\x02 \x03(\x0b\x32\x15.gossip.GossipMessage\x12$\n\x07msgType\x18\x03 \x01(\x0e\x32\x13.gossip.PullMsgType\"R\n\nDataDigest\x12\r\n\x05nonce\x18\x01 \x01(\x04\x12\x0f\n\x07\x64igests\x18\x02 \x03(\t\x12$\n\x07msgType\x18\x03 \x01(\x0e\x32\x13.gossip.PullMsgType\"/\n\x0b\x44\x61taMessage\x12 \n\x07payload\x18\x01 \x01(\x0b\x32\x0f.gossip.Payload\"5\n\x07Payload\x12\x0e\n\x06seqNum\x18\x01 \x01(\x04\x12\x0c\n\x04hash\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"i\n\x0c\x41liveMessage\x12\"\n\nmembership\x18\x01 \x01(\x0b\x32\x0e.gossip.Member\x12#\n\ttimestamp\x18\x02 \x01(\x0b\x32\x10.gossip.PeerTime\x12\x10\n\x08identity\x18\x04 \x01(\x0c\"^\n\x11LeadershipMessage\x12\r\n\x05pkiID\x18\x01 \x01(\x0c\x12#\n\ttimestamp\x18\x02 \x01(\x0b\x32\x10.gossip.PeerTime\x12\x15\n\risDeclaration\x18\x03 \x01(\x08\".\n\x08PeerTime\x12\x12\n\ninc_number\x18\x01 \x01(\x04\x12\x0e\n\x06seqNum\x18\x02 \x01(\x04\"R\n\x11MembershipRequest\x12.\n\x0fselfInformation\x18\x01 \x01(\x0b\x32\x15.gossip.GossipMessage\x12\r\n\x05known\x18\x02 \x03(\x0c\"_\n\x12MembershipResponse\x12$\n\x05\x61live\x18\x01 \x03(\x0b\x32\x15.gossip.GossipMessage\x12#\n\x04\x64\x65\x61\x64\x18\x02 \x03(\x0b\x32\x15.gossip.GossipMessage\"m\n\x06Member\x12\x10\n\x08\x65ndpoint\x18\x01 \x01(\t\x12\x10\n\x08metadata\x18\x02 \x01(\x0c\x12\r\n\x05pkiID\x18\x03 \x01(\x0c\x12\x30\n\x10internalEndpoint\x18\x04 \x01(\x0b\x32\x16.gossip.SignedEndpoint\"5\n\x0eSignedEndpoint\x12\x10\n\x08\x65ndpoint\x18\x01 \x01(\t\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\x07\n\x05\x45mpty\"%\n\x12RemoteStateRequest\x12\x0f\n\x07seqNums\x18\x01 \x03(\x04\"8\n\x13RemoteStateResponse\x12!\n\x08payloads\x18\x01 \x03(\x0b\x32\x0f.gossip.Payload*?\n\x0bPullMsgType\x12\r\n\tUndefined\x10\x00\x12\x10\n\x0c\x42lockMessage\x10\x01\x12\x0f\n\x0bIdentityMsg\x10\x02\x32t\n\x06Gossip\x12\x42\n\x0cGossipStream\x12\x15.gossip.GossipMessage\x1a\x15.gossip.GossipMessage\"\x00(\x01\x30\x01\x12&\n\x04Ping\x12\r.gossip.Empty\x1a\r.gossip.Empty\"\x00\x42-Z+github.com/hyperledger/fabric/protos/gossipb\x06proto3') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_PULLMSGTYPE = _descriptor.EnumDescriptor( + name='PullMsgType', + full_name='gossip.PullMsgType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='Undefined', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BlockMessage', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IdentityMsg', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2524, + serialized_end=2587, +) +_sym_db.RegisterEnumDescriptor(_PULLMSGTYPE) + +PullMsgType = enum_type_wrapper.EnumTypeWrapper(_PULLMSGTYPE) +Undefined = 0 +BlockMessage = 1 +IdentityMsg = 2 + + +_GOSSIPMESSAGE_TAG = _descriptor.EnumDescriptor( + name='Tag', + full_name='gossip.GossipMessage.Tag', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNDEFINED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EMPTY', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ORG_ONLY', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CHAN_ONLY', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CHAN_AND_ORG', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CHAN_OR_ORG', index=5, number=5, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=957, + serialized_end=1052, +) +_sym_db.RegisterEnumDescriptor(_GOSSIPMESSAGE_TAG) + + +_SIGNEDGOSSIPMESSAGE = _descriptor.Descriptor( + name='SignedGossipMessage', + full_name='gossip.SignedGossipMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='payload', full_name='gossip.SignedGossipMessage.payload', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='signature', full_name='gossip.SignedGossipMessage.signature', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=32, + serialized_end=89, +) + + +_GOSSIPMESSAGE = _descriptor.Descriptor( + name='GossipMessage', + full_name='gossip.GossipMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nonce', full_name='gossip.GossipMessage.nonce', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='channel', full_name='gossip.GossipMessage.channel', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='tag', full_name='gossip.GossipMessage.tag', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='signature', full_name='gossip.GossipMessage.signature', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='aliveMsg', full_name='gossip.GossipMessage.aliveMsg', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='memReq', full_name='gossip.GossipMessage.memReq', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='memRes', full_name='gossip.GossipMessage.memRes', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='dataMsg', full_name='gossip.GossipMessage.dataMsg', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='hello', full_name='gossip.GossipMessage.hello', index=8, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='dataDig', full_name='gossip.GossipMessage.dataDig', index=9, + number=10, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='dataReq', full_name='gossip.GossipMessage.dataReq', index=10, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='dataUpdate', full_name='gossip.GossipMessage.dataUpdate', index=11, + number=12, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='empty', full_name='gossip.GossipMessage.empty', index=12, + number=13, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='conn', full_name='gossip.GossipMessage.conn', index=13, + number=14, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stateInfo', full_name='gossip.GossipMessage.stateInfo', index=14, + number=15, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stateSnapshot', full_name='gossip.GossipMessage.stateSnapshot', index=15, + number=16, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stateInfoPullReq', full_name='gossip.GossipMessage.stateInfoPullReq', index=16, + number=17, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stateRequest', full_name='gossip.GossipMessage.stateRequest', index=17, + number=18, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='stateResponse', full_name='gossip.GossipMessage.stateResponse', index=18, + number=19, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='leadershipMsg', full_name='gossip.GossipMessage.leadershipMsg', index=19, + number=20, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='peerIdentity', full_name='gossip.GossipMessage.peerIdentity', index=20, + number=21, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _GOSSIPMESSAGE_TAG, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='content', full_name='gossip.GossipMessage.content', + index=0, containing_type=None, fields=[]), + ], + serialized_start=92, + serialized_end=1063, +) + + +_STATEINFO = _descriptor.Descriptor( + name='StateInfo', + full_name='gossip.StateInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='metadata', full_name='gossip.StateInfo.metadata', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='timestamp', full_name='gossip.StateInfo.timestamp', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='pkiID', full_name='gossip.StateInfo.pkiID', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1065, + serialized_end=1146, +) + + +_STATEINFOSNAPSHOT = _descriptor.Descriptor( + name='StateInfoSnapshot', + full_name='gossip.StateInfoSnapshot', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='elements', full_name='gossip.StateInfoSnapshot.elements', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1148, + serialized_end=1208, +) + + +_STATEINFOPULLREQUEST = _descriptor.Descriptor( + name='StateInfoPullRequest', + full_name='gossip.StateInfoPullRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1210, + serialized_end=1232, +) + + +_CONNESTABLISH = _descriptor.Descriptor( + name='ConnEstablish', + full_name='gossip.ConnEstablish', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='pkiID', full_name='gossip.ConnEstablish.pkiID', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='cert', full_name='gossip.ConnEstablish.cert', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='hash', full_name='gossip.ConnEstablish.hash', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1234, + serialized_end=1292, +) + + +_PEERIDENTITY = _descriptor.Descriptor( + name='PeerIdentity', + full_name='gossip.PeerIdentity', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='pkiID', full_name='gossip.PeerIdentity.pkiID', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='cert', full_name='gossip.PeerIdentity.cert', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='metadata', full_name='gossip.PeerIdentity.metadata', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1294, + serialized_end=1355, +) + + +_DATAREQUEST = _descriptor.Descriptor( + name='DataRequest', + full_name='gossip.DataRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nonce', full_name='gossip.DataRequest.nonce', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='digests', full_name='gossip.DataRequest.digests', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msgType', full_name='gossip.DataRequest.msgType', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1357, + serialized_end=1440, +) + + +_GOSSIPHELLO = _descriptor.Descriptor( + name='GossipHello', + full_name='gossip.GossipHello', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nonce', full_name='gossip.GossipHello.nonce', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='metadata', full_name='gossip.GossipHello.metadata', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msgType', full_name='gossip.GossipHello.msgType', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1442, + serialized_end=1526, +) + + +_DATAUPDATE = _descriptor.Descriptor( + name='DataUpdate', + full_name='gossip.DataUpdate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nonce', full_name='gossip.DataUpdate.nonce', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data', full_name='gossip.DataUpdate.data', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msgType', full_name='gossip.DataUpdate.msgType', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1528, + serialized_end=1630, +) + + +_DATADIGEST = _descriptor.Descriptor( + name='DataDigest', + full_name='gossip.DataDigest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nonce', full_name='gossip.DataDigest.nonce', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='digests', full_name='gossip.DataDigest.digests', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='msgType', full_name='gossip.DataDigest.msgType', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1632, + serialized_end=1714, +) + + +_DATAMESSAGE = _descriptor.Descriptor( + name='DataMessage', + full_name='gossip.DataMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='payload', full_name='gossip.DataMessage.payload', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1716, + serialized_end=1763, +) + + +_PAYLOAD = _descriptor.Descriptor( + name='Payload', + full_name='gossip.Payload', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='seqNum', full_name='gossip.Payload.seqNum', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='hash', full_name='gossip.Payload.hash', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='data', full_name='gossip.Payload.data', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1765, + serialized_end=1818, +) + + +_ALIVEMESSAGE = _descriptor.Descriptor( + name='AliveMessage', + full_name='gossip.AliveMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='membership', full_name='gossip.AliveMessage.membership', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='timestamp', full_name='gossip.AliveMessage.timestamp', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='identity', full_name='gossip.AliveMessage.identity', index=2, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1820, + serialized_end=1925, +) + + +_LEADERSHIPMESSAGE = _descriptor.Descriptor( + name='LeadershipMessage', + full_name='gossip.LeadershipMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='pkiID', full_name='gossip.LeadershipMessage.pkiID', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='timestamp', full_name='gossip.LeadershipMessage.timestamp', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='isDeclaration', full_name='gossip.LeadershipMessage.isDeclaration', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1927, + serialized_end=2021, +) + + +_PEERTIME = _descriptor.Descriptor( + name='PeerTime', + full_name='gossip.PeerTime', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='inc_number', full_name='gossip.PeerTime.inc_number', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='seqNum', full_name='gossip.PeerTime.seqNum', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2023, + serialized_end=2069, +) + + +_MEMBERSHIPREQUEST = _descriptor.Descriptor( + name='MembershipRequest', + full_name='gossip.MembershipRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='selfInformation', full_name='gossip.MembershipRequest.selfInformation', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='known', full_name='gossip.MembershipRequest.known', index=1, + number=2, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2071, + serialized_end=2153, +) + + +_MEMBERSHIPRESPONSE = _descriptor.Descriptor( + name='MembershipResponse', + full_name='gossip.MembershipResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='alive', full_name='gossip.MembershipResponse.alive', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='dead', full_name='gossip.MembershipResponse.dead', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2155, + serialized_end=2250, +) + + +_MEMBER = _descriptor.Descriptor( + name='Member', + full_name='gossip.Member', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint', full_name='gossip.Member.endpoint', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='metadata', full_name='gossip.Member.metadata', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='pkiID', full_name='gossip.Member.pkiID', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='internalEndpoint', full_name='gossip.Member.internalEndpoint', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2252, + serialized_end=2361, +) + + +_SIGNEDENDPOINT = _descriptor.Descriptor( + name='SignedEndpoint', + full_name='gossip.SignedEndpoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint', full_name='gossip.SignedEndpoint.endpoint', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='signature', full_name='gossip.SignedEndpoint.signature', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2363, + serialized_end=2416, +) + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='gossip.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2418, + serialized_end=2425, +) + + +_REMOTESTATEREQUEST = _descriptor.Descriptor( + name='RemoteStateRequest', + full_name='gossip.RemoteStateRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='seqNums', full_name='gossip.RemoteStateRequest.seqNums', index=0, + number=1, type=4, cpp_type=4, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2427, + serialized_end=2464, +) + + +_REMOTESTATERESPONSE = _descriptor.Descriptor( + name='RemoteStateResponse', + full_name='gossip.RemoteStateResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='payloads', full_name='gossip.RemoteStateResponse.payloads', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2522, +) + +_GOSSIPMESSAGE.fields_by_name['tag'].enum_type = _GOSSIPMESSAGE_TAG +_GOSSIPMESSAGE.fields_by_name['aliveMsg'].message_type = _ALIVEMESSAGE +_GOSSIPMESSAGE.fields_by_name['memReq'].message_type = _MEMBERSHIPREQUEST +_GOSSIPMESSAGE.fields_by_name['memRes'].message_type = _MEMBERSHIPRESPONSE +_GOSSIPMESSAGE.fields_by_name['dataMsg'].message_type = _DATAMESSAGE +_GOSSIPMESSAGE.fields_by_name['hello'].message_type = _GOSSIPHELLO +_GOSSIPMESSAGE.fields_by_name['dataDig'].message_type = _DATADIGEST +_GOSSIPMESSAGE.fields_by_name['dataReq'].message_type = _DATAREQUEST +_GOSSIPMESSAGE.fields_by_name['dataUpdate'].message_type = _DATAUPDATE +_GOSSIPMESSAGE.fields_by_name['empty'].message_type = _EMPTY +_GOSSIPMESSAGE.fields_by_name['conn'].message_type = _CONNESTABLISH +_GOSSIPMESSAGE.fields_by_name['stateInfo'].message_type = _STATEINFO +_GOSSIPMESSAGE.fields_by_name['stateSnapshot'].message_type = _STATEINFOSNAPSHOT +_GOSSIPMESSAGE.fields_by_name['stateInfoPullReq'].message_type = _STATEINFOPULLREQUEST +_GOSSIPMESSAGE.fields_by_name['stateRequest'].message_type = _REMOTESTATEREQUEST +_GOSSIPMESSAGE.fields_by_name['stateResponse'].message_type = _REMOTESTATERESPONSE +_GOSSIPMESSAGE.fields_by_name['leadershipMsg'].message_type = _LEADERSHIPMESSAGE +_GOSSIPMESSAGE.fields_by_name['peerIdentity'].message_type = _PEERIDENTITY +_GOSSIPMESSAGE_TAG.containing_type = _GOSSIPMESSAGE +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['aliveMsg']) +_GOSSIPMESSAGE.fields_by_name['aliveMsg'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['memReq']) +_GOSSIPMESSAGE.fields_by_name['memReq'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['memRes']) +_GOSSIPMESSAGE.fields_by_name['memRes'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['dataMsg']) +_GOSSIPMESSAGE.fields_by_name['dataMsg'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['hello']) +_GOSSIPMESSAGE.fields_by_name['hello'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['dataDig']) +_GOSSIPMESSAGE.fields_by_name['dataDig'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['dataReq']) +_GOSSIPMESSAGE.fields_by_name['dataReq'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['dataUpdate']) +_GOSSIPMESSAGE.fields_by_name['dataUpdate'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['empty']) +_GOSSIPMESSAGE.fields_by_name['empty'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['conn']) +_GOSSIPMESSAGE.fields_by_name['conn'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['stateInfo']) +_GOSSIPMESSAGE.fields_by_name['stateInfo'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['stateSnapshot']) +_GOSSIPMESSAGE.fields_by_name['stateSnapshot'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['stateInfoPullReq']) +_GOSSIPMESSAGE.fields_by_name['stateInfoPullReq'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['stateRequest']) +_GOSSIPMESSAGE.fields_by_name['stateRequest'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['stateResponse']) +_GOSSIPMESSAGE.fields_by_name['stateResponse'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['leadershipMsg']) +_GOSSIPMESSAGE.fields_by_name['leadershipMsg'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_GOSSIPMESSAGE.oneofs_by_name['content'].fields.append( + _GOSSIPMESSAGE.fields_by_name['peerIdentity']) +_GOSSIPMESSAGE.fields_by_name['peerIdentity'].containing_oneof = _GOSSIPMESSAGE.oneofs_by_name['content'] +_STATEINFO.fields_by_name['timestamp'].message_type = _PEERTIME +_STATEINFOSNAPSHOT.fields_by_name['elements'].message_type = _GOSSIPMESSAGE +_DATAREQUEST.fields_by_name['msgType'].enum_type = _PULLMSGTYPE +_GOSSIPHELLO.fields_by_name['msgType'].enum_type = _PULLMSGTYPE +_DATAUPDATE.fields_by_name['data'].message_type = _GOSSIPMESSAGE +_DATAUPDATE.fields_by_name['msgType'].enum_type = _PULLMSGTYPE +_DATADIGEST.fields_by_name['msgType'].enum_type = _PULLMSGTYPE +_DATAMESSAGE.fields_by_name['payload'].message_type = _PAYLOAD +_ALIVEMESSAGE.fields_by_name['membership'].message_type = _MEMBER +_ALIVEMESSAGE.fields_by_name['timestamp'].message_type = _PEERTIME +_LEADERSHIPMESSAGE.fields_by_name['timestamp'].message_type = _PEERTIME +_MEMBERSHIPREQUEST.fields_by_name['selfInformation'].message_type = _GOSSIPMESSAGE +_MEMBERSHIPRESPONSE.fields_by_name['alive'].message_type = _GOSSIPMESSAGE +_MEMBERSHIPRESPONSE.fields_by_name['dead'].message_type = _GOSSIPMESSAGE +_MEMBER.fields_by_name['internalEndpoint'].message_type = _SIGNEDENDPOINT +_REMOTESTATERESPONSE.fields_by_name['payloads'].message_type = _PAYLOAD +DESCRIPTOR.message_types_by_name['SignedGossipMessage'] = _SIGNEDGOSSIPMESSAGE +DESCRIPTOR.message_types_by_name['GossipMessage'] = _GOSSIPMESSAGE +DESCRIPTOR.message_types_by_name['StateInfo'] = _STATEINFO +DESCRIPTOR.message_types_by_name['StateInfoSnapshot'] = _STATEINFOSNAPSHOT +DESCRIPTOR.message_types_by_name['StateInfoPullRequest'] = _STATEINFOPULLREQUEST +DESCRIPTOR.message_types_by_name['ConnEstablish'] = _CONNESTABLISH +DESCRIPTOR.message_types_by_name['PeerIdentity'] = _PEERIDENTITY +DESCRIPTOR.message_types_by_name['DataRequest'] = _DATAREQUEST +DESCRIPTOR.message_types_by_name['GossipHello'] = _GOSSIPHELLO +DESCRIPTOR.message_types_by_name['DataUpdate'] = _DATAUPDATE +DESCRIPTOR.message_types_by_name['DataDigest'] = _DATADIGEST +DESCRIPTOR.message_types_by_name['DataMessage'] = _DATAMESSAGE +DESCRIPTOR.message_types_by_name['Payload'] = _PAYLOAD +DESCRIPTOR.message_types_by_name['AliveMessage'] = _ALIVEMESSAGE +DESCRIPTOR.message_types_by_name['LeadershipMessage'] = _LEADERSHIPMESSAGE +DESCRIPTOR.message_types_by_name['PeerTime'] = _PEERTIME +DESCRIPTOR.message_types_by_name['MembershipRequest'] = _MEMBERSHIPREQUEST +DESCRIPTOR.message_types_by_name['MembershipResponse'] = _MEMBERSHIPRESPONSE +DESCRIPTOR.message_types_by_name['Member'] = _MEMBER +DESCRIPTOR.message_types_by_name['SignedEndpoint'] = _SIGNEDENDPOINT +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['RemoteStateRequest'] = _REMOTESTATEREQUEST +DESCRIPTOR.message_types_by_name['RemoteStateResponse'] = _REMOTESTATERESPONSE +DESCRIPTOR.enum_types_by_name['PullMsgType'] = _PULLMSGTYPE + +SignedGossipMessage = _reflection.GeneratedProtocolMessageType('SignedGossipMessage', (_message.Message,), dict( + DESCRIPTOR = _SIGNEDGOSSIPMESSAGE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.SignedGossipMessage) + )) +_sym_db.RegisterMessage(SignedGossipMessage) + +GossipMessage = _reflection.GeneratedProtocolMessageType('GossipMessage', (_message.Message,), dict( + DESCRIPTOR = _GOSSIPMESSAGE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.GossipMessage) + )) +_sym_db.RegisterMessage(GossipMessage) + +StateInfo = _reflection.GeneratedProtocolMessageType('StateInfo', (_message.Message,), dict( + DESCRIPTOR = _STATEINFO, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.StateInfo) + )) +_sym_db.RegisterMessage(StateInfo) + +StateInfoSnapshot = _reflection.GeneratedProtocolMessageType('StateInfoSnapshot', (_message.Message,), dict( + DESCRIPTOR = _STATEINFOSNAPSHOT, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.StateInfoSnapshot) + )) +_sym_db.RegisterMessage(StateInfoSnapshot) + +StateInfoPullRequest = _reflection.GeneratedProtocolMessageType('StateInfoPullRequest', (_message.Message,), dict( + DESCRIPTOR = _STATEINFOPULLREQUEST, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.StateInfoPullRequest) + )) +_sym_db.RegisterMessage(StateInfoPullRequest) + +ConnEstablish = _reflection.GeneratedProtocolMessageType('ConnEstablish', (_message.Message,), dict( + DESCRIPTOR = _CONNESTABLISH, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.ConnEstablish) + )) +_sym_db.RegisterMessage(ConnEstablish) + +PeerIdentity = _reflection.GeneratedProtocolMessageType('PeerIdentity', (_message.Message,), dict( + DESCRIPTOR = _PEERIDENTITY, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.PeerIdentity) + )) +_sym_db.RegisterMessage(PeerIdentity) + +DataRequest = _reflection.GeneratedProtocolMessageType('DataRequest', (_message.Message,), dict( + DESCRIPTOR = _DATAREQUEST, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.DataRequest) + )) +_sym_db.RegisterMessage(DataRequest) + +GossipHello = _reflection.GeneratedProtocolMessageType('GossipHello', (_message.Message,), dict( + DESCRIPTOR = _GOSSIPHELLO, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.GossipHello) + )) +_sym_db.RegisterMessage(GossipHello) + +DataUpdate = _reflection.GeneratedProtocolMessageType('DataUpdate', (_message.Message,), dict( + DESCRIPTOR = _DATAUPDATE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.DataUpdate) + )) +_sym_db.RegisterMessage(DataUpdate) + +DataDigest = _reflection.GeneratedProtocolMessageType('DataDigest', (_message.Message,), dict( + DESCRIPTOR = _DATADIGEST, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.DataDigest) + )) +_sym_db.RegisterMessage(DataDigest) + +DataMessage = _reflection.GeneratedProtocolMessageType('DataMessage', (_message.Message,), dict( + DESCRIPTOR = _DATAMESSAGE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.DataMessage) + )) +_sym_db.RegisterMessage(DataMessage) + +Payload = _reflection.GeneratedProtocolMessageType('Payload', (_message.Message,), dict( + DESCRIPTOR = _PAYLOAD, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.Payload) + )) +_sym_db.RegisterMessage(Payload) + +AliveMessage = _reflection.GeneratedProtocolMessageType('AliveMessage', (_message.Message,), dict( + DESCRIPTOR = _ALIVEMESSAGE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.AliveMessage) + )) +_sym_db.RegisterMessage(AliveMessage) + +LeadershipMessage = _reflection.GeneratedProtocolMessageType('LeadershipMessage', (_message.Message,), dict( + DESCRIPTOR = _LEADERSHIPMESSAGE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.LeadershipMessage) + )) +_sym_db.RegisterMessage(LeadershipMessage) + +PeerTime = _reflection.GeneratedProtocolMessageType('PeerTime', (_message.Message,), dict( + DESCRIPTOR = _PEERTIME, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.PeerTime) + )) +_sym_db.RegisterMessage(PeerTime) + +MembershipRequest = _reflection.GeneratedProtocolMessageType('MembershipRequest', (_message.Message,), dict( + DESCRIPTOR = _MEMBERSHIPREQUEST, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.MembershipRequest) + )) +_sym_db.RegisterMessage(MembershipRequest) + +MembershipResponse = _reflection.GeneratedProtocolMessageType('MembershipResponse', (_message.Message,), dict( + DESCRIPTOR = _MEMBERSHIPRESPONSE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.MembershipResponse) + )) +_sym_db.RegisterMessage(MembershipResponse) + +Member = _reflection.GeneratedProtocolMessageType('Member', (_message.Message,), dict( + DESCRIPTOR = _MEMBER, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.Member) + )) +_sym_db.RegisterMessage(Member) + +SignedEndpoint = _reflection.GeneratedProtocolMessageType('SignedEndpoint', (_message.Message,), dict( + DESCRIPTOR = _SIGNEDENDPOINT, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.SignedEndpoint) + )) +_sym_db.RegisterMessage(SignedEndpoint) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), dict( + DESCRIPTOR = _EMPTY, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.Empty) + )) +_sym_db.RegisterMessage(Empty) + +RemoteStateRequest = _reflection.GeneratedProtocolMessageType('RemoteStateRequest', (_message.Message,), dict( + DESCRIPTOR = _REMOTESTATEREQUEST, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.RemoteStateRequest) + )) +_sym_db.RegisterMessage(RemoteStateRequest) + +RemoteStateResponse = _reflection.GeneratedProtocolMessageType('RemoteStateResponse', (_message.Message,), dict( + DESCRIPTOR = _REMOTESTATERESPONSE, + __module__ = 'gossip.message_pb2' + # @@protoc_insertion_point(class_scope:gossip.RemoteStateResponse) + )) +_sym_db.RegisterMessage(RemoteStateResponse) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z+github.com/hyperledger/fabric/protos/gossip')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + + + class GossipStub(object): + """Gossip + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GossipStream = channel.stream_stream( + '/gossip.Gossip/GossipStream', + request_serializer=GossipMessage.SerializeToString, + response_deserializer=GossipMessage.FromString, + ) + self.Ping = channel.unary_unary( + '/gossip.Gossip/Ping', + request_serializer=Empty.SerializeToString, + response_deserializer=Empty.FromString, + ) + + + class GossipServicer(object): + """Gossip + """ + + def GossipStream(self, request_iterator, context): + """GossipStream is the gRPC stream used for sending and receiving messages + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Ping(self, request, context): + """Ping is used to probe a remote peer's aliveness + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_GossipServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GossipStream': grpc.stream_stream_rpc_method_handler( + servicer.GossipStream, + request_deserializer=GossipMessage.FromString, + response_serializer=GossipMessage.SerializeToString, + ), + 'Ping': grpc.unary_unary_rpc_method_handler( + servicer.Ping, + request_deserializer=Empty.FromString, + response_serializer=Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'gossip.Gossip', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaGossipServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Gossip + """ + def GossipStream(self, request_iterator, context): + """GossipStream is the gRPC stream used for sending and receiving messages + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def Ping(self, request, context): + """Ping is used to probe a remote peer's aliveness + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaGossipStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Gossip + """ + def GossipStream(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): + """GossipStream is the gRPC stream used for sending and receiving messages + """ + raise NotImplementedError() + def Ping(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Ping is used to probe a remote peer's aliveness + """ + raise NotImplementedError() + Ping.future = None + + + def beta_create_Gossip_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('gossip.Gossip', 'GossipStream'): GossipMessage.FromString, + ('gossip.Gossip', 'Ping'): Empty.FromString, + } + response_serializers = { + ('gossip.Gossip', 'GossipStream'): GossipMessage.SerializeToString, + ('gossip.Gossip', 'Ping'): Empty.SerializeToString, + } + method_implementations = { + ('gossip.Gossip', 'GossipStream'): face_utilities.stream_stream_inline(servicer.GossipStream), + ('gossip.Gossip', 'Ping'): face_utilities.unary_unary_inline(servicer.Ping), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Gossip_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('gossip.Gossip', 'GossipStream'): GossipMessage.SerializeToString, + ('gossip.Gossip', 'Ping'): Empty.SerializeToString, + } + response_deserializers = { + ('gossip.Gossip', 'GossipStream'): GossipMessage.FromString, + ('gossip.Gossip', 'Ping'): Empty.FromString, + } + cardinalities = { + 'GossipStream': cardinality.Cardinality.STREAM_STREAM, + 'Ping': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'gossip.Gossip', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/gossip/message_pb2_grpc.py b/bddtests/gossip/message_pb2_grpc.py new file mode 100644 index 00000000000..782e3a55432 --- /dev/null +++ b/bddtests/gossip/message_pb2_grpc.py @@ -0,0 +1,67 @@ +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + +import gossip.message_pb2 as gossip_dot_message__pb2 +import gossip.message_pb2 as gossip_dot_message__pb2 +import gossip.message_pb2 as gossip_dot_message__pb2 +import gossip.message_pb2 as gossip_dot_message__pb2 + + +class GossipStub(object): + """Gossip + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GossipStream = channel.stream_stream( + '/gossip.Gossip/GossipStream', + request_serializer=gossip_dot_message__pb2.GossipMessage.SerializeToString, + response_deserializer=gossip_dot_message__pb2.GossipMessage.FromString, + ) + self.Ping = channel.unary_unary( + '/gossip.Gossip/Ping', + request_serializer=gossip_dot_message__pb2.Empty.SerializeToString, + response_deserializer=gossip_dot_message__pb2.Empty.FromString, + ) + + +class GossipServicer(object): + """Gossip + """ + + def GossipStream(self, request_iterator, context): + """GossipStream is the gRPC stream used for sending and receiving messages + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Ping(self, request, context): + """Ping is used to probe a remote peer's aliveness + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_GossipServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GossipStream': grpc.stream_stream_rpc_method_handler( + servicer.GossipStream, + request_deserializer=gossip_dot_message__pb2.GossipMessage.FromString, + response_serializer=gossip_dot_message__pb2.GossipMessage.SerializeToString, + ), + 'Ping': grpc.unary_unary_rpc_method_handler( + servicer.Ping, + request_deserializer=gossip_dot_message__pb2.Empty.FromString, + response_serializer=gossip_dot_message__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'gossip.Gossip', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/bddtests/java_shim.feature b/bddtests/java_shim.feature deleted file mode 100644 index 7bac768d9e8..00000000000 --- a/bddtests/java_shim.feature +++ /dev/null @@ -1,212 +0,0 @@ -# Test Hyperledger Peers -# -# Tags that can be used and will affect test internals: -# -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# -# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! - -# -#Copyright DTCC 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. -# -# - - -#@chaincodeImagesUpToDate -@preV1 -Feature: Java chaincode example - Scenario: java SimpleSample chaincode example single peer - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy lang chaincode "examples/chaincode/java/SimpleSample" of "JAVA" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "300" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}" - - When I invoke chaincode "SimpleSample" function name "transfer" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | b | - Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}" - -Scenario: java RangeExample chaincode single peer - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy lang chaincode "examples/chaincode/java/RangeExample" of "JAVA" with ctor "init" to "vp0" - || - || - Then I should have received a chaincode name - Then I wait up to "300" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I invoke chaincode "RangeExample" function name "put" on "vp0" - |arg1|arg2| - | a | alice | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I invoke chaincode "RangeExample" function name "put" on "vp0" - |arg1|arg2| - | b | bob | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - - When I query chaincode "RangeExample" function name "get" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "alice" - - When I query chaincode "RangeExample" function name "get" on "vp0": - |arg1| - | b | - Then I should get a JSON response with "result.message" = "bob" - - - When I query chaincode "RangeExample" function name "keys" on "vp0": - || - || - Then I should get a JSON response with "result.message" = "[a, b]" - When I invoke chaincode "RangeExample" function name "del" on "vp0" - |arg1| - | b | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When I query chaincode "RangeExample" function name "keys" on "vp0": - || - || - Then I should get a JSON response with "result.message" = "[a]" - - Scenario: Java TableExample chaincode single peer - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy lang chaincode "examples/chaincode/java/TableExample" of "JAVA" with ctor "init" to "vp0" - || - || - Then I should have received a chaincode name - Then I wait up to "240" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - When I invoke chaincode "TableExample" function name "insert" on "vp0" - |arg1|arg2| - | 0 | Alice | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When I invoke chaincode "TableExample" function name "insert" on "vp0" - |arg1|arg2| - | 1 | Bob | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When I invoke chaincode "TableExample" function name "insert" on "vp0" - |arg1|arg2| - | 2 | Charlie | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When I query chaincode "TableExample" function name "get" on "vp0": - |arg1| - | 0 | - Then I should get a JSON response with "result.message" = "Alice" - - When I query chaincode "TableExample" function name "get" on "vp0": - |arg1| - | 2 | - Then I should get a JSON response with "result.message" = "Charlie" - When I invoke chaincode "TableExample" function name "update" on "vp0" - |arg1|arg2| - | 2 | Chaitra | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When I query chaincode "TableExample" function name "get" on "vp0": - |arg1| - | 2 | - Then I should get a JSON response with "result.message" = "Chaitra" - When I invoke chaincode "TableExample" function name "delete" on "vp0" - |arg1| - | 2 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When I query chaincode "TableExample" function name "get" on "vp0": - |arg1| - | 2 | - Then I should get a JSON response with "result.message" = "No record found !" - Scenario: Java chaincode example from remote git repository - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - # TODO Needs to be replaced with an official test repo in the future. - When I deploy lang chaincode "http://github.com/hyperledger/fabric-test-resources/javachaincodemvn" of "JAVA" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "300" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}" - - When I invoke chaincode "SimpleSample" function name "transfer" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}" - - When I query chaincode "SimpleSample" function name "query" on "vp0": - |arg1| - | b | - Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}" diff --git a/bddtests/msp/mspconfig_pb2.py b/bddtests/msp/mspconfig_pb2.py index 62cabda568e..6fd125d9708 100644 --- a/bddtests/msp/mspconfig_pb2.py +++ b/bddtests/msp/mspconfig_pb2.py @@ -19,7 +19,7 @@ name='msp/mspconfig.proto', package='msp', syntax='proto3', - serialized_pb=_b('\n\x13msp/mspconfig.proto\x12\x03msp\")\n\tMSPConfig\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0e\n\x06\x63onfig\x18\x02 \x01(\x0c\"\xac\x01\n\x0f\x46\x61\x62ricMSPConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nroot_certs\x18\x02 \x03(\x0c\x12\x1a\n\x12intermediate_certs\x18\x03 \x03(\x0c\x12\x0e\n\x06\x61\x64mins\x18\x04 \x03(\x0c\x12\x17\n\x0frevocation_list\x18\x05 \x03(\x0c\x12\x32\n\x10signing_identity\x18\x06 \x01(\x0b\x32\x18.msp.SigningIdentityInfo\"R\n\x13SigningIdentityInfo\x12\x15\n\rpublic_signer\x18\x01 \x01(\x0c\x12$\n\x0eprivate_signer\x18\x02 \x01(\x0b\x32\x0c.msp.KeyInfo\"7\n\x07KeyInfo\x12\x16\n\x0ekey_identifier\x18\x01 \x01(\t\x12\x14\n\x0ckey_material\x18\x02 \x01(\x0c\x42*Z(github.com/hyperledger/fabric/protos/mspb\x06proto3') + serialized_pb=_b('\n\x13msp/mspconfig.proto\x12\x03msp\")\n\tMSPConfig\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0e\n\x06\x63onfig\x18\x02 \x01(\x0c\"\xee\x01\n\x0f\x46\x61\x62ricMSPConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nroot_certs\x18\x02 \x03(\x0c\x12\x1a\n\x12intermediate_certs\x18\x03 \x03(\x0c\x12\x0e\n\x06\x61\x64mins\x18\x04 \x03(\x0c\x12\x17\n\x0frevocation_list\x18\x05 \x03(\x0c\x12\x32\n\x10signing_identity\x18\x06 \x01(\x0b\x32\x18.msp.SigningIdentityInfo\x12@\n\x1forganizational_unit_identifiers\x18\x07 \x03(\x0b\x32\x17.msp.FabricOUIdentifier\"R\n\x13SigningIdentityInfo\x12\x15\n\rpublic_signer\x18\x01 \x01(\x0c\x12$\n\x0eprivate_signer\x18\x02 \x01(\x0b\x32\x0c.msp.KeyInfo\"7\n\x07KeyInfo\x12\x16\n\x0ekey_identifier\x18\x01 \x01(\t\x12\x14\n\x0ckey_material\x18\x02 \x01(\x0c\"[\n\x12\x46\x61\x62ricOUIdentifier\x12\x1d\n\x15\x63\x65rtifiers_identifier\x18\x01 \x01(\x0c\x12&\n\x1eorganizational_unit_identifier\x18\x02 \x01(\tB*Z(github.com/hyperledger/fabric/protos/mspb\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -113,6 +113,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='organizational_unit_identifiers', full_name='msp.FabricMSPConfig.organizational_unit_identifiers', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -126,7 +133,7 @@ oneofs=[ ], serialized_start=72, - serialized_end=244, + serialized_end=310, ) @@ -163,8 +170,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=246, - serialized_end=328, + serialized_start=312, + serialized_end=394, ) @@ -201,16 +208,56 @@ extension_ranges=[], oneofs=[ ], - serialized_start=330, - serialized_end=385, + serialized_start=396, + serialized_end=451, +) + + +_FABRICOUIDENTIFIER = _descriptor.Descriptor( + name='FabricOUIdentifier', + full_name='msp.FabricOUIdentifier', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='certifiers_identifier', full_name='msp.FabricOUIdentifier.certifiers_identifier', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='organizational_unit_identifier', full_name='msp.FabricOUIdentifier.organizational_unit_identifier', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=453, + serialized_end=544, ) _FABRICMSPCONFIG.fields_by_name['signing_identity'].message_type = _SIGNINGIDENTITYINFO +_FABRICMSPCONFIG.fields_by_name['organizational_unit_identifiers'].message_type = _FABRICOUIDENTIFIER _SIGNINGIDENTITYINFO.fields_by_name['private_signer'].message_type = _KEYINFO DESCRIPTOR.message_types_by_name['MSPConfig'] = _MSPCONFIG DESCRIPTOR.message_types_by_name['FabricMSPConfig'] = _FABRICMSPCONFIG DESCRIPTOR.message_types_by_name['SigningIdentityInfo'] = _SIGNINGIDENTITYINFO DESCRIPTOR.message_types_by_name['KeyInfo'] = _KEYINFO +DESCRIPTOR.message_types_by_name['FabricOUIdentifier'] = _FABRICOUIDENTIFIER MSPConfig = _reflection.GeneratedProtocolMessageType('MSPConfig', (_message.Message,), dict( DESCRIPTOR = _MSPCONFIG, @@ -240,6 +287,13 @@ )) _sym_db.RegisterMessage(KeyInfo) +FabricOUIdentifier = _reflection.GeneratedProtocolMessageType('FabricOUIdentifier', (_message.Message,), dict( + DESCRIPTOR = _FABRICOUIDENTIFIER, + __module__ = 'msp.mspconfig_pb2' + # @@protoc_insertion_point(class_scope:msp.FabricOUIdentifier) + )) +_sym_db.RegisterMessage(FabricOUIdentifier) + DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z(github.com/hyperledger/fabric/protos/msp')) diff --git a/bddtests/orderer/configuration_pb2.py b/bddtests/orderer/configuration_pb2.py index 508056002bb..13741e704dd 100644 --- a/bddtests/orderer/configuration_pb2.py +++ b/bddtests/orderer/configuration_pb2.py @@ -13,16 +13,14 @@ _sym_db = _symbol_database.Default() -from common import common_pb2 as common_dot_common__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='orderer/configuration.proto', package='orderer', syntax='proto3', - serialized_pb=_b('\n\x1borderer/configuration.proto\x12\x07orderer\x1a\x13\x63ommon/common.proto\"\x1d\n\rConsensusType\x12\x0c\n\x04type\x18\x01 \x01(\t\"Y\n\tBatchSize\x12\x17\n\x0fmaxMessageCount\x18\x01 \x01(\r\x12\x18\n\x10\x61\x62soluteMaxBytes\x18\x02 \x01(\r\x12\x19\n\x11preferredMaxBytes\x18\x03 \x01(\r\"\x1f\n\x0c\x42\x61tchTimeout\x12\x0f\n\x07timeout\x18\x01 \x01(\t\"0\n\x0e\x43reationPolicy\x12\x0e\n\x06policy\x18\x01 \x01(\t\x12\x0e\n\x06\x64igest\x18\x02 \x01(\x0c\"#\n\x12IngressPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\"\"\n\x11\x45gressPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\")\n\x18\x43hainCreationPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\"\x1f\n\x0cKafkaBrokers\x12\x0f\n\x07\x62rokers\x18\x01 \x03(\tB.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') - , - dependencies=[common_dot_common__pb2.DESCRIPTOR,]) + serialized_pb=_b('\n\x1borderer/configuration.proto\x12\x07orderer\"\x1d\n\rConsensusType\x12\x0c\n\x04type\x18\x01 \x01(\t\"Y\n\tBatchSize\x12\x17\n\x0fmaxMessageCount\x18\x01 \x01(\r\x12\x18\n\x10\x61\x62soluteMaxBytes\x18\x02 \x01(\r\x12\x19\n\x11preferredMaxBytes\x18\x03 \x01(\r\"\x1f\n\x0c\x42\x61tchTimeout\x12\x0f\n\x07timeout\x18\x01 \x01(\t\" \n\x0e\x43reationPolicy\x12\x0e\n\x06policy\x18\x01 \x01(\t\"#\n\x12IngressPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\"\"\n\x11\x45gressPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\")\n\x18\x43hainCreationPolicyNames\x12\r\n\x05names\x18\x01 \x03(\t\"\x1f\n\x0cKafkaBrokers\x12\x0f\n\x07\x62rokers\x18\x01 \x03(\tB.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') +) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -54,8 +52,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61, - serialized_end=90, + serialized_start=40, + serialized_end=69, ) @@ -99,8 +97,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=92, - serialized_end=181, + serialized_start=71, + serialized_end=160, ) @@ -130,8 +128,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=183, - serialized_end=214, + serialized_start=162, + serialized_end=193, ) @@ -149,13 +147,6 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), - _descriptor.FieldDescriptor( - name='digest', full_name='orderer.CreationPolicy.digest', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -168,8 +159,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=216, - serialized_end=264, + serialized_start=195, + serialized_end=227, ) @@ -199,8 +190,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=266, - serialized_end=301, + serialized_start=229, + serialized_end=264, ) @@ -230,8 +221,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=303, - serialized_end=337, + serialized_start=266, + serialized_end=300, ) @@ -261,8 +252,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=339, - serialized_end=380, + serialized_start=302, + serialized_end=343, ) @@ -292,8 +283,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=382, - serialized_end=413, + serialized_start=345, + serialized_end=376, ) DESCRIPTOR.message_types_by_name['ConsensusType'] = _CONSENSUSTYPE diff --git a/bddtests/orderer/kafka_pb2.py b/bddtests/orderer/kafka_pb2.py index 04c3c9d4eec..d81ec67f354 100644 --- a/bddtests/orderer/kafka_pb2.py +++ b/bddtests/orderer/kafka_pb2.py @@ -19,7 +19,7 @@ name='orderer/kafka.proto', package='orderer', syntax='proto3', - serialized_pb=_b('\n\x13orderer/kafka.proto\x12\x07orderer\"\xaf\x01\n\x0cKafkaMessage\x12/\n\x07regular\x18\x01 \x01(\x0b\x32\x1c.orderer.KafkaMessageRegularH\x00\x12\x35\n\x0btime_to_cut\x18\x02 \x01(\x0b\x32\x1e.orderer.KafkaMessageTimeToCutH\x00\x12/\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1c.orderer.KafkaMessageConnectH\x00\x42\x06\n\x04Type\"&\n\x13KafkaMessageRegular\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\"-\n\x15KafkaMessageTimeToCut\x12\x14\n\x0c\x62lock_number\x18\x01 \x01(\x04\"&\n\x13KafkaMessageConnect\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x42.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') + serialized_pb=_b('\n\x13orderer/kafka.proto\x12\x07orderer\"\xaf\x01\n\x0cKafkaMessage\x12/\n\x07regular\x18\x01 \x01(\x0b\x32\x1c.orderer.KafkaMessageRegularH\x00\x12\x35\n\x0btime_to_cut\x18\x02 \x01(\x0b\x32\x1e.orderer.KafkaMessageTimeToCutH\x00\x12/\n\x07\x63onnect\x18\x03 \x01(\x0b\x32\x1c.orderer.KafkaMessageConnectH\x00\x42\x06\n\x04Type\"&\n\x13KafkaMessageRegular\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\"-\n\x15KafkaMessageTimeToCut\x12\x14\n\x0c\x62lock_number\x18\x01 \x01(\x04\"&\n\x13KafkaMessageConnect\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\".\n\rKafkaMetadata\x12\x1d\n\x15last_offset_persisted\x18\x01 \x01(\x03\x42.Z,github.com/hyperledger/fabric/protos/ordererb\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -166,6 +166,37 @@ serialized_end=335, ) + +_KAFKAMETADATA = _descriptor.Descriptor( + name='KafkaMetadata', + full_name='orderer.KafkaMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='last_offset_persisted', full_name='orderer.KafkaMetadata.last_offset_persisted', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=337, + serialized_end=383, +) + _KAFKAMESSAGE.fields_by_name['regular'].message_type = _KAFKAMESSAGEREGULAR _KAFKAMESSAGE.fields_by_name['time_to_cut'].message_type = _KAFKAMESSAGETIMETOCUT _KAFKAMESSAGE.fields_by_name['connect'].message_type = _KAFKAMESSAGECONNECT @@ -182,6 +213,7 @@ DESCRIPTOR.message_types_by_name['KafkaMessageRegular'] = _KAFKAMESSAGEREGULAR DESCRIPTOR.message_types_by_name['KafkaMessageTimeToCut'] = _KAFKAMESSAGETIMETOCUT DESCRIPTOR.message_types_by_name['KafkaMessageConnect'] = _KAFKAMESSAGECONNECT +DESCRIPTOR.message_types_by_name['KafkaMetadata'] = _KAFKAMETADATA KafkaMessage = _reflection.GeneratedProtocolMessageType('KafkaMessage', (_message.Message,), dict( DESCRIPTOR = _KAFKAMESSAGE, @@ -211,6 +243,13 @@ )) _sym_db.RegisterMessage(KafkaMessageConnect) +KafkaMetadata = _reflection.GeneratedProtocolMessageType('KafkaMetadata', (_message.Message,), dict( + DESCRIPTOR = _KAFKAMETADATA, + __module__ = 'orderer.kafka_pb2' + # @@protoc_insertion_point(class_scope:orderer.KafkaMetadata) + )) +_sym_db.RegisterMessage(KafkaMetadata) + DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z,github.com/hyperledger/fabric/protos/orderer')) diff --git a/bddtests/peer/admin_pb2.py b/bddtests/peer/admin_pb2.py new file mode 100644 index 00000000000..7a0f470f2ad --- /dev/null +++ b/bddtests/peer/admin_pb2.py @@ -0,0 +1,429 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: peer/admin.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='peer/admin.proto', + package='protos', + syntax='proto3', + serialized_pb=_b('\n\x10peer/admin.proto\x12\x06protos\x1a\x1bgoogle/protobuf/empty.proto\"\x9a\x01\n\x0cServerStatus\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x1f.protos.ServerStatus.StatusCode\"Y\n\nStatusCode\x12\r\n\tUNDEFINED\x10\x00\x12\x0b\n\x07STARTED\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\n\n\x06PAUSED\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x12\x0b\n\x07UNKNOWN\x10\x05\"8\n\x0fLogLevelRequest\x12\x12\n\nlog_module\x18\x01 \x01(\t\x12\x11\n\tlog_level\x18\x02 \x01(\t\"9\n\x10LogLevelResponse\x12\x12\n\nlog_module\x18\x01 \x01(\t\x12\x11\n\tlog_level\x18\x02 \x01(\t2\xd5\x02\n\x05\x41\x64min\x12;\n\tGetStatus\x12\x16.google.protobuf.Empty\x1a\x14.protos.ServerStatus\"\x00\x12=\n\x0bStartServer\x12\x16.google.protobuf.Empty\x1a\x14.protos.ServerStatus\"\x00\x12<\n\nStopServer\x12\x16.google.protobuf.Empty\x1a\x14.protos.ServerStatus\"\x00\x12H\n\x11GetModuleLogLevel\x12\x17.protos.LogLevelRequest\x1a\x18.protos.LogLevelResponse\"\x00\x12H\n\x11SetModuleLogLevel\x12\x17.protos.LogLevelRequest\x1a\x18.protos.LogLevelResponse\"\x00\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + , + dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SERVERSTATUS_STATUSCODE = _descriptor.EnumDescriptor( + name='StatusCode', + full_name='protos.ServerStatus.StatusCode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNDEFINED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STARTED', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STOPPED', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PAUSED', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ERROR', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=5, number=5, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=123, + serialized_end=212, +) +_sym_db.RegisterEnumDescriptor(_SERVERSTATUS_STATUSCODE) + + +_SERVERSTATUS = _descriptor.Descriptor( + name='ServerStatus', + full_name='protos.ServerStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='status', full_name='protos.ServerStatus.status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SERVERSTATUS_STATUSCODE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=58, + serialized_end=212, +) + + +_LOGLEVELREQUEST = _descriptor.Descriptor( + name='LogLevelRequest', + full_name='protos.LogLevelRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='log_module', full_name='protos.LogLevelRequest.log_module', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='log_level', full_name='protos.LogLevelRequest.log_level', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=214, + serialized_end=270, +) + + +_LOGLEVELRESPONSE = _descriptor.Descriptor( + name='LogLevelResponse', + full_name='protos.LogLevelResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='log_module', full_name='protos.LogLevelResponse.log_module', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='log_level', full_name='protos.LogLevelResponse.log_level', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=272, + serialized_end=329, +) + +_SERVERSTATUS.fields_by_name['status'].enum_type = _SERVERSTATUS_STATUSCODE +_SERVERSTATUS_STATUSCODE.containing_type = _SERVERSTATUS +DESCRIPTOR.message_types_by_name['ServerStatus'] = _SERVERSTATUS +DESCRIPTOR.message_types_by_name['LogLevelRequest'] = _LOGLEVELREQUEST +DESCRIPTOR.message_types_by_name['LogLevelResponse'] = _LOGLEVELRESPONSE + +ServerStatus = _reflection.GeneratedProtocolMessageType('ServerStatus', (_message.Message,), dict( + DESCRIPTOR = _SERVERSTATUS, + __module__ = 'peer.admin_pb2' + # @@protoc_insertion_point(class_scope:protos.ServerStatus) + )) +_sym_db.RegisterMessage(ServerStatus) + +LogLevelRequest = _reflection.GeneratedProtocolMessageType('LogLevelRequest', (_message.Message,), dict( + DESCRIPTOR = _LOGLEVELREQUEST, + __module__ = 'peer.admin_pb2' + # @@protoc_insertion_point(class_scope:protos.LogLevelRequest) + )) +_sym_db.RegisterMessage(LogLevelRequest) + +LogLevelResponse = _reflection.GeneratedProtocolMessageType('LogLevelResponse', (_message.Message,), dict( + DESCRIPTOR = _LOGLEVELRESPONSE, + __module__ = 'peer.admin_pb2' + # @@protoc_insertion_point(class_scope:protos.LogLevelResponse) + )) +_sym_db.RegisterMessage(LogLevelResponse) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + + + class AdminStub(object): + """Interface exported by the server. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetStatus = channel.unary_unary( + '/protos.Admin/GetStatus', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=ServerStatus.FromString, + ) + self.StartServer = channel.unary_unary( + '/protos.Admin/StartServer', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=ServerStatus.FromString, + ) + self.StopServer = channel.unary_unary( + '/protos.Admin/StopServer', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=ServerStatus.FromString, + ) + self.GetModuleLogLevel = channel.unary_unary( + '/protos.Admin/GetModuleLogLevel', + request_serializer=LogLevelRequest.SerializeToString, + response_deserializer=LogLevelResponse.FromString, + ) + self.SetModuleLogLevel = channel.unary_unary( + '/protos.Admin/SetModuleLogLevel', + request_serializer=LogLevelRequest.SerializeToString, + response_deserializer=LogLevelResponse.FromString, + ) + + + class AdminServicer(object): + """Interface exported by the server. + """ + + def GetStatus(self, request, context): + """Return the serve status. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StartServer(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopServer(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetModuleLogLevel(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetModuleLogLevel(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_AdminServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetStatus, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=ServerStatus.SerializeToString, + ), + 'StartServer': grpc.unary_unary_rpc_method_handler( + servicer.StartServer, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=ServerStatus.SerializeToString, + ), + 'StopServer': grpc.unary_unary_rpc_method_handler( + servicer.StopServer, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=ServerStatus.SerializeToString, + ), + 'GetModuleLogLevel': grpc.unary_unary_rpc_method_handler( + servicer.GetModuleLogLevel, + request_deserializer=LogLevelRequest.FromString, + response_serializer=LogLevelResponse.SerializeToString, + ), + 'SetModuleLogLevel': grpc.unary_unary_rpc_method_handler( + servicer.SetModuleLogLevel, + request_deserializer=LogLevelRequest.FromString, + response_serializer=LogLevelResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.Admin', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaAdminServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface exported by the server. + """ + def GetStatus(self, request, context): + """Return the serve status. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def StartServer(self, request, context): + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def StopServer(self, request, context): + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def GetModuleLogLevel(self, request, context): + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def SetModuleLogLevel(self, request, context): + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaAdminStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface exported by the server. + """ + def GetStatus(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Return the serve status. + """ + raise NotImplementedError() + GetStatus.future = None + def StartServer(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + raise NotImplementedError() + StartServer.future = None + def StopServer(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + raise NotImplementedError() + StopServer.future = None + def GetModuleLogLevel(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + raise NotImplementedError() + GetModuleLogLevel.future = None + def SetModuleLogLevel(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + raise NotImplementedError() + SetModuleLogLevel.future = None + + + def beta_create_Admin_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('protos.Admin', 'GetModuleLogLevel'): LogLevelRequest.FromString, + ('protos.Admin', 'GetStatus'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('protos.Admin', 'SetModuleLogLevel'): LogLevelRequest.FromString, + ('protos.Admin', 'StartServer'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('protos.Admin', 'StopServer'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + } + response_serializers = { + ('protos.Admin', 'GetModuleLogLevel'): LogLevelResponse.SerializeToString, + ('protos.Admin', 'GetStatus'): ServerStatus.SerializeToString, + ('protos.Admin', 'SetModuleLogLevel'): LogLevelResponse.SerializeToString, + ('protos.Admin', 'StartServer'): ServerStatus.SerializeToString, + ('protos.Admin', 'StopServer'): ServerStatus.SerializeToString, + } + method_implementations = { + ('protos.Admin', 'GetModuleLogLevel'): face_utilities.unary_unary_inline(servicer.GetModuleLogLevel), + ('protos.Admin', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus), + ('protos.Admin', 'SetModuleLogLevel'): face_utilities.unary_unary_inline(servicer.SetModuleLogLevel), + ('protos.Admin', 'StartServer'): face_utilities.unary_unary_inline(servicer.StartServer), + ('protos.Admin', 'StopServer'): face_utilities.unary_unary_inline(servicer.StopServer), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Admin_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('protos.Admin', 'GetModuleLogLevel'): LogLevelRequest.SerializeToString, + ('protos.Admin', 'GetStatus'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('protos.Admin', 'SetModuleLogLevel'): LogLevelRequest.SerializeToString, + ('protos.Admin', 'StartServer'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('protos.Admin', 'StopServer'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + } + response_deserializers = { + ('protos.Admin', 'GetModuleLogLevel'): LogLevelResponse.FromString, + ('protos.Admin', 'GetStatus'): ServerStatus.FromString, + ('protos.Admin', 'SetModuleLogLevel'): LogLevelResponse.FromString, + ('protos.Admin', 'StartServer'): ServerStatus.FromString, + ('protos.Admin', 'StopServer'): ServerStatus.FromString, + } + cardinalities = { + 'GetModuleLogLevel': cardinality.Cardinality.UNARY_UNARY, + 'GetStatus': cardinality.Cardinality.UNARY_UNARY, + 'SetModuleLogLevel': cardinality.Cardinality.UNARY_UNARY, + 'StartServer': cardinality.Cardinality.UNARY_UNARY, + 'StopServer': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'protos.Admin', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/admin_pb2_grpc.py b/bddtests/peer/admin_pb2_grpc.py new file mode 100644 index 00000000000..4297abbfd4a --- /dev/null +++ b/bddtests/peer/admin_pb2_grpc.py @@ -0,0 +1,116 @@ +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 +import peer.admin_pb2 as peer_dot_admin__pb2 + + +class AdminStub(object): + """Interface exported by the server. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetStatus = channel.unary_unary( + '/protos.Admin/GetStatus', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString, + ) + self.StartServer = channel.unary_unary( + '/protos.Admin/StartServer', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString, + ) + self.StopServer = channel.unary_unary( + '/protos.Admin/StopServer', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=peer_dot_admin__pb2.ServerStatus.FromString, + ) + self.GetModuleLogLevel = channel.unary_unary( + '/protos.Admin/GetModuleLogLevel', + request_serializer=peer_dot_admin__pb2.LogLevelRequest.SerializeToString, + response_deserializer=peer_dot_admin__pb2.LogLevelResponse.FromString, + ) + self.SetModuleLogLevel = channel.unary_unary( + '/protos.Admin/SetModuleLogLevel', + request_serializer=peer_dot_admin__pb2.LogLevelRequest.SerializeToString, + response_deserializer=peer_dot_admin__pb2.LogLevelResponse.FromString, + ) + + +class AdminServicer(object): + """Interface exported by the server. + """ + + def GetStatus(self, request, context): + """Return the serve status. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StartServer(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopServer(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetModuleLogLevel(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetModuleLogLevel(self, request, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AdminServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetStatus, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString, + ), + 'StartServer': grpc.unary_unary_rpc_method_handler( + servicer.StartServer, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString, + ), + 'StopServer': grpc.unary_unary_rpc_method_handler( + servicer.StopServer, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=peer_dot_admin__pb2.ServerStatus.SerializeToString, + ), + 'GetModuleLogLevel': grpc.unary_unary_rpc_method_handler( + servicer.GetModuleLogLevel, + request_deserializer=peer_dot_admin__pb2.LogLevelRequest.FromString, + response_serializer=peer_dot_admin__pb2.LogLevelResponse.SerializeToString, + ), + 'SetModuleLogLevel': grpc.unary_unary_rpc_method_handler( + servicer.SetModuleLogLevel, + request_deserializer=peer_dot_admin__pb2.LogLevelRequest.FromString, + response_serializer=peer_dot_admin__pb2.LogLevelResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.Admin', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/bddtests/peer/chaincode_pb2.py b/bddtests/peer/chaincode_pb2.py index c3bcd44e9d0..e9be1a46071 100644 --- a/bddtests/peer/chaincode_pb2.py +++ b/bddtests/peer/chaincode_pb2.py @@ -14,7 +14,6 @@ _sym_db = _symbol_database.Default() -from peer import chaincodeevent_pb2 as peer_dot_chaincodeevent__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 @@ -22,9 +21,9 @@ name='peer/chaincode.proto', package='protos', syntax='proto3', - serialized_pb=_b('\n\x14peer/chaincode.proto\x12\x06protos\x1a\x19peer/chaincodeevent.proto\x1a\x1fgoogle/protobuf/timestamp.proto\":\n\x0b\x43haincodeID\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\"\x1e\n\x0e\x43haincodeInput\x12\x0c\n\x04\x61rgs\x18\x01 \x03(\x0c\"\xdc\x01\n\rChaincodeSpec\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.protos.ChaincodeSpec.Type\x12)\n\x0c\x63haincode_id\x18\x02 \x01(\x0b\x32\x13.protos.ChaincodeID\x12%\n\x05input\x18\x03 \x01(\x0b\x32\x16.protos.ChaincodeInput\x12\x0f\n\x07timeout\x18\x04 \x01(\x05\">\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\n\n\x06GOLANG\x10\x01\x12\x08\n\x04NODE\x10\x02\x12\x07\n\x03\x43\x41R\x10\x03\x12\x08\n\x04JAVA\x10\x04\"\x8a\x02\n\x17\x43haincodeDeploymentSpec\x12-\n\x0e\x63haincode_spec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x32\n\x0e\x65\x66\x66\x65\x63tive_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x63ode_package\x18\x03 \x01(\x0c\x12\x46\n\x08\x65xec_env\x18\x04 \x01(\x0e\x32\x34.protos.ChaincodeDeploymentSpec.ExecutionEnvironment\".\n\x14\x45xecutionEnvironment\x12\n\n\x06\x44OCKER\x10\x00\x12\n\n\x06SYSTEM\x10\x01\"c\n\x17\x43haincodeInvocationSpec\x12-\n\x0e\x63haincode_spec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x19\n\x11id_generation_alg\x18\x02 \x01(\t\">\n\x18\x43haincodeProposalContext\x12\x0f\n\x07\x63reator\x18\x01 \x01(\x0c\x12\x11\n\ttransient\x18\x02 \x01(\x0c\"\xc4\x04\n\x10\x43haincodeMessage\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.protos.ChaincodeMessage.Type\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x0c\n\x04txid\x18\x04 \x01(\t\x12:\n\x10proposal_context\x18\x05 \x01(\x0b\x32 .protos.ChaincodeProposalContext\x12/\n\x0f\x63haincode_event\x18\x06 \x01(\x0b\x32\x16.protos.ChaincodeEvent\"\xc7\x02\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\x0c\n\x08REGISTER\x10\x01\x12\x0e\n\nREGISTERED\x10\x02\x12\x08\n\x04INIT\x10\x03\x12\t\n\x05READY\x10\x04\x12\x0f\n\x0bTRANSACTION\x10\x05\x12\r\n\tCOMPLETED\x10\x06\x12\t\n\x05\x45RROR\x10\x07\x12\r\n\tGET_STATE\x10\x08\x12\r\n\tPUT_STATE\x10\t\x12\r\n\tDEL_STATE\x10\n\x12\x14\n\x10INVOKE_CHAINCODE\x10\x0b\x12\x0c\n\x08RESPONSE\x10\r\x12\x16\n\x12GET_STATE_BY_RANGE\x10\x0e\x12\x14\n\x10GET_QUERY_RESULT\x10\x0f\x12\x14\n\x10QUERY_STATE_NEXT\x10\x10\x12\x15\n\x11QUERY_STATE_CLOSE\x10\x11\x12\r\n\tKEEPALIVE\x10\x12\x12\x17\n\x13GET_HISTORY_FOR_KEY\x10\x13\"*\n\x0cPutStateInfo\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"3\n\x0fGetStateByRange\x12\x10\n\x08startKey\x18\x01 \x01(\t\x12\x0e\n\x06\x65ndKey\x18\x02 \x01(\t\"\x1f\n\x0eGetQueryResult\x12\r\n\x05query\x18\x01 \x01(\t\"\x1f\n\x10GetHistoryForKey\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1c\n\x0eQueryStateNext\x12\n\n\x02id\x18\x01 \x01(\t\"\x1d\n\x0fQueryStateClose\x12\n\n\x02id\x18\x01 \x01(\t\"0\n\x12QueryStateKeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"g\n\x12QueryStateResponse\x12\x33\n\x0fkeys_and_values\x18\x01 \x03(\x0b\x32\x1a.protos.QueryStateKeyValue\x12\x10\n\x08has_more\x18\x02 \x01(\x08\x12\n\n\x02id\x18\x03 \x01(\t*4\n\x14\x43onfidentialityLevel\x12\n\n\x06PUBLIC\x10\x00\x12\x10\n\x0c\x43ONFIDENTIAL\x10\x01\x32X\n\x10\x43haincodeSupport\x12\x44\n\x08Register\x12\x18.protos.ChaincodeMessage\x1a\x18.protos.ChaincodeMessage\"\x00(\x01\x30\x01\x42\x43\n\x16org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peerb\x06proto3') + serialized_pb=_b('\n\x14peer/chaincode.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\":\n\x0b\x43haincodeID\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\"\x1e\n\x0e\x43haincodeInput\x12\x0c\n\x04\x61rgs\x18\x01 \x03(\x0c\"\xdc\x01\n\rChaincodeSpec\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.protos.ChaincodeSpec.Type\x12)\n\x0c\x63haincode_id\x18\x02 \x01(\x0b\x32\x13.protos.ChaincodeID\x12%\n\x05input\x18\x03 \x01(\x0b\x32\x16.protos.ChaincodeInput\x12\x0f\n\x07timeout\x18\x04 \x01(\x05\">\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\n\n\x06GOLANG\x10\x01\x12\x08\n\x04NODE\x10\x02\x12\x07\n\x03\x43\x41R\x10\x03\x12\x08\n\x04JAVA\x10\x04\"\x8a\x02\n\x17\x43haincodeDeploymentSpec\x12-\n\x0e\x63haincode_spec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x32\n\x0e\x65\x66\x66\x65\x63tive_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x63ode_package\x18\x03 \x01(\x0c\x12\x46\n\x08\x65xec_env\x18\x04 \x01(\x0e\x32\x34.protos.ChaincodeDeploymentSpec.ExecutionEnvironment\".\n\x14\x45xecutionEnvironment\x12\n\n\x06\x44OCKER\x10\x00\x12\n\n\x06SYSTEM\x10\x01\"c\n\x17\x43haincodeInvocationSpec\x12-\n\x0e\x63haincode_spec\x18\x01 \x01(\x0b\x32\x15.protos.ChaincodeSpec\x12\x19\n\x11id_generation_alg\x18\x02 \x01(\t*4\n\x14\x43onfidentialityLevel\x12\n\n\x06PUBLIC\x10\x00\x12\x10\n\x0c\x43ONFIDENTIAL\x10\x01\x42\x43\n\x16org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peerb\x06proto3') , - dependencies=[peer_dot_chaincodeevent__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) + dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) _CONFIDENTIALITYLEVEL = _descriptor.EnumDescriptor( @@ -44,8 +43,8 @@ ], containing_type=None, options=None, - serialized_start=1803, - serialized_end=1855, + serialized_start=750, + serialized_end=802, ) _sym_db.RegisterEnumDescriptor(_CONFIDENTIALITYLEVEL) @@ -83,8 +82,8 @@ ], containing_type=None, options=None, - serialized_start=343, - serialized_end=405, + serialized_start=316, + serialized_end=378, ) _sym_db.RegisterEnumDescriptor(_CHAINCODESPEC_TYPE) @@ -105,101 +104,11 @@ ], containing_type=None, options=None, - serialized_start=628, - serialized_end=674, + serialized_start=601, + serialized_end=647, ) _sym_db.RegisterEnumDescriptor(_CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT) -_CHAINCODEMESSAGE_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='protos.ChaincodeMessage.Type', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNDEFINED', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='REGISTER', index=1, number=1, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='REGISTERED', index=2, number=2, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INIT', index=3, number=3, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='READY', index=4, number=4, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='TRANSACTION', index=5, number=5, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='COMPLETED', index=6, number=6, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='ERROR', index=7, number=7, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE', index=8, number=8, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PUT_STATE', index=9, number=9, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='DEL_STATE', index=10, number=10, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='INVOKE_CHAINCODE', index=11, number=11, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='RESPONSE', index=12, number=13, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_STATE_BY_RANGE', index=13, number=14, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_QUERY_RESULT', index=14, number=15, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='QUERY_STATE_NEXT', index=15, number=16, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='QUERY_STATE_CLOSE', index=16, number=17, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='KEEPALIVE', index=17, number=18, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='GET_HISTORY_FOR_KEY', index=18, number=19, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=1095, - serialized_end=1422, -) -_sym_db.RegisterEnumDescriptor(_CHAINCODEMESSAGE_TYPE) - _CHAINCODEID = _descriptor.Descriptor( name='ChaincodeID', @@ -241,8 +150,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=92, - serialized_end=150, + serialized_start=65, + serialized_end=123, ) @@ -272,8 +181,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=152, - serialized_end=182, + serialized_start=125, + serialized_end=155, ) @@ -325,8 +234,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=185, - serialized_end=405, + serialized_start=158, + serialized_end=378, ) @@ -378,8 +287,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=408, - serialized_end=674, + serialized_start=381, + serialized_end=647, ) @@ -416,396 +325,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=676, - serialized_end=775, -) - - -_CHAINCODEPROPOSALCONTEXT = _descriptor.Descriptor( - name='ChaincodeProposalContext', - full_name='protos.ChaincodeProposalContext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='creator', full_name='protos.ChaincodeProposalContext.creator', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='transient', full_name='protos.ChaincodeProposalContext.transient', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=777, - serialized_end=839, -) - - -_CHAINCODEMESSAGE = _descriptor.Descriptor( - name='ChaincodeMessage', - full_name='protos.ChaincodeMessage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='protos.ChaincodeMessage.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='protos.ChaincodeMessage.timestamp', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='payload', full_name='protos.ChaincodeMessage.payload', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='txid', full_name='protos.ChaincodeMessage.txid', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='proposal_context', full_name='protos.ChaincodeMessage.proposal_context', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chaincode_event', full_name='protos.ChaincodeMessage.chaincode_event', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CHAINCODEMESSAGE_TYPE, - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=842, - serialized_end=1422, -) - - -_PUTSTATEINFO = _descriptor.Descriptor( - name='PutStateInfo', - full_name='protos.PutStateInfo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.PutStateInfo.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='protos.PutStateInfo.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1424, - serialized_end=1466, -) - - -_GETSTATEBYRANGE = _descriptor.Descriptor( - name='GetStateByRange', - full_name='protos.GetStateByRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='startKey', full_name='protos.GetStateByRange.startKey', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='endKey', full_name='protos.GetStateByRange.endKey', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1468, - serialized_end=1519, -) - - -_GETQUERYRESULT = _descriptor.Descriptor( - name='GetQueryResult', - full_name='protos.GetQueryResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='query', full_name='protos.GetQueryResult.query', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1521, - serialized_end=1552, -) - - -_GETHISTORYFORKEY = _descriptor.Descriptor( - name='GetHistoryForKey', - full_name='protos.GetHistoryForKey', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.GetHistoryForKey.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1554, - serialized_end=1585, -) - - -_QUERYSTATENEXT = _descriptor.Descriptor( - name='QueryStateNext', - full_name='protos.QueryStateNext', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.QueryStateNext.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1587, - serialized_end=1615, -) - - -_QUERYSTATECLOSE = _descriptor.Descriptor( - name='QueryStateClose', - full_name='protos.QueryStateClose', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='protos.QueryStateClose.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1617, - serialized_end=1646, -) - - -_QUERYSTATEKEYVALUE = _descriptor.Descriptor( - name='QueryStateKeyValue', - full_name='protos.QueryStateKeyValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='protos.QueryStateKeyValue.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='protos.QueryStateKeyValue.value', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1648, - serialized_end=1696, -) - - -_QUERYSTATERESPONSE = _descriptor.Descriptor( - name='QueryStateResponse', - full_name='protos.QueryStateResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keys_and_values', full_name='protos.QueryStateResponse.keys_and_values', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='has_more', full_name='protos.QueryStateResponse.has_more', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='id', full_name='protos.QueryStateResponse.id', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1698, - serialized_end=1801, + serialized_start=649, + serialized_end=748, ) _CHAINCODESPEC.fields_by_name['type'].enum_type = _CHAINCODESPEC_TYPE @@ -817,27 +338,11 @@ _CHAINCODEDEPLOYMENTSPEC.fields_by_name['exec_env'].enum_type = _CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT _CHAINCODEDEPLOYMENTSPEC_EXECUTIONENVIRONMENT.containing_type = _CHAINCODEDEPLOYMENTSPEC _CHAINCODEINVOCATIONSPEC.fields_by_name['chaincode_spec'].message_type = _CHAINCODESPEC -_CHAINCODEMESSAGE.fields_by_name['type'].enum_type = _CHAINCODEMESSAGE_TYPE -_CHAINCODEMESSAGE.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CHAINCODEMESSAGE.fields_by_name['proposal_context'].message_type = _CHAINCODEPROPOSALCONTEXT -_CHAINCODEMESSAGE.fields_by_name['chaincode_event'].message_type = peer_dot_chaincodeevent__pb2._CHAINCODEEVENT -_CHAINCODEMESSAGE_TYPE.containing_type = _CHAINCODEMESSAGE -_QUERYSTATERESPONSE.fields_by_name['keys_and_values'].message_type = _QUERYSTATEKEYVALUE DESCRIPTOR.message_types_by_name['ChaincodeID'] = _CHAINCODEID DESCRIPTOR.message_types_by_name['ChaincodeInput'] = _CHAINCODEINPUT DESCRIPTOR.message_types_by_name['ChaincodeSpec'] = _CHAINCODESPEC DESCRIPTOR.message_types_by_name['ChaincodeDeploymentSpec'] = _CHAINCODEDEPLOYMENTSPEC DESCRIPTOR.message_types_by_name['ChaincodeInvocationSpec'] = _CHAINCODEINVOCATIONSPEC -DESCRIPTOR.message_types_by_name['ChaincodeProposalContext'] = _CHAINCODEPROPOSALCONTEXT -DESCRIPTOR.message_types_by_name['ChaincodeMessage'] = _CHAINCODEMESSAGE -DESCRIPTOR.message_types_by_name['PutStateInfo'] = _PUTSTATEINFO -DESCRIPTOR.message_types_by_name['GetStateByRange'] = _GETSTATEBYRANGE -DESCRIPTOR.message_types_by_name['GetQueryResult'] = _GETQUERYRESULT -DESCRIPTOR.message_types_by_name['GetHistoryForKey'] = _GETHISTORYFORKEY -DESCRIPTOR.message_types_by_name['QueryStateNext'] = _QUERYSTATENEXT -DESCRIPTOR.message_types_by_name['QueryStateClose'] = _QUERYSTATECLOSE -DESCRIPTOR.message_types_by_name['QueryStateKeyValue'] = _QUERYSTATEKEYVALUE -DESCRIPTOR.message_types_by_name['QueryStateResponse'] = _QUERYSTATERESPONSE DESCRIPTOR.enum_types_by_name['ConfidentialityLevel'] = _CONFIDENTIALITYLEVEL ChaincodeID = _reflection.GeneratedProtocolMessageType('ChaincodeID', (_message.Message,), dict( @@ -875,76 +380,6 @@ )) _sym_db.RegisterMessage(ChaincodeInvocationSpec) -ChaincodeProposalContext = _reflection.GeneratedProtocolMessageType('ChaincodeProposalContext', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEPROPOSALCONTEXT, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeProposalContext) - )) -_sym_db.RegisterMessage(ChaincodeProposalContext) - -ChaincodeMessage = _reflection.GeneratedProtocolMessageType('ChaincodeMessage', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEMESSAGE, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeMessage) - )) -_sym_db.RegisterMessage(ChaincodeMessage) - -PutStateInfo = _reflection.GeneratedProtocolMessageType('PutStateInfo', (_message.Message,), dict( - DESCRIPTOR = _PUTSTATEINFO, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.PutStateInfo) - )) -_sym_db.RegisterMessage(PutStateInfo) - -GetStateByRange = _reflection.GeneratedProtocolMessageType('GetStateByRange', (_message.Message,), dict( - DESCRIPTOR = _GETSTATEBYRANGE, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetStateByRange) - )) -_sym_db.RegisterMessage(GetStateByRange) - -GetQueryResult = _reflection.GeneratedProtocolMessageType('GetQueryResult', (_message.Message,), dict( - DESCRIPTOR = _GETQUERYRESULT, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetQueryResult) - )) -_sym_db.RegisterMessage(GetQueryResult) - -GetHistoryForKey = _reflection.GeneratedProtocolMessageType('GetHistoryForKey', (_message.Message,), dict( - DESCRIPTOR = _GETHISTORYFORKEY, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.GetHistoryForKey) - )) -_sym_db.RegisterMessage(GetHistoryForKey) - -QueryStateNext = _reflection.GeneratedProtocolMessageType('QueryStateNext', (_message.Message,), dict( - DESCRIPTOR = _QUERYSTATENEXT, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.QueryStateNext) - )) -_sym_db.RegisterMessage(QueryStateNext) - -QueryStateClose = _reflection.GeneratedProtocolMessageType('QueryStateClose', (_message.Message,), dict( - DESCRIPTOR = _QUERYSTATECLOSE, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.QueryStateClose) - )) -_sym_db.RegisterMessage(QueryStateClose) - -QueryStateKeyValue = _reflection.GeneratedProtocolMessageType('QueryStateKeyValue', (_message.Message,), dict( - DESCRIPTOR = _QUERYSTATEKEYVALUE, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.QueryStateKeyValue) - )) -_sym_db.RegisterMessage(QueryStateKeyValue) - -QueryStateResponse = _reflection.GeneratedProtocolMessageType('QueryStateResponse', (_message.Message,), dict( - DESCRIPTOR = _QUERYSTATERESPONSE, - __module__ = 'peer.chaincode_pb2' - # @@protoc_insertion_point(class_scope:protos.QueryStateResponse) - )) -_sym_db.RegisterMessage(QueryStateResponse) - DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\026org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peer')) @@ -956,112 +391,6 @@ from grpc.framework.interfaces.face import utilities as face_utilities from grpc.beta import implementations as beta_implementations from grpc.beta import interfaces as beta_interfaces - - - class ChaincodeSupportStub(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Register = channel.stream_stream( - '/protos.ChaincodeSupport/Register', - request_serializer=ChaincodeMessage.SerializeToString, - response_deserializer=ChaincodeMessage.FromString, - ) - - - class ChaincodeSupportServicer(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def Register(self, request_iterator, context): - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - - def add_ChaincodeSupportServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Register': grpc.stream_stream_rpc_method_handler( - servicer.Register, - request_deserializer=ChaincodeMessage.FromString, - response_serializer=ChaincodeMessage.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'protos.ChaincodeSupport', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - class BetaChaincodeSupportServicer(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - def Register(self, request_iterator, context): - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - - - class BetaChaincodeSupportStub(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - def Register(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): - raise NotImplementedError() - - - def beta_create_ChaincodeSupport_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_deserializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, - } - response_serializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, - } - method_implementations = { - ('protos.ChaincodeSupport', 'Register'): face_utilities.stream_stream_inline(servicer.Register), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - - - def beta_create_ChaincodeSupport_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_serializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, - } - response_deserializers = { - ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, - } - cardinalities = { - 'Register': cardinality.Cardinality.STREAM_STREAM, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'protos.ChaincodeSupport', cardinalities, options=stub_options) except ImportError: pass # @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/chaincode_pb2_grpc.py b/bddtests/peer/chaincode_pb2_grpc.py index a08334218d9..c374a4d7d5b 100644 --- a/bddtests/peer/chaincode_pb2_grpc.py +++ b/bddtests/peer/chaincode_pb2_grpc.py @@ -2,47 +2,3 @@ from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities -import peer.chaincode_pb2 as peer_dot_chaincode__pb2 -import peer.chaincode_pb2 as peer_dot_chaincode__pb2 - - -class ChaincodeSupportStub(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Register = channel.stream_stream( - '/protos.ChaincodeSupport/Register', - request_serializer=peer_dot_chaincode__pb2.ChaincodeMessage.SerializeToString, - response_deserializer=peer_dot_chaincode__pb2.ChaincodeMessage.FromString, - ) - - -class ChaincodeSupportServicer(object): - """Interface that provides support to chaincode execution. ChaincodeContext - provides the context necessary for the server to respond appropriately. - """ - - def Register(self, request_iterator, context): - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ChaincodeSupportServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Register': grpc.stream_stream_rpc_method_handler( - servicer.Register, - request_deserializer=peer_dot_chaincode__pb2.ChaincodeMessage.FromString, - response_serializer=peer_dot_chaincode__pb2.ChaincodeMessage.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'protos.ChaincodeSupport', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/bddtests/peer/chaincode_proposal_pb2.py b/bddtests/peer/chaincode_proposal_pb2.py deleted file mode 100644 index 08cd365f41f..00000000000 --- a/bddtests/peer/chaincode_proposal_pb2.py +++ /dev/null @@ -1,183 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: peer/chaincode_proposal.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from peer import chaincode_pb2 as peer_dot_chaincode__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='peer/chaincode_proposal.proto', - package='protos', - syntax='proto3', - serialized_pb=_b('\n\x1dpeer/chaincode_proposal.proto\x12\x06protos\x1a\x14peer/chaincode.proto\"_\n\x18\x43haincodeHeaderExtension\x12\x19\n\x11payloadVisibility\x18\x01 \x01(\x0c\x12(\n\x0b\x63haincodeID\x18\x02 \x01(\x0b\x32\x13.protos.ChaincodeID\"<\n\x18\x43haincodeProposalPayload\x12\r\n\x05Input\x18\x01 \x01(\x0c\x12\x11\n\tTransient\x18\x02 \x01(\x0c\"2\n\x0f\x43haincodeAction\x12\x0f\n\x07results\x18\x01 \x01(\x0c\x12\x0e\n\x06\x65vents\x18\x02 \x01(\x0c\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') - , - dependencies=[peer_dot_chaincode__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - - -_CHAINCODEHEADEREXTENSION = _descriptor.Descriptor( - name='ChaincodeHeaderExtension', - full_name='protos.ChaincodeHeaderExtension', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='payloadVisibility', full_name='protos.ChaincodeHeaderExtension.payloadVisibility', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='chaincodeID', full_name='protos.ChaincodeHeaderExtension.chaincodeID', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=63, - serialized_end=158, -) - - -_CHAINCODEPROPOSALPAYLOAD = _descriptor.Descriptor( - name='ChaincodeProposalPayload', - full_name='protos.ChaincodeProposalPayload', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='Input', full_name='protos.ChaincodeProposalPayload.Input', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='Transient', full_name='protos.ChaincodeProposalPayload.Transient', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=160, - serialized_end=220, -) - - -_CHAINCODEACTION = _descriptor.Descriptor( - name='ChaincodeAction', - full_name='protos.ChaincodeAction', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='results', full_name='protos.ChaincodeAction.results', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='events', full_name='protos.ChaincodeAction.events', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=222, - serialized_end=272, -) - -_CHAINCODEHEADEREXTENSION.fields_by_name['chaincodeID'].message_type = peer_dot_chaincode__pb2._CHAINCODEID -DESCRIPTOR.message_types_by_name['ChaincodeHeaderExtension'] = _CHAINCODEHEADEREXTENSION -DESCRIPTOR.message_types_by_name['ChaincodeProposalPayload'] = _CHAINCODEPROPOSALPAYLOAD -DESCRIPTOR.message_types_by_name['ChaincodeAction'] = _CHAINCODEACTION - -ChaincodeHeaderExtension = _reflection.GeneratedProtocolMessageType('ChaincodeHeaderExtension', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEHEADEREXTENSION, - __module__ = 'peer.chaincode_proposal_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeHeaderExtension) - )) -_sym_db.RegisterMessage(ChaincodeHeaderExtension) - -ChaincodeProposalPayload = _reflection.GeneratedProtocolMessageType('ChaincodeProposalPayload', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEPROPOSALPAYLOAD, - __module__ = 'peer.chaincode_proposal_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeProposalPayload) - )) -_sym_db.RegisterMessage(ChaincodeProposalPayload) - -ChaincodeAction = _reflection.GeneratedProtocolMessageType('ChaincodeAction', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEACTION, - __module__ = 'peer.chaincode_proposal_pb2' - # @@protoc_insertion_point(class_scope:protos.ChaincodeAction) - )) -_sym_db.RegisterMessage(ChaincodeAction) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) -try: - # THESE ELEMENTS WILL BE DEPRECATED. - # Please use the generated *_pb2_grpc.py files instead. - import grpc - from grpc.framework.common import cardinality - from grpc.framework.interfaces.face import utilities as face_utilities - from grpc.beta import implementations as beta_implementations - from grpc.beta import interfaces as beta_interfaces -except ImportError: - pass -# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/chaincodeevent_pb2.py b/bddtests/peer/chaincodeevent_pb2.py index 4583be914b0..5832b26bae0 100644 --- a/bddtests/peer/chaincodeevent_pb2.py +++ b/bddtests/peer/chaincodeevent_pb2.py @@ -19,7 +19,7 @@ name='peer/chaincodeevent.proto', package='protos', syntax='proto3', - serialized_pb=_b('\n\x19peer/chaincodeevent.proto\x12\x06protos\"W\n\x0e\x43haincodeEvent\x12\x13\n\x0b\x63haincodeID\x18\x01 \x01(\t\x12\x0c\n\x04txID\x18\x02 \x01(\t\x12\x11\n\teventName\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\x42\x43\n\x16org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peerb\x06proto3') + serialized_pb=_b('\n\x19peer/chaincodeevent.proto\x12\x06protos\"Z\n\x0e\x43haincodeEvent\x12\x14\n\x0c\x63haincode_id\x18\x01 \x01(\t\x12\r\n\x05tx_id\x18\x02 \x01(\t\x12\x12\n\nevent_name\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\x42\x43\n\x16org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peerb\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -34,21 +34,21 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='chaincodeID', full_name='protos.ChaincodeEvent.chaincodeID', index=0, + name='chaincode_id', full_name='protos.ChaincodeEvent.chaincode_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='txID', full_name='protos.ChaincodeEvent.txID', index=1, + name='tx_id', full_name='protos.ChaincodeEvent.tx_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='eventName', full_name='protos.ChaincodeEvent.eventName', index=2, + name='event_name', full_name='protos.ChaincodeEvent.event_name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, @@ -74,7 +74,7 @@ oneofs=[ ], serialized_start=37, - serialized_end=124, + serialized_end=127, ) DESCRIPTOR.message_types_by_name['ChaincodeEvent'] = _CHAINCODEEVENT diff --git a/bddtests/peer/chaincodeshim_pb2.py b/bddtests/peer/chaincodeshim_pb2.py new file mode 100644 index 00000000000..88bb86c78ea --- /dev/null +++ b/bddtests/peer/chaincodeshim_pb2.py @@ -0,0 +1,670 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: peer/chaincodeshim.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from peer import chaincodeevent_pb2 as peer_dot_chaincodeevent__pb2 +from peer import proposal_pb2 as peer_dot_proposal__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='peer/chaincodeshim.proto', + package='protos', + syntax='proto3', + serialized_pb=_b('\n\x18peer/chaincodeshim.proto\x12\x06protos\x1a\x19peer/chaincodeevent.proto\x1a\x13peer/proposal.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x04\n\x10\x43haincodeMessage\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.protos.ChaincodeMessage.Type\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\x12\x0c\n\x04txid\x18\x04 \x01(\t\x12\"\n\x08proposal\x18\x05 \x01(\x0b\x32\x10.protos.Proposal\x12/\n\x0f\x63haincode_event\x18\x06 \x01(\x0b\x32\x16.protos.ChaincodeEvent\"\xc7\x02\n\x04Type\x12\r\n\tUNDEFINED\x10\x00\x12\x0c\n\x08REGISTER\x10\x01\x12\x0e\n\nREGISTERED\x10\x02\x12\x08\n\x04INIT\x10\x03\x12\t\n\x05READY\x10\x04\x12\x0f\n\x0bTRANSACTION\x10\x05\x12\r\n\tCOMPLETED\x10\x06\x12\t\n\x05\x45RROR\x10\x07\x12\r\n\tGET_STATE\x10\x08\x12\r\n\tPUT_STATE\x10\t\x12\r\n\tDEL_STATE\x10\n\x12\x14\n\x10INVOKE_CHAINCODE\x10\x0b\x12\x0c\n\x08RESPONSE\x10\r\x12\x16\n\x12GET_STATE_BY_RANGE\x10\x0e\x12\x14\n\x10GET_QUERY_RESULT\x10\x0f\x12\x14\n\x10QUERY_STATE_NEXT\x10\x10\x12\x15\n\x11QUERY_STATE_CLOSE\x10\x11\x12\r\n\tKEEPALIVE\x10\x12\x12\x17\n\x13GET_HISTORY_FOR_KEY\x10\x13\"*\n\x0cPutStateInfo\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"3\n\x0fGetStateByRange\x12\x10\n\x08startKey\x18\x01 \x01(\t\x12\x0e\n\x06\x65ndKey\x18\x02 \x01(\t\"\x1f\n\x0eGetQueryResult\x12\r\n\x05query\x18\x01 \x01(\t\"\x1f\n\x10GetHistoryForKey\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1c\n\x0eQueryStateNext\x12\n\n\x02id\x18\x01 \x01(\t\"\x1d\n\x0fQueryStateClose\x12\n\n\x02id\x18\x01 \x01(\t\"0\n\x12QueryStateKeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\"g\n\x12QueryStateResponse\x12\x33\n\x0fkeys_and_values\x18\x01 \x03(\x0b\x32\x1a.protos.QueryStateKeyValue\x12\x10\n\x08has_more\x18\x02 \x01(\x08\x12\n\n\x02id\x18\x03 \x01(\t2X\n\x10\x43haincodeSupport\x12\x44\n\x08Register\x12\x18.protos.ChaincodeMessage\x1a\x18.protos.ChaincodeMessage\"\x00(\x01\x30\x01\x42\x43\n\x16org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peerb\x06proto3') + , + dependencies=[peer_dot_chaincodeevent__pb2.DESCRIPTOR,peer_dot_proposal__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_CHAINCODEMESSAGE_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='protos.ChaincodeMessage.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNDEFINED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='REGISTER', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='REGISTERED', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INIT', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='READY', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TRANSACTION', index=5, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='COMPLETED', index=6, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ERROR', index=7, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GET_STATE', index=8, number=8, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PUT_STATE', index=9, number=9, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DEL_STATE', index=10, number=10, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INVOKE_CHAINCODE', index=11, number=11, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RESPONSE', index=12, number=13, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GET_STATE_BY_RANGE', index=13, number=14, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GET_QUERY_RESULT', index=14, number=15, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='QUERY_STATE_NEXT', index=15, number=16, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='QUERY_STATE_CLOSE', index=16, number=17, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='KEEPALIVE', index=17, number=18, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GET_HISTORY_FOR_KEY', index=18, number=19, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=347, + serialized_end=674, +) +_sym_db.RegisterEnumDescriptor(_CHAINCODEMESSAGE_TYPE) + + +_CHAINCODEMESSAGE = _descriptor.Descriptor( + name='ChaincodeMessage', + full_name='protos.ChaincodeMessage', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='protos.ChaincodeMessage.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='timestamp', full_name='protos.ChaincodeMessage.timestamp', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='protos.ChaincodeMessage.payload', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='txid', full_name='protos.ChaincodeMessage.txid', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='proposal', full_name='protos.ChaincodeMessage.proposal', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='chaincode_event', full_name='protos.ChaincodeMessage.chaincode_event', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CHAINCODEMESSAGE_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=118, + serialized_end=674, +) + + +_PUTSTATEINFO = _descriptor.Descriptor( + name='PutStateInfo', + full_name='protos.PutStateInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='protos.PutStateInfo.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='protos.PutStateInfo.value', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=718, +) + + +_GETSTATEBYRANGE = _descriptor.Descriptor( + name='GetStateByRange', + full_name='protos.GetStateByRange', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='startKey', full_name='protos.GetStateByRange.startKey', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='endKey', full_name='protos.GetStateByRange.endKey', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=720, + serialized_end=771, +) + + +_GETQUERYRESULT = _descriptor.Descriptor( + name='GetQueryResult', + full_name='protos.GetQueryResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='query', full_name='protos.GetQueryResult.query', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=773, + serialized_end=804, +) + + +_GETHISTORYFORKEY = _descriptor.Descriptor( + name='GetHistoryForKey', + full_name='protos.GetHistoryForKey', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='protos.GetHistoryForKey.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=806, + serialized_end=837, +) + + +_QUERYSTATENEXT = _descriptor.Descriptor( + name='QueryStateNext', + full_name='protos.QueryStateNext', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='protos.QueryStateNext.id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=839, + serialized_end=867, +) + + +_QUERYSTATECLOSE = _descriptor.Descriptor( + name='QueryStateClose', + full_name='protos.QueryStateClose', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='protos.QueryStateClose.id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=869, + serialized_end=898, +) + + +_QUERYSTATEKEYVALUE = _descriptor.Descriptor( + name='QueryStateKeyValue', + full_name='protos.QueryStateKeyValue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='protos.QueryStateKeyValue.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='protos.QueryStateKeyValue.value', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=900, + serialized_end=948, +) + + +_QUERYSTATERESPONSE = _descriptor.Descriptor( + name='QueryStateResponse', + full_name='protos.QueryStateResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='keys_and_values', full_name='protos.QueryStateResponse.keys_and_values', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='has_more', full_name='protos.QueryStateResponse.has_more', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='id', full_name='protos.QueryStateResponse.id', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=950, + serialized_end=1053, +) + +_CHAINCODEMESSAGE.fields_by_name['type'].enum_type = _CHAINCODEMESSAGE_TYPE +_CHAINCODEMESSAGE.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_CHAINCODEMESSAGE.fields_by_name['proposal'].message_type = peer_dot_proposal__pb2._PROPOSAL +_CHAINCODEMESSAGE.fields_by_name['chaincode_event'].message_type = peer_dot_chaincodeevent__pb2._CHAINCODEEVENT +_CHAINCODEMESSAGE_TYPE.containing_type = _CHAINCODEMESSAGE +_QUERYSTATERESPONSE.fields_by_name['keys_and_values'].message_type = _QUERYSTATEKEYVALUE +DESCRIPTOR.message_types_by_name['ChaincodeMessage'] = _CHAINCODEMESSAGE +DESCRIPTOR.message_types_by_name['PutStateInfo'] = _PUTSTATEINFO +DESCRIPTOR.message_types_by_name['GetStateByRange'] = _GETSTATEBYRANGE +DESCRIPTOR.message_types_by_name['GetQueryResult'] = _GETQUERYRESULT +DESCRIPTOR.message_types_by_name['GetHistoryForKey'] = _GETHISTORYFORKEY +DESCRIPTOR.message_types_by_name['QueryStateNext'] = _QUERYSTATENEXT +DESCRIPTOR.message_types_by_name['QueryStateClose'] = _QUERYSTATECLOSE +DESCRIPTOR.message_types_by_name['QueryStateKeyValue'] = _QUERYSTATEKEYVALUE +DESCRIPTOR.message_types_by_name['QueryStateResponse'] = _QUERYSTATERESPONSE + +ChaincodeMessage = _reflection.GeneratedProtocolMessageType('ChaincodeMessage', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEMESSAGE, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeMessage) + )) +_sym_db.RegisterMessage(ChaincodeMessage) + +PutStateInfo = _reflection.GeneratedProtocolMessageType('PutStateInfo', (_message.Message,), dict( + DESCRIPTOR = _PUTSTATEINFO, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.PutStateInfo) + )) +_sym_db.RegisterMessage(PutStateInfo) + +GetStateByRange = _reflection.GeneratedProtocolMessageType('GetStateByRange', (_message.Message,), dict( + DESCRIPTOR = _GETSTATEBYRANGE, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.GetStateByRange) + )) +_sym_db.RegisterMessage(GetStateByRange) + +GetQueryResult = _reflection.GeneratedProtocolMessageType('GetQueryResult', (_message.Message,), dict( + DESCRIPTOR = _GETQUERYRESULT, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.GetQueryResult) + )) +_sym_db.RegisterMessage(GetQueryResult) + +GetHistoryForKey = _reflection.GeneratedProtocolMessageType('GetHistoryForKey', (_message.Message,), dict( + DESCRIPTOR = _GETHISTORYFORKEY, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.GetHistoryForKey) + )) +_sym_db.RegisterMessage(GetHistoryForKey) + +QueryStateNext = _reflection.GeneratedProtocolMessageType('QueryStateNext', (_message.Message,), dict( + DESCRIPTOR = _QUERYSTATENEXT, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.QueryStateNext) + )) +_sym_db.RegisterMessage(QueryStateNext) + +QueryStateClose = _reflection.GeneratedProtocolMessageType('QueryStateClose', (_message.Message,), dict( + DESCRIPTOR = _QUERYSTATECLOSE, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.QueryStateClose) + )) +_sym_db.RegisterMessage(QueryStateClose) + +QueryStateKeyValue = _reflection.GeneratedProtocolMessageType('QueryStateKeyValue', (_message.Message,), dict( + DESCRIPTOR = _QUERYSTATEKEYVALUE, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.QueryStateKeyValue) + )) +_sym_db.RegisterMessage(QueryStateKeyValue) + +QueryStateResponse = _reflection.GeneratedProtocolMessageType('QueryStateResponse', (_message.Message,), dict( + DESCRIPTOR = _QUERYSTATERESPONSE, + __module__ = 'peer.chaincodeshim_pb2' + # @@protoc_insertion_point(class_scope:protos.QueryStateResponse) + )) +_sym_db.RegisterMessage(QueryStateResponse) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\026org.hyperledger.protosZ)github.com/hyperledger/fabric/protos/peer')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + + + class ChaincodeSupportStub(object): + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Register = channel.stream_stream( + '/protos.ChaincodeSupport/Register', + request_serializer=ChaincodeMessage.SerializeToString, + response_deserializer=ChaincodeMessage.FromString, + ) + + + class ChaincodeSupportServicer(object): + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + + def Register(self, request_iterator, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_ChaincodeSupportServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Register': grpc.stream_stream_rpc_method_handler( + servicer.Register, + request_deserializer=ChaincodeMessage.FromString, + response_serializer=ChaincodeMessage.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.ChaincodeSupport', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaChaincodeSupportServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + def Register(self, request_iterator, context): + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaChaincodeSupportStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + def Register(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): + raise NotImplementedError() + + + def beta_create_ChaincodeSupport_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, + } + response_serializers = { + ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, + } + method_implementations = { + ('protos.ChaincodeSupport', 'Register'): face_utilities.stream_stream_inline(servicer.Register), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_ChaincodeSupport_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString, + } + response_deserializers = { + ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString, + } + cardinalities = { + 'Register': cardinality.Cardinality.STREAM_STREAM, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'protos.ChaincodeSupport', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/chaincodeshim_pb2_grpc.py b/bddtests/peer/chaincodeshim_pb2_grpc.py new file mode 100644 index 00000000000..f9b5bc63370 --- /dev/null +++ b/bddtests/peer/chaincodeshim_pb2_grpc.py @@ -0,0 +1,48 @@ +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + +import peer.chaincodeshim_pb2 as peer_dot_chaincodeshim__pb2 +import peer.chaincodeshim_pb2 as peer_dot_chaincodeshim__pb2 + + +class ChaincodeSupportStub(object): + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Register = channel.stream_stream( + '/protos.ChaincodeSupport/Register', + request_serializer=peer_dot_chaincodeshim__pb2.ChaincodeMessage.SerializeToString, + response_deserializer=peer_dot_chaincodeshim__pb2.ChaincodeMessage.FromString, + ) + + +class ChaincodeSupportServicer(object): + """Interface that provides support to chaincode execution. ChaincodeContext + provides the context necessary for the server to respond appropriately. + """ + + def Register(self, request_iterator, context): + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ChaincodeSupportServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Register': grpc.stream_stream_rpc_method_handler( + servicer.Register, + request_deserializer=peer_dot_chaincodeshim__pb2.ChaincodeMessage.FromString, + response_serializer=peer_dot_chaincodeshim__pb2.ChaincodeMessage.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.ChaincodeSupport', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/bddtests/peer/configuration_pb2.py b/bddtests/peer/configuration_pb2.py index 735689534ff..eb22a5827d3 100644 --- a/bddtests/peer/configuration_pb2.py +++ b/bddtests/peer/configuration_pb2.py @@ -19,7 +19,7 @@ name='peer/configuration.proto', package='protos', syntax='proto3', - serialized_pb=_b('\n\x18peer/configuration.proto\x12\x06protos\"7\n\x0b\x41nchorPeers\x12(\n\x0c\x61nchor_peers\x18\x01 \x03(\x0b\x32\x12.protos.AnchorPeer\"6\n\nAnchorPeer\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\x05\x12\x0c\n\x04\x63\x65rt\x18\x03 \x01(\x0c\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + serialized_pb=_b('\n\x18peer/configuration.proto\x12\x06protos\"7\n\x0b\x41nchorPeers\x12(\n\x0c\x61nchor_peers\x18\x01 \x03(\x0b\x32\x12.protos.AnchorPeer\"(\n\nAnchorPeer\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\x05\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -78,13 +78,6 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), - _descriptor.FieldDescriptor( - name='cert', full_name='protos.AnchorPeer.cert', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), ], extensions=[ ], @@ -98,7 +91,7 @@ oneofs=[ ], serialized_start=93, - serialized_end=147, + serialized_end=133, ) _ANCHORPEERS.fields_by_name['anchor_peers'].message_type = _ANCHORPEER diff --git a/bddtests/peer/events_pb2.py b/bddtests/peer/events_pb2.py new file mode 100644 index 00000000000..086fa78f58a --- /dev/null +++ b/bddtests/peer/events_pb2.py @@ -0,0 +1,568 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: peer/events.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from common import common_pb2 as common_dot_common__pb2 +from peer import chaincodeevent_pb2 as peer_dot_chaincodeevent__pb2 +from peer import transaction_pb2 as peer_dot_transaction__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='peer/events.proto', + package='protos', + syntax='proto3', + serialized_pb=_b('\n\x11peer/events.proto\x12\x06protos\x1a\x13\x63ommon/common.proto\x1a\x19peer/chaincodeevent.proto\x1a\x16peer/transaction.proto\"8\n\x0c\x43haincodeReg\x12\x14\n\x0c\x63haincode_id\x18\x01 \x01(\t\x12\x12\n\nevent_name\x18\x02 \x01(\t\"\x81\x01\n\x08Interest\x12%\n\nevent_type\x18\x01 \x01(\x0e\x32\x11.protos.EventType\x12\x32\n\x12\x63haincode_reg_info\x18\x02 \x01(\x0b\x32\x14.protos.ChaincodeRegH\x00\x12\x0f\n\x07\x63hainID\x18\x03 \x01(\tB\t\n\x07RegInfo\",\n\x08Register\x12 \n\x06\x65vents\x18\x01 \x03(\x0b\x32\x10.protos.Interest\"?\n\tRejection\x12\x1f\n\x02tx\x18\x01 \x01(\x0b\x32\x13.protos.Transaction\x12\x11\n\terror_msg\x18\x02 \x01(\t\".\n\nUnregister\x12 \n\x06\x65vents\x18\x01 \x03(\x0b\x32\x10.protos.Interest\"4\n\x0bSignedEvent\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x12\n\neventBytes\x18\x02 \x01(\x0c\"\xec\x01\n\x05\x45vent\x12$\n\x08register\x18\x01 \x01(\x0b\x32\x10.protos.RegisterH\x00\x12\x1e\n\x05\x62lock\x18\x02 \x01(\x0b\x32\r.common.BlockH\x00\x12\x31\n\x0f\x63haincode_event\x18\x03 \x01(\x0b\x32\x16.protos.ChaincodeEventH\x00\x12&\n\trejection\x18\x04 \x01(\x0b\x32\x11.protos.RejectionH\x00\x12(\n\nunregister\x18\x05 \x01(\x0b\x32\x12.protos.UnregisterH\x00\x12\x0f\n\x07\x63reator\x18\x06 \x01(\x0c\x42\x07\n\x05\x45vent*B\n\tEventType\x12\x0c\n\x08REGISTER\x10\x00\x12\t\n\x05\x42LOCK\x10\x01\x12\r\n\tCHAINCODE\x10\x02\x12\r\n\tREJECTION\x10\x03\x32\x34\n\x06\x45vents\x12*\n\x04\x43hat\x12\r.protos.Event\x1a\r.protos.Event\"\x00(\x01\x30\x01\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + , + dependencies=[common_dot_common__pb2.DESCRIPTOR,peer_dot_chaincodeevent__pb2.DESCRIPTOR,peer_dot_transaction__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_EVENTTYPE = _descriptor.EnumDescriptor( + name='EventType', + full_name='protos.EventType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='REGISTER', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BLOCK', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CHAINCODE', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='REJECTION', index=3, number=3, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=743, + serialized_end=809, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPE) + +EventType = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPE) +REGISTER = 0 +BLOCK = 1 +CHAINCODE = 2 +REJECTION = 3 + + + +_CHAINCODEREG = _descriptor.Descriptor( + name='ChaincodeReg', + full_name='protos.ChaincodeReg', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='chaincode_id', full_name='protos.ChaincodeReg.chaincode_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='event_name', full_name='protos.ChaincodeReg.event_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=101, + serialized_end=157, +) + + +_INTEREST = _descriptor.Descriptor( + name='Interest', + full_name='protos.Interest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='event_type', full_name='protos.Interest.event_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='chaincode_reg_info', full_name='protos.Interest.chaincode_reg_info', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='chainID', full_name='protos.Interest.chainID', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='RegInfo', full_name='protos.Interest.RegInfo', + index=0, containing_type=None, fields=[]), + ], + serialized_start=160, + serialized_end=289, +) + + +_REGISTER = _descriptor.Descriptor( + name='Register', + full_name='protos.Register', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='events', full_name='protos.Register.events', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=291, + serialized_end=335, +) + + +_REJECTION = _descriptor.Descriptor( + name='Rejection', + full_name='protos.Rejection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tx', full_name='protos.Rejection.tx', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='error_msg', full_name='protos.Rejection.error_msg', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=337, + serialized_end=400, +) + + +_UNREGISTER = _descriptor.Descriptor( + name='Unregister', + full_name='protos.Unregister', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='events', full_name='protos.Unregister.events', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=402, + serialized_end=448, +) + + +_SIGNEDEVENT = _descriptor.Descriptor( + name='SignedEvent', + full_name='protos.SignedEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='signature', full_name='protos.SignedEvent.signature', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='eventBytes', full_name='protos.SignedEvent.eventBytes', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=450, + serialized_end=502, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='protos.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='register', full_name='protos.Event.register', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='block', full_name='protos.Event.block', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='chaincode_event', full_name='protos.Event.chaincode_event', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='rejection', full_name='protos.Event.rejection', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='unregister', full_name='protos.Event.unregister', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='creator', full_name='protos.Event.creator', index=5, + number=6, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='Event', full_name='protos.Event.Event', + index=0, containing_type=None, fields=[]), + ], + serialized_start=505, + serialized_end=741, +) + +_INTEREST.fields_by_name['event_type'].enum_type = _EVENTTYPE +_INTEREST.fields_by_name['chaincode_reg_info'].message_type = _CHAINCODEREG +_INTEREST.oneofs_by_name['RegInfo'].fields.append( + _INTEREST.fields_by_name['chaincode_reg_info']) +_INTEREST.fields_by_name['chaincode_reg_info'].containing_oneof = _INTEREST.oneofs_by_name['RegInfo'] +_REGISTER.fields_by_name['events'].message_type = _INTEREST +_REJECTION.fields_by_name['tx'].message_type = peer_dot_transaction__pb2._TRANSACTION +_UNREGISTER.fields_by_name['events'].message_type = _INTEREST +_EVENT.fields_by_name['register'].message_type = _REGISTER +_EVENT.fields_by_name['block'].message_type = common_dot_common__pb2._BLOCK +_EVENT.fields_by_name['chaincode_event'].message_type = peer_dot_chaincodeevent__pb2._CHAINCODEEVENT +_EVENT.fields_by_name['rejection'].message_type = _REJECTION +_EVENT.fields_by_name['unregister'].message_type = _UNREGISTER +_EVENT.oneofs_by_name['Event'].fields.append( + _EVENT.fields_by_name['register']) +_EVENT.fields_by_name['register'].containing_oneof = _EVENT.oneofs_by_name['Event'] +_EVENT.oneofs_by_name['Event'].fields.append( + _EVENT.fields_by_name['block']) +_EVENT.fields_by_name['block'].containing_oneof = _EVENT.oneofs_by_name['Event'] +_EVENT.oneofs_by_name['Event'].fields.append( + _EVENT.fields_by_name['chaincode_event']) +_EVENT.fields_by_name['chaincode_event'].containing_oneof = _EVENT.oneofs_by_name['Event'] +_EVENT.oneofs_by_name['Event'].fields.append( + _EVENT.fields_by_name['rejection']) +_EVENT.fields_by_name['rejection'].containing_oneof = _EVENT.oneofs_by_name['Event'] +_EVENT.oneofs_by_name['Event'].fields.append( + _EVENT.fields_by_name['unregister']) +_EVENT.fields_by_name['unregister'].containing_oneof = _EVENT.oneofs_by_name['Event'] +DESCRIPTOR.message_types_by_name['ChaincodeReg'] = _CHAINCODEREG +DESCRIPTOR.message_types_by_name['Interest'] = _INTEREST +DESCRIPTOR.message_types_by_name['Register'] = _REGISTER +DESCRIPTOR.message_types_by_name['Rejection'] = _REJECTION +DESCRIPTOR.message_types_by_name['Unregister'] = _UNREGISTER +DESCRIPTOR.message_types_by_name['SignedEvent'] = _SIGNEDEVENT +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.enum_types_by_name['EventType'] = _EVENTTYPE + +ChaincodeReg = _reflection.GeneratedProtocolMessageType('ChaincodeReg', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEREG, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeReg) + )) +_sym_db.RegisterMessage(ChaincodeReg) + +Interest = _reflection.GeneratedProtocolMessageType('Interest', (_message.Message,), dict( + DESCRIPTOR = _INTEREST, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.Interest) + )) +_sym_db.RegisterMessage(Interest) + +Register = _reflection.GeneratedProtocolMessageType('Register', (_message.Message,), dict( + DESCRIPTOR = _REGISTER, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.Register) + )) +_sym_db.RegisterMessage(Register) + +Rejection = _reflection.GeneratedProtocolMessageType('Rejection', (_message.Message,), dict( + DESCRIPTOR = _REJECTION, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.Rejection) + )) +_sym_db.RegisterMessage(Rejection) + +Unregister = _reflection.GeneratedProtocolMessageType('Unregister', (_message.Message,), dict( + DESCRIPTOR = _UNREGISTER, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.Unregister) + )) +_sym_db.RegisterMessage(Unregister) + +SignedEvent = _reflection.GeneratedProtocolMessageType('SignedEvent', (_message.Message,), dict( + DESCRIPTOR = _SIGNEDEVENT, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.SignedEvent) + )) +_sym_db.RegisterMessage(SignedEvent) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), dict( + DESCRIPTOR = _EVENT, + __module__ = 'peer.events_pb2' + # @@protoc_insertion_point(class_scope:protos.Event) + )) +_sym_db.RegisterMessage(Event) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + + + class EventsStub(object): + """Interface exported by the events server + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Chat = channel.stream_stream( + '/protos.Events/Chat', + request_serializer=Event.SerializeToString, + response_deserializer=Event.FromString, + ) + + + class EventsServicer(object): + """Interface exported by the events server + """ + + def Chat(self, request_iterator, context): + """event chatting using Event + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_EventsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Chat': grpc.stream_stream_rpc_method_handler( + servicer.Chat, + request_deserializer=Event.FromString, + response_serializer=Event.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.Events', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaEventsServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface exported by the events server + """ + def Chat(self, request_iterator, context): + """event chatting using Event + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaEventsStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Interface exported by the events server + """ + def Chat(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): + """event chatting using Event + """ + raise NotImplementedError() + + + def beta_create_Events_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('protos.Events', 'Chat'): Event.FromString, + } + response_serializers = { + ('protos.Events', 'Chat'): Event.SerializeToString, + } + method_implementations = { + ('protos.Events', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Events_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('protos.Events', 'Chat'): Event.SerializeToString, + } + response_deserializers = { + ('protos.Events', 'Chat'): Event.FromString, + } + cardinalities = { + 'Chat': cardinality.Cardinality.STREAM_STREAM, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'protos.Events', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/events_pb2_grpc.py b/bddtests/peer/events_pb2_grpc.py new file mode 100644 index 00000000000..e071365d910 --- /dev/null +++ b/bddtests/peer/events_pb2_grpc.py @@ -0,0 +1,48 @@ +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + +import peer.events_pb2 as peer_dot_events__pb2 +import peer.events_pb2 as peer_dot_events__pb2 + + +class EventsStub(object): + """Interface exported by the events server + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Chat = channel.stream_stream( + '/protos.Events/Chat', + request_serializer=peer_dot_events__pb2.Event.SerializeToString, + response_deserializer=peer_dot_events__pb2.Event.FromString, + ) + + +class EventsServicer(object): + """Interface exported by the events server + """ + + def Chat(self, request_iterator, context): + """event chatting using Event + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_EventsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Chat': grpc.stream_stream_rpc_method_handler( + servicer.Chat, + request_deserializer=peer_dot_events__pb2.Event.FromString, + response_serializer=peer_dot_events__pb2.Event.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'protos.Events', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/bddtests/peer/peer_pb2.py b/bddtests/peer/peer_pb2.py index 1f5154b6937..16912a47287 100644 --- a/bddtests/peer/peer_pb2.py +++ b/bddtests/peer/peer_pb2.py @@ -21,7 +21,7 @@ name='peer/peer.proto', package='protos', syntax='proto3', - serialized_pb=_b('\n\x0fpeer/peer.proto\x12\x06protos\x1a\x13peer/proposal.proto\x1a\x1cpeer/proposal_response.proto\"\x16\n\x06PeerID\x12\x0c\n\x04name\x18\x01 \x01(\t\";\n\x0cPeerEndpoint\x12\x1a\n\x02ID\x18\x01 \x01(\x0b\x32\x0e.protos.PeerID\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\"U\n\x0e\x42lockchainInfo\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x18\n\x10\x63urrentBlockHash\x18\x02 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x03 \x01(\x0c\x32Q\n\x08\x45ndorser\x12\x45\n\x0fProcessProposal\x12\x16.protos.SignedProposal\x1a\x18.protos.ProposalResponse\"\x00\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + serialized_pb=_b('\n\x0fpeer/peer.proto\x12\x06protos\x1a\x13peer/proposal.proto\x1a\x1cpeer/proposal_response.proto\"\x16\n\x06PeerID\x12\x0c\n\x04name\x18\x01 \x01(\t\";\n\x0cPeerEndpoint\x12\x1a\n\x02id\x18\x01 \x01(\x0b\x32\x0e.protos.PeerID\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t2Q\n\x08\x45ndorser\x12\x45\n\x0fProcessProposal\x12\x16.protos.SignedProposal\x1a\x18.protos.ProposalResponse\"\x00\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') , dependencies=[peer_dot_proposal__pb2.DESCRIPTOR,peer_dot_proposal__response__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -68,7 +68,7 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='ID', full_name='protos.PeerEndpoint.ID', index=0, + name='id', full_name='protos.PeerEndpoint.id', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -97,55 +97,9 @@ serialized_end=161, ) - -_BLOCKCHAININFO = _descriptor.Descriptor( - name='BlockchainInfo', - full_name='protos.BlockchainInfo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='height', full_name='protos.BlockchainInfo.height', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='currentBlockHash', full_name='protos.BlockchainInfo.currentBlockHash', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - _descriptor.FieldDescriptor( - name='previousBlockHash', full_name='protos.BlockchainInfo.previousBlockHash', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=163, - serialized_end=248, -) - -_PEERENDPOINT.fields_by_name['ID'].message_type = _PEERID +_PEERENDPOINT.fields_by_name['id'].message_type = _PEERID DESCRIPTOR.message_types_by_name['PeerID'] = _PEERID DESCRIPTOR.message_types_by_name['PeerEndpoint'] = _PEERENDPOINT -DESCRIPTOR.message_types_by_name['BlockchainInfo'] = _BLOCKCHAININFO PeerID = _reflection.GeneratedProtocolMessageType('PeerID', (_message.Message,), dict( DESCRIPTOR = _PEERID, @@ -161,13 +115,6 @@ )) _sym_db.RegisterMessage(PeerEndpoint) -BlockchainInfo = _reflection.GeneratedProtocolMessageType('BlockchainInfo', (_message.Message,), dict( - DESCRIPTOR = _BLOCKCHAININFO, - __module__ = 'peer.peer_pb2' - # @@protoc_insertion_point(class_scope:protos.BlockchainInfo) - )) -_sym_db.RegisterMessage(BlockchainInfo) - DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) @@ -182,9 +129,6 @@ class EndorserStub(object): - """-------- the Endorser service ------------ - - """ def __init__(self, channel): """Constructor. @@ -200,9 +144,6 @@ def __init__(self, channel): class EndorserServicer(object): - """-------- the Endorser service ------------ - - """ def ProcessProposal(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -229,9 +170,6 @@ class BetaEndorserServicer(object): It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This class was generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """-------- the Endorser service ------------ - - """ def ProcessProposal(self, request, context): context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) @@ -242,9 +180,6 @@ class BetaEndorserStub(object): It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This class was generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - """-------- the Endorser service ------------ - - """ def ProcessProposal(self, request, timeout, metadata=None, with_call=False, protocol_options=None): raise NotImplementedError() ProcessProposal.future = None diff --git a/bddtests/peer/peer_pb2_grpc.py b/bddtests/peer/peer_pb2_grpc.py index e636cb188f3..1e076e082c5 100644 --- a/bddtests/peer/peer_pb2_grpc.py +++ b/bddtests/peer/peer_pb2_grpc.py @@ -7,9 +7,6 @@ class EndorserStub(object): - """-------- the Endorser service ------------ - - """ def __init__(self, channel): """Constructor. @@ -25,9 +22,6 @@ def __init__(self, channel): class EndorserServicer(object): - """-------- the Endorser service ------------ - - """ def ProcessProposal(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) diff --git a/bddtests/peer/proposal_response_pb2.py b/bddtests/peer/proposal_response_pb2.py index 358cc4b38f5..4b7bf00178e 100644 --- a/bddtests/peer/proposal_response_pb2.py +++ b/bddtests/peer/proposal_response_pb2.py @@ -20,7 +20,7 @@ name='peer/proposal_response.proto', package='protos', syntax='proto3', - serialized_pb=_b('\n\x1cpeer/proposal_response.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x01\n\x10ProposalResponse\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\"\n\x08response\x18\x04 \x01(\x0b\x32\x10.protos.Response\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x12(\n\x0b\x65ndorsement\x18\x06 \x01(\x0b\x32\x13.protos.Endorsement\"<\n\x08Response\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"B\n\x17ProposalResponsePayload\x12\x14\n\x0cproposalHash\x18\x01 \x01(\x0c\x12\x11\n\textension\x18\x02 \x01(\x0c\"2\n\x0b\x45ndorsement\x12\x10\n\x08\x65ndorser\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + serialized_pb=_b('\n\x1cpeer/proposal_response.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x01\n\x10ProposalResponse\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\"\n\x08response\x18\x04 \x01(\x0b\x32\x10.protos.Response\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x12(\n\x0b\x65ndorsement\x18\x06 \x01(\x0b\x32\x13.protos.Endorsement\"<\n\x08Response\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"C\n\x17ProposalResponsePayload\x12\x15\n\rproposal_hash\x18\x01 \x01(\x0c\x12\x11\n\textension\x18\x02 \x01(\x0c\"2\n\x0b\x45ndorsement\x12\x10\n\x08\x65ndorser\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') , dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -140,7 +140,7 @@ containing_type=None, fields=[ _descriptor.FieldDescriptor( - name='proposalHash', full_name='protos.ProposalResponsePayload.proposalHash', index=0, + name='proposal_hash', full_name='protos.ProposalResponsePayload.proposal_hash', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, @@ -166,7 +166,7 @@ oneofs=[ ], serialized_start=315, - serialized_end=381, + serialized_end=382, ) @@ -203,8 +203,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=383, - serialized_end=433, + serialized_start=384, + serialized_end=434, ) _PROPOSALRESPONSE.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP diff --git a/bddtests/peer/query_pb2.py b/bddtests/peer/query_pb2.py new file mode 100644 index 00000000000..b6ae38a45e9 --- /dev/null +++ b/bddtests/peer/query_pb2.py @@ -0,0 +1,235 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: peer/query.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='peer/query.proto', + package='protos', + syntax='proto3', + serialized_pb=_b('\n\x10peer/query.proto\x12\x06protos\"C\n\x16\x43haincodeQueryResponse\x12)\n\nchaincodes\x18\x01 \x03(\x0b\x32\x15.protos.ChaincodeInfo\"g\n\rChaincodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\r\n\x05input\x18\x04 \x01(\t\x12\x0c\n\x04\x65scc\x18\x05 \x01(\t\x12\x0c\n\x04vscc\x18\x06 \x01(\t\"=\n\x14\x43hannelQueryResponse\x12%\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x13.protos.ChannelInfo\"!\n\x0b\x43hannelInfo\x12\x12\n\nchannel_id\x18\x01 \x01(\tB+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') +) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_CHAINCODEQUERYRESPONSE = _descriptor.Descriptor( + name='ChaincodeQueryResponse', + full_name='protos.ChaincodeQueryResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='chaincodes', full_name='protos.ChaincodeQueryResponse.chaincodes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=28, + serialized_end=95, +) + + +_CHAINCODEINFO = _descriptor.Descriptor( + name='ChaincodeInfo', + full_name='protos.ChaincodeInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='protos.ChaincodeInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='version', full_name='protos.ChaincodeInfo.version', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='path', full_name='protos.ChaincodeInfo.path', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='input', full_name='protos.ChaincodeInfo.input', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='escc', full_name='protos.ChaincodeInfo.escc', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='vscc', full_name='protos.ChaincodeInfo.vscc', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=97, + serialized_end=200, +) + + +_CHANNELQUERYRESPONSE = _descriptor.Descriptor( + name='ChannelQueryResponse', + full_name='protos.ChannelQueryResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='channels', full_name='protos.ChannelQueryResponse.channels', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=202, + serialized_end=263, +) + + +_CHANNELINFO = _descriptor.Descriptor( + name='ChannelInfo', + full_name='protos.ChannelInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='channel_id', full_name='protos.ChannelInfo.channel_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=265, + serialized_end=298, +) + +_CHAINCODEQUERYRESPONSE.fields_by_name['chaincodes'].message_type = _CHAINCODEINFO +_CHANNELQUERYRESPONSE.fields_by_name['channels'].message_type = _CHANNELINFO +DESCRIPTOR.message_types_by_name['ChaincodeQueryResponse'] = _CHAINCODEQUERYRESPONSE +DESCRIPTOR.message_types_by_name['ChaincodeInfo'] = _CHAINCODEINFO +DESCRIPTOR.message_types_by_name['ChannelQueryResponse'] = _CHANNELQUERYRESPONSE +DESCRIPTOR.message_types_by_name['ChannelInfo'] = _CHANNELINFO + +ChaincodeQueryResponse = _reflection.GeneratedProtocolMessageType('ChaincodeQueryResponse', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEQUERYRESPONSE, + __module__ = 'peer.query_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeQueryResponse) + )) +_sym_db.RegisterMessage(ChaincodeQueryResponse) + +ChaincodeInfo = _reflection.GeneratedProtocolMessageType('ChaincodeInfo', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEINFO, + __module__ = 'peer.query_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeInfo) + )) +_sym_db.RegisterMessage(ChaincodeInfo) + +ChannelQueryResponse = _reflection.GeneratedProtocolMessageType('ChannelQueryResponse', (_message.Message,), dict( + DESCRIPTOR = _CHANNELQUERYRESPONSE, + __module__ = 'peer.query_pb2' + # @@protoc_insertion_point(class_scope:protos.ChannelQueryResponse) + )) +_sym_db.RegisterMessage(ChannelQueryResponse) + +ChannelInfo = _reflection.GeneratedProtocolMessageType('ChannelInfo', (_message.Message,), dict( + DESCRIPTOR = _CHANNELINFO, + __module__ = 'peer.query_pb2' + # @@protoc_insertion_point(class_scope:protos.ChannelInfo) + )) +_sym_db.RegisterMessage(ChannelInfo) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/chaincode_proposal_pb2_grpc.py b/bddtests/peer/query_pb2_grpc.py similarity index 100% rename from bddtests/peer/chaincode_proposal_pb2_grpc.py rename to bddtests/peer/query_pb2_grpc.py diff --git a/bddtests/peer/transaction_pb2.py b/bddtests/peer/transaction_pb2.py new file mode 100644 index 00000000000..33e75cb2aa7 --- /dev/null +++ b/bddtests/peer/transaction_pb2.py @@ -0,0 +1,426 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: peer/transaction.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from peer import proposal_response_pb2 as peer_dot_proposal__response__pb2 +from common import common_pb2 as common_dot_common__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='peer/transaction.proto', + package='protos', + syntax='proto3', + serialized_pb=_b('\n\x16peer/transaction.proto\x12\x06protos\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cpeer/proposal_response.proto\x1a\x13\x63ommon/common.proto\"A\n\x11SignedTransaction\x12\x19\n\x11transaction_bytes\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"]\n\x14ProcessedTransaction\x12-\n\x13transactionEnvelope\x18\x01 \x01(\x0b\x32\x10.common.Envelope\x12\x16\n\x0evalidationCode\x18\x02 \x01(\x05\"9\n\x0bTransaction\x12*\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x19.protos.TransactionAction\"4\n\x11TransactionAction\x12\x0e\n\x06header\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"m\n\x16\x43haincodeActionPayload\x12\"\n\x1a\x63haincode_proposal_payload\x18\x01 \x01(\x0c\x12/\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32\x1f.protos.ChaincodeEndorsedAction\"g\n\x17\x43haincodeEndorsedAction\x12!\n\x19proposal_response_payload\x18\x01 \x01(\x0c\x12)\n\x0c\x65ndorsements\x18\x02 \x03(\x0b\x32\x13.protos.Endorsement*\xc2\x03\n\x10TxValidationCode\x12\t\n\x05VALID\x10\x00\x12\x10\n\x0cNIL_ENVELOPE\x10\x01\x12\x0f\n\x0b\x42\x41\x44_PAYLOAD\x10\x02\x12\x15\n\x11\x42\x41\x44_COMMON_HEADER\x10\x03\x12\x19\n\x15\x42\x41\x44_CREATOR_SIGNATURE\x10\x04\x12 \n\x1cINVALID_ENDORSER_TRANSACTION\x10\x05\x12\x1e\n\x1aINVALID_CONFIG_TRANSACTION\x10\x06\x12\x1a\n\x16UNSUPPORTED_TX_PAYLOAD\x10\x07\x12\x15\n\x11\x42\x41\x44_PROPOSAL_TXID\x10\x08\x12\x12\n\x0e\x44UPLICATE_TXID\x10\t\x12\x1e\n\x1a\x45NDORSEMENT_POLICY_FAILURE\x10\n\x12\x16\n\x12MVCC_READ_CONFLICT\x10\x0b\x12\x19\n\x15PHANTOM_READ_CONFLICT\x10\x0c\x12\x13\n\x0fUNKNOWN_TX_TYPE\x10\r\x12\x1a\n\x16TARGET_CHAIN_NOT_FOUND\x10\x0e\x12\x14\n\x10MARSHAL_TX_ERROR\x10\x0f\x12\x10\n\x0cNIL_TXACTION\x10\x10\x12\x19\n\x14INVALID_OTHER_REASON\x10\xff\x01\x42+Z)github.com/hyperledger/fabric/protos/peerb\x06proto3') + , + dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,peer_dot_proposal__response__pb2.DESCRIPTOR,common_dot_common__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_TXVALIDATIONCODE = _descriptor.EnumDescriptor( + name='TxValidationCode', + full_name='protos.TxValidationCode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='VALID', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NIL_ENVELOPE', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BAD_PAYLOAD', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BAD_COMMON_HEADER', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BAD_CREATOR_SIGNATURE', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INVALID_ENDORSER_TRANSACTION', index=5, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INVALID_CONFIG_TRANSACTION', index=6, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UNSUPPORTED_TX_PAYLOAD', index=7, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BAD_PROPOSAL_TXID', index=8, number=8, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DUPLICATE_TXID', index=9, number=9, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ENDORSEMENT_POLICY_FAILURE', index=10, number=10, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MVCC_READ_CONFLICT', index=11, number=11, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PHANTOM_READ_CONFLICT', index=12, number=12, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UNKNOWN_TX_TYPE', index=13, number=13, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TARGET_CHAIN_NOT_FOUND', index=14, number=14, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MARSHAL_TX_ERROR', index=15, number=15, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NIL_TXACTION', index=16, number=16, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INVALID_OTHER_REASON', index=17, number=255, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=610, + serialized_end=1060, +) +_sym_db.RegisterEnumDescriptor(_TXVALIDATIONCODE) + +TxValidationCode = enum_type_wrapper.EnumTypeWrapper(_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 +INVALID_OTHER_REASON = 255 + + + +_SIGNEDTRANSACTION = _descriptor.Descriptor( + name='SignedTransaction', + full_name='protos.SignedTransaction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='transaction_bytes', full_name='protos.SignedTransaction.transaction_bytes', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='signature', full_name='protos.SignedTransaction.signature', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=118, + serialized_end=183, +) + + +_PROCESSEDTRANSACTION = _descriptor.Descriptor( + name='ProcessedTransaction', + full_name='protos.ProcessedTransaction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='transactionEnvelope', full_name='protos.ProcessedTransaction.transactionEnvelope', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='validationCode', full_name='protos.ProcessedTransaction.validationCode', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=185, + serialized_end=278, +) + + +_TRANSACTION = _descriptor.Descriptor( + name='Transaction', + full_name='protos.Transaction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='actions', full_name='protos.Transaction.actions', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=280, + serialized_end=337, +) + + +_TRANSACTIONACTION = _descriptor.Descriptor( + name='TransactionAction', + full_name='protos.TransactionAction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='header', full_name='protos.TransactionAction.header', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='protos.TransactionAction.payload', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=339, + serialized_end=391, +) + + +_CHAINCODEACTIONPAYLOAD = _descriptor.Descriptor( + name='ChaincodeActionPayload', + full_name='protos.ChaincodeActionPayload', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='chaincode_proposal_payload', full_name='protos.ChaincodeActionPayload.chaincode_proposal_payload', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='action', full_name='protos.ChaincodeActionPayload.action', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=393, + serialized_end=502, +) + + +_CHAINCODEENDORSEDACTION = _descriptor.Descriptor( + name='ChaincodeEndorsedAction', + full_name='protos.ChaincodeEndorsedAction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='proposal_response_payload', full_name='protos.ChaincodeEndorsedAction.proposal_response_payload', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='endorsements', full_name='protos.ChaincodeEndorsedAction.endorsements', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=504, + serialized_end=607, +) + +_PROCESSEDTRANSACTION.fields_by_name['transactionEnvelope'].message_type = common_dot_common__pb2._ENVELOPE +_TRANSACTION.fields_by_name['actions'].message_type = _TRANSACTIONACTION +_CHAINCODEACTIONPAYLOAD.fields_by_name['action'].message_type = _CHAINCODEENDORSEDACTION +_CHAINCODEENDORSEDACTION.fields_by_name['endorsements'].message_type = peer_dot_proposal__response__pb2._ENDORSEMENT +DESCRIPTOR.message_types_by_name['SignedTransaction'] = _SIGNEDTRANSACTION +DESCRIPTOR.message_types_by_name['ProcessedTransaction'] = _PROCESSEDTRANSACTION +DESCRIPTOR.message_types_by_name['Transaction'] = _TRANSACTION +DESCRIPTOR.message_types_by_name['TransactionAction'] = _TRANSACTIONACTION +DESCRIPTOR.message_types_by_name['ChaincodeActionPayload'] = _CHAINCODEACTIONPAYLOAD +DESCRIPTOR.message_types_by_name['ChaincodeEndorsedAction'] = _CHAINCODEENDORSEDACTION +DESCRIPTOR.enum_types_by_name['TxValidationCode'] = _TXVALIDATIONCODE + +SignedTransaction = _reflection.GeneratedProtocolMessageType('SignedTransaction', (_message.Message,), dict( + DESCRIPTOR = _SIGNEDTRANSACTION, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.SignedTransaction) + )) +_sym_db.RegisterMessage(SignedTransaction) + +ProcessedTransaction = _reflection.GeneratedProtocolMessageType('ProcessedTransaction', (_message.Message,), dict( + DESCRIPTOR = _PROCESSEDTRANSACTION, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.ProcessedTransaction) + )) +_sym_db.RegisterMessage(ProcessedTransaction) + +Transaction = _reflection.GeneratedProtocolMessageType('Transaction', (_message.Message,), dict( + DESCRIPTOR = _TRANSACTION, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.Transaction) + )) +_sym_db.RegisterMessage(Transaction) + +TransactionAction = _reflection.GeneratedProtocolMessageType('TransactionAction', (_message.Message,), dict( + DESCRIPTOR = _TRANSACTIONACTION, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.TransactionAction) + )) +_sym_db.RegisterMessage(TransactionAction) + +ChaincodeActionPayload = _reflection.GeneratedProtocolMessageType('ChaincodeActionPayload', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEACTIONPAYLOAD, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeActionPayload) + )) +_sym_db.RegisterMessage(ChaincodeActionPayload) + +ChaincodeEndorsedAction = _reflection.GeneratedProtocolMessageType('ChaincodeEndorsedAction', (_message.Message,), dict( + DESCRIPTOR = _CHAINCODEENDORSEDACTION, + __module__ = 'peer.transaction_pb2' + # @@protoc_insertion_point(class_scope:protos.ChaincodeEndorsedAction) + )) +_sym_db.RegisterMessage(ChaincodeEndorsedAction) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('Z)github.com/hyperledger/fabric/protos/peer')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/bddtests/peer/transaction_pb2_grpc.py b/bddtests/peer/transaction_pb2_grpc.py new file mode 100644 index 00000000000..c374a4d7d5b --- /dev/null +++ b/bddtests/peer/transaction_pb2_grpc.py @@ -0,0 +1,4 @@ +import grpc +from grpc.framework.common import cardinality +from grpc.framework.interfaces.face import utilities as face_utilities + diff --git a/bddtests/peer_basic.feature b/bddtests/peer_basic.feature deleted file mode 100644 index f884eff3d52..00000000000 --- a/bddtests/peer_basic.feature +++ /dev/null @@ -1,1388 +0,0 @@ -# -# Test Fabric Peers -# -# Tags that can be used and will affect test internals: -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! - -#@chaincodeImagesUpToDate -@preV1 -Feature: Network of Peers - As a Fabric developer - I want to run a network of peers - -# @wip - Scenario: Peers list test, single peer issue #827 - Given we compose "docker-compose-1.yml" - When requesting "/network/peers" from "vp0" - Then I should get a JSON response with array "peers" contains "1" elements - -# @wip - Scenario: Peers list test,3 peers issue #827 - Given we compose "docker-compose-3.yml" - When requesting "/network/peers" from "vp0" - Then I should get a JSON response with array "peers" contains "3" elements - -# @doNotDecompose - @wip - @issue_767 - Scenario: Range query test, single peer, issue #767 - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/map" with ctor "init" to "vp0" - || - || - - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I invoke chaincode "map" function name "put" on "vp0" - | arg1 | arg2 | - | key1 | value1 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I query chaincode "map" function name "get" on "vp0": - | arg1| - | key1 | - Then I should get a JSON response with "result.message" = "value1" - - When I invoke chaincode "map" function name "put" on "vp0" - | arg1 | arg2 | - | key2 | value2 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "4" - - When I query chaincode "map" function name "keys" on "vp0": - || - || - Then I should get a JSON response with "result.message" = "["key1","key2"]" - - When I invoke chaincode "map" function name "remove" on "vp0" - | arg1 | | - | key1 | | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "5" - - When I query chaincode "map" function name "keys" on "vp0": - || - || - Then I should get a JSON response with "result.message" = "["key2"]" - -# @doNotDecompose - @wip - @issue_477 - Scenario: chaincode shim table API, issue 477 - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/bddtests/chaincode/go/table" with ctor "init" to "vp0" - || - || - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test1| 10 | 20 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test2| 10 | 20 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "4" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test1| - Then I should get a JSON response with "result.message" = "{[string:"test1" int32:10 int32:20 ]}" - - When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0" - | arg1 | arg2 | arg3 | arg3 | - | foo2 | 34 | 65 | bar8 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "5" - - When I query chaincode "table_test" function name "getRowTableTwo" on "vp0": - | arg1 | arg2 | arg3 | - | foo2 | 65 | bar8 | - Then I should get a JSON response with "result.message" = "{[string:"foo2" int32:34 int32:65 string:"bar8" ]}" - - When I invoke chaincode "table_test" function name "replaceRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test1| 30 | 40 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "6" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test1| - Then I should get a JSON response with "result.message" = "{[string:"test1" int32:30 int32:40 ]}" - - When I invoke chaincode "table_test" function name "deleteRowTableOne" on "vp0" - | arg1 | - | test1| - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "7" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test1| - Then I should get a JSON response with "result.message" = "{[]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test2| - Then I should get a JSON response with "result.message" = "{[string:"test2" int32:10 int32:20 ]}" - - When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test3| 10 | 20 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "8" - - When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test4| 10 | 20 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "9" - - When I invoke chaincode "table_test" function name "insertRowTableOne" on "vp0" - | arg1 | arg2 | arg3 | - | test5| 10 | 20 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "10" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test3| - Then I should get a JSON response with "result.message" = "{[string:"test3" int32:10 int32:20 ]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test4| - Then I should get a JSON response with "result.message" = "{[string:"test4" int32:10 int32:20 ]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test5| - Then I should get a JSON response with "result.message" = "{[string:"test5" int32:10 int32:20 ]}" - - When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0" - | arg1 | arg2 | arg3 | arg3 | - | foo2 | 35 | 65 | bar10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "11" - - When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0" - | arg1 | arg2 | arg3 | arg3 | - | foo2 | 36 | 65 | bar11 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "12" - - When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0" - | arg1 | arg2 | arg3 | arg3 | - | foo2 | 37 | 65 | bar12 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "13" - - When I invoke chaincode "table_test" function name "insertRowTableTwo" on "vp0" - | arg1 | arg2 | arg3 | arg3 | - | foo2 | 38 | 66 | bar10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "14" - - When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0": - | arg1 | arg2 | - | foo2 | 65 | - Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":37}},{"Value":{"Int32":65}},{"Value":{"String_":"bar12"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":34}},{"Value":{"Int32":65}},{"Value":{"String_":"bar8"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":36}},{"Value":{"Int32":65}},{"Value":{"String_":"bar11"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":35}},{"Value":{"Int32":65}},{"Value":{"String_":"bar10"}}]}]" - - When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0": - | arg1 | arg2 | - | foo2 | 66 | - Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":38}},{"Value":{"Int32":66}},{"Value":{"String_":"bar10"}}]}]" - - When I query chaincode "table_test" function name "getRowsTableTwo" on "vp0": - | arg1 | - | foo2 | - Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":37}},{"Value":{"Int32":65}},{"Value":{"String_":"bar12"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":34}},{"Value":{"Int32":65}},{"Value":{"String_":"bar8"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":36}},{"Value":{"Int32":65}},{"Value":{"String_":"bar11"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":38}},{"Value":{"Int32":66}},{"Value":{"String_":"bar10"}}]},{"columns":[{"Value":{"String_":"foo2"}},{"Value":{"Int32":35}},{"Value":{"Int32":65}},{"Value":{"String_":"bar10"}}]}]" - - When I invoke chaincode "table_test" function name "deleteAndRecreateTableOne" on "vp0" - || - || - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "15" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test3| - Then I should get a JSON response with "result.message" = "{[]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test4| - Then I should get a JSON response with "result.message" = "{[]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test5| - Then I should get a JSON response with "result.message" = "{[]}" - - When I query chaincode "table_test" function name "getRowTableOne" on "vp0": - | arg1 | - | test2| - Then I should get a JSON response with "result.message" = "{[]}" - - When I query chaincode "table_test" function name "getRowTableTwo" on "vp0": - | arg1 | arg2 | arg3 | - | foo2 | 65 | bar8 | - Then I should get a JSON response with "result.message" = "{[string:"foo2" int32:34 int32:65 string:"bar8" ]}" - - When I invoke chaincode "table_test" function name "insertRowTableThree" on "vp0" - | arg1 | arg2 | arg3 | arg4 | arg5 | arg6 | arg7 | - | foo2 | -38 | -66 | 77 | 88 | hello| true | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "16" - - When I query chaincode "table_test" function name "getRowTableThree" on "vp0": - | arg1 | - | foo2 | - Then I should get a JSON response with "result.message" = "{[string:"foo2" int32:-38 int64:-66 uint32:77 uint64:88 bytes:"hello" bool:true ]}" - - When I invoke chaincode "table_test" function name "insertRowTableFour" on "vp0" - | arg1 | - | foobar | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "17" - - When I query chaincode "table_test" function name "getRowTableFour" on "vp0": - | arg1 | - | foobar | - Then I should get a JSON response with "result.message" = "{[string:"foobar" ]}" - - When I query chaincode "table_test" function name "getRowsTableFour" on "vp0": - | arg1 | - | foobar | - Then I should get a JSON response with "result.message" = "[{"columns":[{"Value":{"String_":"foobar"}}]}]" - -@doNotDecompose -# @wip - Scenario: chaincode example 01 single peer erroneous TX - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I invoke chaincode "example1" function name "invoke" on "vp0" - |arg1| - | 1 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - When requesting "/chain/blocks/2" from "vp0" - Then I should get a JSON response containing "transactions" attribute - - When I invoke chaincode "example1" function name "invoke" on "vp0" - |arg1| - | a | - Then I should have received a transactionID - Then I wait "10" seconds - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "4" - When requesting "/chain/blocks/3" from "vp0" - Then I should get a JSON response containing no "transactions" attribute - -# @doNotDecompose -# @wip - @devops - Scenario: chaincode map single peer content generated ID - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/map" with ctor "init" to "vp0" - || - || - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When I invoke chaincode "map" function name "put" on "vp0" with "sha256" - | arg1 |arg2| - | a | 10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - Then I check the transaction ID if it is "73b88d92d86502eb66288f84fafae848fed0d21790f2ef1475850f4b635c47f0" - - Scenario: chaincode example 01 single peer rejection message - Given we compose "docker-compose-1-exp.yml" - Given I start a listener - Then I wait "5" seconds - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When I invoke chaincode "example1" function name "invoke" on "vp0" - |arg1| - | a | - Then I should have received a transactionID - Then I wait "10" seconds - - Then I should get a rejection message in the listener after stopping it - -# @doNotDecompose -# @wip - Scenario: chaincode example 02 single peer - Given we compose "docker-compose-1.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I query chaincode "example2" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "100" - - - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - When I query chaincode "example2" function name "query" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "90" - - When I query chaincode "example2" function name "query" on "vp0": - |arg1| - | b | - Then I should get a JSON response with "result.message" = "210" - -# @doNotDecompose -# @wip - Scenario: chaincode example02 with 5 peers, issue #520 - Given we compose "docker-compose-5.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When I query chaincode "example2" function name "query" on all peers: - |arg1| - | a | - Then I should get a JSON response from all peers with "result.message" = "100" - - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 20 | - Then I should have received a transactionID - Then I wait up to "20" seconds for transaction to be committed to all peers - - When I query chaincode "example2" function name "query" on all peers: - |arg1| - | a | - Then I should get a JSON response from all peers with "result.message" = "80" - - -# @doNotDecompose -# @wip - @issue_567 - Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #567 - - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | vp3 | - - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 20 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "80" - | vp0 | vp1 | vp2 | vp3 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-noops.yml | 60 | - | docker-compose-4-consensus-batch.yml | 60 | - - - #@doNotDecompose - #@wip - @issue_680 - @fab380 - Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #680 (State transfer) - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # Build up a sizable blockchain, that vp3 will need to validate at startup - When I invoke chaincode "example2" function name "invoke" on "vp0" "30" times - |arg1|arg2|arg3| - | b | a | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "130" - | vp0 | vp1 | vp2 | vp3 | - - # STOPPING vp3!!!!!!!!!!!!!!!!!!!!!!!!!! - Given I stop peers: - | vp3 | - - # Invoke a transaction to get vp3 out of sync - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "120" - | vp0 | vp1 | vp2 | - - # Now start vp3 again - Given I start peers: - | vp3 | - And I wait "15" seconds - - # Invoke 10 more txs, this will trigger a state transfer, set a target, and execute new outstanding transactions - When I invoke chaincode "example2" function name "invoke" on "vp0" "10" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "20" - | vp0 | vp1 | vp2 | vp3 | - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - | docker-compose-4-consensus-batch.yml docker-compose-4-consensus-batch-nosnapshotbuffer.yml | 60 | - - -# @doNotDecompose - @issue_724 - Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #724 - - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | vp3 | - - Given I stop peers: - | vp0 | vp1 | vp2 | vp3 | - - Given I start peers: - | vp0 | vp1 | vp2 | vp3 | - And I wait "15" seconds - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp3 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-noops.yml | 60 | - - -# @doNotDecompose -# @wip - Scenario: basic startup of 3 validating peers - Given we compose "docker-compose-3.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - @TLS -# @doNotDecompose - Scenario: basic startup of 2 validating peers using TLS - Given we compose "docker-compose-2-tls-basic.yml" - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - - Scenario Outline: 4 peers and 1 membersrvc, consensus still works if one backup replica fails - - Given we compose "" - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers: - | vp0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # get things started. All peers up and executing Txs - When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "95" - | vp0 | vp1 | vp2 | vp3 | - - # STOP vp2 - Given I stop peers: - | vp2 | - - # continue invoking Txs - When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp3 | - Then I should get a JSON response from peers with "result.message" = "90" - | vp0 | vp1 | vp3 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - Scenario Outline: 4 peers and 1 membersrvc, consensus fails if 2 backup replicas fail - - Given we compose "" - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers: - | vp0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # get things started. All peers up and executing Txs - When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "95" - | vp0 | vp1 | vp2 | vp3 | - - # STOP vp2 - Given I stop peers: - | vp1 | vp2 | - - # continue invoking Txs - When I invoke chaincode "example2" function name "invoke" on "vp0" "5" times - |arg1|arg2|arg3| - | a | b | 1 | - And I wait "5" seconds - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp3 | - Then I should get a JSON response from peers with "result.message" = "95" - | vp0 | vp3 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - #@doNotDecompose - #@wip - #@skip - Scenario Outline: 4 peers and 1 membersrvc, consensus still works if 1 peer (vp3) is byzantine - - Given we compose "" - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers: - | vp0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I invoke chaincode "example2" function name "invoke" on "vp0" "50" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "50" - | vp0 | vp1 | vp2 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml docker-compose-4-consensus-vp3-byzantine.yml | 60 | - - - #@doNotDecompose - @issue_1182 - Scenario Outline: chaincode example02 with 4 peers,1 membersrvc, and 1 non-validating peer. - - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | nvp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - -# Current issue as blocks NOT synced yet. -# When requesting "/chain" from "nvp0" -# Then I should get a JSON response with "height" = "1" - - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "nvp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml docker-compose-4-consensus-nvp0.yml | 60 | - - @issue_1000 - Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, test crash fault - - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - # Build up a sizable blockchain, to advance the sequence number - When I invoke chaincode "example2" function name "invoke" on "vp0" "30" times - |arg1|arg2|arg3| - | b | a | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "130" - | vp0 | vp1 | vp2 | vp3 | - - # Stop vp1, vp2, vp3 - Given I stop peers: - | vp1 | vp2 | vp3 | - - # Now start vp1, vp2 again, hopefully retaining pbft state - Given I start peers: - | vp1 | vp2 | - And I wait "15" seconds - - # Invoke 1 more tx, if the crash recovery worked, it will commit, otherwise, it will not - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "120" - | vp0 | vp1 | vp2 | - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - - - @issue_1091 - Scenario Outline: chaincode example02 with 4 peers and 1 membersrvc, issue #1019 (out of date peer) - - Given we compose "" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - # STOPPING vp3!!!!!!!!!!!!!!!!!!!!!!!!!! - Given I stop peers: - | vp3 | - - # Execute one request to get vp3 out of sync - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | b | a | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "101" - | vp0 | vp1 | vp2 | - - # Now start vp3 again - Given I start peers: - | vp3 | - And I wait "15" seconds - - # Invoke 8 more txs, this will trigger a state transfer, but it cannot complete - When I invoke chaincode "example2" function name "invoke" on "vp0" "8" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - # wait a bit to make sure the state is invalid on vp3 - Then I wait "20" seconds - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "21" - | vp0 | vp1 | vp2 | - When I unconditionally query chaincode "example2" function name "query" with value "a" on peers: - | vp3 | - Then I should get a JSON response from peers with "error.data" = "Error when querying chaincode: Error: state may be inconsistent, cannot query" - | vp3 | - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - Scenario: chaincode example02 with 4 peers, one paused, issue #1056 - Given we compose "docker-compose-4-consensus-batch.yml" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - Given I pause peers: - | vp3 | - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | - - When I invoke chaincode "example2" function name "invoke" on "vp0" "20" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "20" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "80" - | vp0 | vp1 | vp2 | - - @issue_1873 - Scenario Outline: 4 peers and 1 membersrvc, consensus works if vp0 is stopped TTT3 - Given we compose "" - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers: - | vp0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - # Deploy - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - # STOP vp0 - Given I stop peers: - | vp0 | - - And I register with CA supplying username "test_user1" and secret "jGlNl6ImkuDo" on peers: - | vp1 | - - When I invoke chaincode "example2" function name "invoke" on "vp1" "5" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "" seconds for transaction to be committed to peers: - | vp1 | vp2 | vp3 | - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "95" - | vp1 | vp2 | vp3 | - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml | 60 | - - @issue_1851 - Scenario Outline: verify reconnect of disconnected peer, issue #1851 - Given we compose "" - - When requesting "/network/peers" from "vp0" - Then I should get a JSON response with array "peers" contains "2" elements - - Given I stop peers: - | vp0 | - - When requesting "/network/peers" from "vp1" - Then I should get a JSON response with array "peers" contains "1" elements - - Given I start peers: - | vp0 | - And I wait "10" seconds - - When requesting "/network/peers" from "vp1" - Then I should get a JSON response with array "peers" contains "2" elements - - Examples: Composition options - | ComposeFile | - | docker-compose-2.yml | - - -@issue_1942 -# @doNotDecompose -Scenario: chaincode example02 with 4 peers, stop and start alternates, reverse - Given we compose "docker-compose-4-consensus-batch.yml" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 1000 | b | 0 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "1000" - | vp0 | vp1 | vp2 | vp3 | - - Given I stop peers: - | vp2 | - And I register with CA supplying username "test_user3" and secret "vWdLCE00vJy0" on peers: - | vp3 | - - When I invoke chaincode "example2" function name "invoke" on "vp3" "3" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I should have received a transactionID - Then I wait up to "180" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp3 | - Then I should get a JSON response from peers with "result.message" = "997" - | vp0 | vp1 | vp3 | - - Given I start peers: - | vp2 | - - And I wait "15" seconds - Given I stop peers: - | vp1 | - When I invoke chaincode "example2" function name "invoke" on "vp3" "20" times - |arg1|arg2|arg3| - | a | b | 1 | - Then I wait up to "300" seconds for transactions to be committed to peers: - | vp0 | vp2 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "977" - | vp0 | vp2 | vp3 | - -@issue_1874a -#@doNotDecompose -Scenario: chaincode example02 with 4 peers, two stopped - Given we compose "docker-compose-4-consensus-batch.yml" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | vp3 | - - Given I stop peers: - | vp2 | vp3 | - - When I invoke chaincode "example2" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - - Given I start peers: - | vp3 | - And I wait "15" seconds - - When I invoke chaincode "example2" function name "invoke" on "vp0" "9" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp3 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp3 | - Then I should get a JSON response from peers with "result.message" = "0" - | vp0 | vp1 | vp3 | - -@issue_1874b -#@doNotDecompose -Scenario: chaincode example02 with 4 peers, two stopped, bring back vp0 - Given we compose "docker-compose-4-consensus-batch.yml" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | vp3 | - - Given I stop peers: - | vp0 | - - And I register with CA supplying username "test_user1" and secret "jGlNl6ImkuDo" on peers: - | vp1 | - - When I invoke chaincode "example2" function name "invoke" on "vp1" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - - Given I stop peers: - | vp3 | - - When I invoke chaincode "example2" function name "invoke" on "vp1" - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - - Given I start peers: - | vp0 | - And I wait "15" seconds - - When I invoke chaincode "example2" function name "invoke" on "vp1" "8" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | - Then I should get a JSON response from peers with "result.message" = "0" - | vp0 | vp1 | vp2 | - -@issue_1874c -Scenario: chaincode example02 with 4 peers, two stopped, bring back both - Given we compose "docker-compose-4-consensus-batch.yml" - And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "100" - | vp0 | vp1 | vp2 | vp3 | - - Given I stop peers: - | vp1 | vp2 | - - When I invoke chaincode "example2" function name "invoke" on "vp0" "1" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - - Given I start peers: - | vp1 | vp2 | - And I wait "15" seconds - - When I invoke chaincode "example2" function name "invoke" on "vp0" "8" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - Then I wait "30" seconds - - When I query chaincode "example2" function name "query" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - Then I should get a JSON response from peers with "result.message" = "10" - | vp0 | vp1 | vp2 | vp3 | - - @issue_2116 - #@doNotDecompose - Scenario Outline: chaincode authorizable_counter with 4 peers, two stopped, bring back both - Given we compose "" - And I register with CA supplying username "diego" and secret "DRJ23pEQl16a" on peers: - | vp0 | - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - | vp1 | test_user1 | jGlNl6ImkuDo | - | vp2 | test_user2 | zMflqOKezFiA | - | vp3 | test_user3 | vWdLCE00vJy0 | - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - - When I deploy chaincode "github.com/hyperledger/fabric/examples/chaincode/go/authorizable_counter" with ctor "init" to "vp0" - | arg1 | - | 0 | - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | - - When I query chaincode "authorizable_counter" function name "read" on "vp0": - |arg1| - | a | - Then I should get a JSON response with "result.message" = "0" - - When I invoke chaincode "authorizable_counter" function name "increment" with attributes "position" on "vp0" - |arg1| - | a | - Then I should have received a transactionID - - When I invoke chaincode "authorizable_counter" function name "increment" on "vp0" "8" times - |arg1|arg2|arg3| - | a | b | 10 | - Then I should have received a transactionID - Then I wait up to "30" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "authorizable_counter" function name "read" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - - Then I should get a JSON response from peers with "result.message" = "1" - | vp0 | vp1 | vp2 | vp3 | - - When I invoke chaincode "authorizable_counter" function name "increment" with attributes "company" on "vp0" - |arg1| - | a | - - When I invoke chaincode "authorizable_counter" function name "increment" with attributes "company, position, age" on "vp0" - |arg1| - | a | - - Then I wait up to "15" seconds for transaction to be committed to peers: - | vp0 | vp1 | vp2 | vp3 | - - When I query chaincode "authorizable_counter" function name "read" with value "a" on peers: - | vp0 | vp1 | vp2 | vp3 | - - Then I should get a JSON response from peers with "result.message" = "2" - | vp0 | vp1 | vp2 | vp3 | - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml docker-membersrvc-attributes-enabled.yml | 120 | - | docker-compose-4-consensus-batch.yml docker-membersrvc-attributes-enabled.yml docker-membersrvc-attributes-encryption-enabled.yml | 120 | - -# noop -# @doNotDecompose - Scenario: noop chaincode test - Given we compose "docker-compose-1.yml" - When I invoke master chaincode "noop" function name "execute" on "vp0" - |arg1| - | aa | - Then I should have received a transactionID diff --git a/bddtests/peer_cli.feature b/bddtests/peer_cli.feature deleted file mode 100644 index d4bf249b71f..00000000000 --- a/bddtests/peer_cli.feature +++ /dev/null @@ -1,25 +0,0 @@ -# -# Test Command Line Features of a Peer -# -@preV1 -Feature: Peer Command Line Interface - As a User of the Fabric - I want the command line interface to work correctly - - Scenario: List Peers when none are up - Given we compose "docker-compose-1-empty.yml" - When I execute "peer network list" in container empty - Then the command should not complete successfully - - Scenario: List Peers when one is up - Given we compose "docker-compose-1.yml" - When I execute "peer network list" in container vp0 - Then the command should complete successfully - And stdout should contain JSON - And I should get result with "{"Peers":[]}" - - Scenario: List Peers when two are up - Given we compose "docker-compose-2.yml" - When I execute "peer network list" in container vp0 - Then the command should complete successfully - And stdout should contain JSON with "Peers" array of length 1 diff --git a/bddtests/peer_logging.feature b/bddtests/peer_logging.feature deleted file mode 100644 index 4b514a971ba..00000000000 --- a/bddtests/peer_logging.feature +++ /dev/null @@ -1,46 +0,0 @@ -# -# Test Logging Features of Peers -# -# Tags that can be used and will affect test internals: -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! -@preV1 -Feature: Peer Logging - As a Fabric Developer - I want to verify my Peers log correctly - - Scenario: Invoke is attempted after deploy in Dev Mode - Given we compose "docker-compose-1-devmode.yml" - When I deploy chaincode with name "testCC" and with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - And I invoke chaincode "testCC" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then ensure after 2 seconds there are no errors in the logs for peer vp0 - - Scenario: Query is attempted after deploy in Dev Mode - Given we compose "docker-compose-1-devmode.yml" - When I deploy chaincode with name "testCC" and with ctor "init" to "vp0" - | arg1 | arg2 | arg3 | arg4 | - | a | 100 | b | 200 | - And I query chaincode "testCC" function name "query" on "vp0": - |arg1| - | a | - Then ensure after 2 seconds there are no errors in the logs for peer vp0 - - Scenario: Invoke is attempted before deploy in Dev Mode - Given we compose "docker-compose-1-devmode.yml" - When I mock deploy chaincode with name "testCC" - And I invoke chaincode "testCC" function name "invoke" on "vp0" - |arg1|arg2|arg3| - | a | b | 10 | - Then I wait up to 5 seconds for an error in the logs for peer vp0 - - Scenario: Query is attempted before deploy in Dev Mode - Given we compose "docker-compose-1-devmode.yml" - When I mock deploy chaincode with name "testCC" - And I query chaincode "testCC" function name "query" on "vp0": - |arg1| - | a | - Then I wait up to 5 seconds for an error in the logs for peer vp0 \ No newline at end of file diff --git a/bddtests/peer_rest.feature b/bddtests/peer_rest.feature deleted file mode 100644 index f91a2aa9bd2..00000000000 --- a/bddtests/peer_rest.feature +++ /dev/null @@ -1,23 +0,0 @@ -# -# Test REST API Features of Peers -# -# Tags that can be used and will affect test internals: -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! -@preV1 -Feature: Peer REST API - As a Fabric developer - I want to verify REST API behavior - - Scenario: 1 peer and 1 membersrvc, query transaction certs with query parameter count - Given we compose "docker-compose-rest.yml" - And I use the following credentials for querying peers: - | peer | username | secret | - | vp0 | test_user0 | MS9qrN8hFjlE | - And I register with CA supplying username "test_user0" and secret "MS9qrN8hFjlE" on peers: - | vp0 | - - When I request transaction certs with query parameters on "vp0" - | key | value | - | count | 1 | - Then I should get a JSON response with "1" different transaction certs \ No newline at end of file diff --git a/bddtests/scripts/start-peer.sh b/bddtests/scripts/start-peer.sh deleted file mode 100755 index c05b36d8108..00000000000 --- a/bddtests/scripts/start-peer.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -SCRIPT_DIR=$(dirname $0) -MEMBERSHIP_IP=$(cat /etc/hosts | grep membersrvc | head -n 1 | cut -f1) -TIMEOUT=10 - -if [ -n "$MEMBERSHIP_IP" ]; then - echo "membersrvc detected, waiting for it before starting with a $TIMEOUT second timout" - "$SCRIPT_DIR"/wait-for-it.sh -t "$TIMEOUT" "$MEMBERSHIP_IP":7054 - - if [ $? -ne 0 ]; then - echo "Failed to contact membersrvc within $TIMEOUT seconds" - exit 1 - fi -else - echo "No membersrvc to wait for, starting immediately" -fi - -exec peer node start - diff --git a/bddtests/sdk.feature b/bddtests/sdk.feature deleted file mode 100644 index 5468aac844d..00000000000 --- a/bddtests/sdk.feature +++ /dev/null @@ -1,28 +0,0 @@ -# -# Test the Hyperledger SDK -# -# Tags that can be used and will affect test internals: -# -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# -@preV1 -@preV1_sdk -Feature: Node SDK - As a HyperLedger developer - I want to have a single test driver for the various Hyperledger SDKs - - - @doNotDecompose - @sdk - Scenario Outline: test initial sdk setup - - Given we compose "" - And I wait "5" seconds - And I register thru the sample SDK app supplying username "WebAppAdmin" and secret "DJY27pEnl16d" on "sampleApp0" - Then I should get a JSON response with "foo" = "bar" - - - Examples: Consensus Options - | ComposeFile | WaitTime | - | docker-compose-4-consensus-batch.yml docker-compose-sdk-node.yml | 60 | - #| docker-compose-4-consensus-batch.yml docker-compose-sdk-java.yml | 60 | diff --git a/bddtests/steps/bdd_grpc_util.py b/bddtests/steps/bdd_grpc_util.py index 0b7e2deb981..16e496273af 100644 --- a/bddtests/steps/bdd_grpc_util.py +++ b/bddtests/steps/bdd_grpc_util.py @@ -14,36 +14,12 @@ # limitations under the License. # -import os import re -import subprocess -import devops_pb2 -import fabric_pb2 -import chaincode_pb2 import bdd_test_util import grpc -def getSecretForUserRegistration(userRegistration): - return devops_pb2.Secret(enrollId=userRegistration.secretMsg['enrollId'],enrollSecret=userRegistration.secretMsg['enrollSecret']) - -def getTxResult(context, enrollId): - '''Returns the TransactionResult using the enrollId supplied''' - assert 'users' in context, "users not found in context. Did you register a user?" - assert 'compose_containers' in context, "compose_containers not found in context" - - (channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) - stub = devops_pb2.beta_create_Devops_stub(channel) - - txRequest = devops_pb2.TransactionRequest(transactionUuid = context.transactionID) - response = stub.GetTransactionResult(txRequest, 2) - assert response.status == fabric_pb2.Response.SUCCESS, 'Failure getting Transaction Result from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) - # Now grab the TransactionResult from the Msg bytes - txResult = fabric_pb2.TransactionResult() - txResult.ParseFromString(response.msg) - return txResult - def getGRPCChannel(ipAddress): channel = grpc.insecure_channel("{0}:{1}".format(ipAddress, 7051), options = [('grpc.max_message_length', 100*1024*1024)]) print("Returning GRPC for address: {0}".format(ipAddress)) @@ -74,53 +50,6 @@ def getDeployment(context, ccAlias): # raise Exception("Deployment alias not found: '{0}'. Are you sure you have deployed a chaincode with this alias?".format(ccAlias)) return deployment -def deployChaincode(context, enrollId, chaincodePath, ccAlias, ctor): - '''Deploy a chaincode with the specified alias for the specfied enrollId''' - (channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) - stub = devops_pb2.beta_create_Devops_stub(channel) - - # Make sure deployment alias does NOT already exist - assert getDeployment(context, ccAlias) == None, "Deployment alias already exists: '{0}'.".format(ccAlias) - - args = getArgsFromContextForUser(context, enrollId) - ccSpec = chaincode_pb2.ChaincodeSpec(type = chaincode_pb2.ChaincodeSpec.GOLANG, - chaincodeID = chaincode_pb2.ChaincodeID(name="",path=chaincodePath), - ctorMsg = chaincode_pb2.ChaincodeInput(function = ctor, args = args)) - ccSpec.secureContext = userRegistration.getUserName() - if 'metadata' in context: - ccSpec.metadata = context.metadata - try: - ccDeploymentSpec = stub.Deploy(ccSpec, 60) - ccSpec.chaincodeID.name = ccDeploymentSpec.chaincodeSpec.chaincodeID.name - context.grpcChaincodeSpec = ccSpec - context.deployments[ccAlias] = ccSpec - except: - del stub - raise - -def invokeChaincode(context, enrollId, ccAlias, functionName): - # Get the deployment for the supplied chaincode alias - deployedCcSpec = getDeployment(context, ccAlias) - assert deployedCcSpec != None, "Deployment NOT found for chaincode alias '{0}'".format(ccAlias) - - # Create a new ChaincodeSpec by copying the deployed one - newChaincodeSpec = chaincode_pb2.ChaincodeSpec() - newChaincodeSpec.CopyFrom(deployedCcSpec) - - # Update hte chaincodeSpec ctorMsg for invoke - args = getArgsFromContextForUser(context, enrollId) - - chaincodeInput = chaincode_pb2.ChaincodeInput(function = functionName, args = args ) - newChaincodeSpec.ctorMsg.CopyFrom(chaincodeInput) - - ccInvocationSpec = chaincode_pb2.ChaincodeInvocationSpec(chaincodeSpec = newChaincodeSpec) - - (channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) - - stub = devops_pb2.beta_create_Devops_stub(channel) - response = stub.Invoke(ccInvocationSpec,2) - return response - def getArgsFromContextForUser(context, enrollId): # Update the chaincodeSpec ctorMsg for invoke args = [] diff --git a/bddtests/steps/bootstrap_impl.py b/bddtests/steps/bootstrap_impl.py index 48b1656aa97..5f791a5f764 100644 --- a/bddtests/steps/bootstrap_impl.py +++ b/bddtests/steps/bootstrap_impl.py @@ -19,6 +19,7 @@ import bdd_test_util import bootstrap_util import orderer_util +import compose import time class ChannelCreationInfo: @@ -162,12 +163,12 @@ def step_impl(context, userName, createChannelSignedConfigEnvelope): signedAnchorsConfigItems = user.tags[anchorSignedConfigItemsName] # Intermediate step until template tool is ready - signedConfigItems = bootstrap_util.createSignedConfigItems(configGroups=signedMspConfigItems + signedAnchorsConfigItems) - + channel_config_groups = bootstrap_util.createSignedConfigItems(directory, configGroups=signedMspConfigItems + signedAnchorsConfigItems) + # bootstrap_util.setMetaPolicy(channelId=channelID, channgel_config_groups=channgel_config_groups) #NOTE: Conidered passing signing key for appDeveloper, but decided that the peer org signatures they need to collect subsequently should be proper way - config_update_envelope = bootstrap_util.createConfigUpdateEnvelope(channelConfigGroup=signedConfigItems, chainId=channelID, chainCreationPolicyName=chainCreationPolicyName) + config_update_envelope = bootstrap_util.createConfigUpdateEnvelope(channelConfigGroup=channel_config_groups, chainId=channelID, chainCreationPolicyName=chainCreationPolicyName) user.setTagValue(createChannelSignedConfigEnvelope, ChannelCreationInfo(channelID, chainCreationPolicyName, config_update_envelope)) @@ -217,6 +218,14 @@ def step_impl(context, userName, configTxName, orderer, channelId): configTxEnvelope = user.tags[configTxName] bootstrap_util.broadcastCreateChannelConfigTx(context=context, composeService=orderer, chainId=channelId, user=user, configTxEnvelope=configTxEnvelope) +@when(u'the user "{userName}" broadcasts transaction "{transactionAlias}" to orderer "{orderer}" on channel "{channelId}"') +def step_impl(context, userName, transactionAlias, orderer, channelId): + directory = bootstrap_util.getDirectory(context) + user = directory.getUser(userName=userName) + transaction = user.tags[transactionAlias] + bootstrap_util.broadcastCreateChannelConfigTx(context=context, composeService=orderer, chainId=channelId, user=user, configTxEnvelope=transaction) + + @when(u'user "{userName}" connects to deliver function on orderer "{composeService}"') def step_impl(context, userName, composeService): directory = bootstrap_util.getDirectory(context) @@ -230,7 +239,8 @@ def step_impl(context, userName, composeService): row = context.table.rows[0] chainID = row['ChainId'] start, end, = orderer_util.convertSeek(row['Start']), orderer_util.convertSeek(row['End']) - + print("Start and end = {0}/{1}".format(start, end)) + print("") streamHelper = user.getDelivererStreamHelper(context, composeService) streamHelper.seekToRange(chainID=chainID, start = start, end = end) @@ -257,7 +267,7 @@ def step_impl(context, userName, certAlias, genisisBlockName, joinChannelResult) # Retrieve the genesis block from the returned value of deliver (Will be list with first block as genesis block) genesisBlock = user.tags[genisisBlockName][0] ccSpec = endorser_util.getChaincodeSpec("GOLANG", "", "cscc", ["JoinChain", genesisBlock.SerializeToString()]) - proposal = endorser_util.createInvokeProposalForBDD(context, ccSpec=ccSpec, chainID="",signersCert=signersCert, Mspid="DEFAULT", type="CONFIG") + proposal = endorser_util.createInvokeProposalForBDD(context, ccSpec=ccSpec, chainID="",signersCert=signersCert, Mspid=user.tags[certAlias].organization, type="CONFIG") signedProposal = endorser_util.signProposal(proposal=proposal, entity=user, signersCert=signersCert) # Send proposal to each specified endorser, waiting 'timeout' seconds for response/error @@ -300,3 +310,29 @@ def step_impl(context, userName, anchorSetName, channelName): user = directory.getUser(userName=userName) nodeAdminTuples = [directory.findNodeAdminTuple(row['User'], row['Peer'], row['Organization']) for row in context.table.rows] user.setTagValue(anchorSetName, bootstrap_util.getAnchorPeersConfigGroup(context=context, nodeAdminTuples=nodeAdminTuples)) + +@given(u'we compose "{composeYamlFile}"') +def step_impl(context, composeYamlFile): + # time.sleep(10) # Should be replaced with a definitive interlock guaranteeing that all peers/membersrvc are ready + composition = compose.Composition(context, composeYamlFile) + context.compose_containers = composition.containerDataList + context.composition = composition + +@given(u'I wait "{seconds}" seconds') +def step_impl(context, seconds): + time.sleep(float(seconds)) + +@when(u'I wait "{seconds}" seconds') +def step_impl(context, seconds): + time.sleep(float(seconds)) + +@then(u'I wait "{seconds}" seconds') +def step_impl(context, seconds): + time.sleep(float(seconds)) + +@given(u'user "{userNameSource}" gives "{objectAlias}" to user "{userNameTarget}"') +def step_impl(context, userNameSource, objectAlias, userNameTarget): + directory = bootstrap_util.getDirectory(context) + userSource = directory.getUser(userName=userNameSource) + userTarget = directory.getUser(userName=userNameTarget) + userTarget.setTagValue(objectAlias, userSource.tags[objectAlias]) diff --git a/bddtests/steps/bootstrap_util.py b/bddtests/steps/bootstrap_util.py index e01efa9954f..0d062933876 100644 --- a/bddtests/steps/bootstrap_util.py +++ b/bddtests/steps/bootstrap_util.py @@ -205,6 +205,9 @@ def setTagValue(self, tagKey, tagValue, overwrite=False): self.tags[tagKey] = tagValue return tagValue + def cleanup(self): + self.closeStreams() + class Organization(Entity): @@ -273,6 +276,10 @@ def getUser(self, userName, shouldCreate=False): def getUsers(self): return self.users + def cleanup(self): + '''Perform cleanup of resources''' + [user.cleanup() for user in self.users.values()] + def getOrganization(self, orgName, shouldCreate=False): if not orgName in self.organizations and shouldCreate: # self.organizations[orgName] = Organization(orgName) @@ -358,6 +365,17 @@ class BootstrapHelper: KEY_NEW_CONFIGURATION_ITEM_POLICY = "NewConfigurationItemPolicy" DEFAULT_CHAIN_CREATORS = [KEY_ACCEPT_ALL_POLICY] + # ReadersPolicyKey is the key used for the read policy + KEY_POLICY_READERS = "Readers" + # WritersPolicyKey is the key used for the writer policy + KEY_POLICY_WRITERS = "Writers" + # AdminsPolicyKey is the key used for the admins policy + KEY_POLICY_ADMINS = "Admins" + + # OrdererAddressesKey is the cb.ConfigItem type key name for the OrdererAddresses message + KEY_ORDERER_ADDRESSES = "OrdererAddresses" + + DEFAULT_NONCE_SIZE = 24 @classmethod @@ -377,7 +395,7 @@ def addSignatureToSignedConfigItem(cls, configUpdateEnvelope, (entity, cert)): newConfigSig.signature = signature def __init__(self, chainId, lastModified=0, msgVersion=1, epoch=0, consensusType="solo", batchSize=10, - batchTimeout="10s", absoluteMaxBytes=100000000, preferredMaxBytes=512 * 1024, signers=[]): + batchTimeout=".5s", absoluteMaxBytes=100000000, preferredMaxBytes=512 * 1024, signers=[]): self.chainId = str(chainId) self.lastModified = lastModified self.msgVersion = msgVersion @@ -595,8 +613,8 @@ def getAnchorPeersConfigGroup(context, nodeAdminTuples): anchorPeer = anchorPeers.anchor_peers.add() anchorPeer.host = nodeAdminTuple.nodeName anchorPeer.port = 5611 - anchorPeer.cert = crypto.dump_certificate(crypto.FILETYPE_PEM, - directory.findCertForNodeAdminTuple(nodeAdminTuple)) + # anchorPeer.cert = crypto.dump_certificate(crypto.FILETYPE_PEM, + # directory.findCertForNodeAdminTuple(nodeAdminTuple)) config_group.groups[ApplicationGroup].groups[orgName].values[BootstrapHelper.KEY_ANCHOR_PEERS].value=toValue(anchorPeers) return [config_group] @@ -610,15 +628,32 @@ def getMspConfigItemsForPolicyNames(context, policyNames): return getSignedMSPConfigItems(context=context, orgNames=orgNamesReferenced) -def createSignedConfigItems(configGroups=[]): +def createSignedConfigItems(directory, configGroups=[]): - channelConfig = createChannelConfigGroup() + channelConfig = createChannelConfigGroup(directory) for configGroup in configGroups: mergeConfigGroups(channelConfig, configGroup) return channelConfig - -def createChannelConfigGroup(hashingAlgoName="SHA256", consensusType="solo", batchTimeout="10s", batchSizeMaxMessageCount=10, batchSizeAbsoluteMaxBytes=100000000, batchSizePreferredMaxBytes=512 * 1024): +def setMetaPolicy(channelId, channgel_config_groups): + #New meta policy info + typeImplicitMeta = common_dot_policies_pb2.Policy.PolicyType.Value("IMPLICIT_META") + P = common_dot_policies_pb2.Policy + IMP=common_dot_policies_pb2.ImplicitMetaPolicy + ruleAny = common_dot_policies_pb2.ImplicitMetaPolicy.Rule.Value("ANY") + ruleMajority = common_dot_policies_pb2.ImplicitMetaPolicy.Rule.Value("MAJORITY") + channgel_config_groups.groups[channelId].groups[ApplicationGroup].policies[BootstrapHelper.KEY_POLICY_READERS].policy.CopyFrom( + P(type=typeImplicitMeta, policy=IMP( + rule=ruleAny).SerializeToString())) + channgel_config_groups.groups[channelId].groups[ApplicationGroup].policies[BootstrapHelper.KEY_POLICY_WRITERS].policy.CopyFrom( + P(type=typeImplicitMeta, policy=IMP( + rule=ruleAny).SerializeToString())) + channgel_config_groups.groups[channelId].groups[ApplicationGroup].policies[BootstrapHelper.KEY_POLICY_ADMINS].policy.CopyFrom( + P(type=typeImplicitMeta, policy=IMP( + rule=ruleAny).SerializeToString())) + + +def createChannelConfigGroup(directory, hashingAlgoName="SHA256", consensusType="solo", batchTimeout="1s", batchSizeMaxMessageCount=10, batchSizeAbsoluteMaxBytes=100000000, batchSizePreferredMaxBytes=512 * 1024): channel = common_dot_configtx_pb2.ConfigGroup() # channel.groups[ApplicationGroup] = common_dot_configtx_pb2.ConfigGroup() @@ -645,6 +680,25 @@ def createChannelConfigGroup(hashingAlgoName="SHA256", consensusType="solo", bat BootstrapHelper.KEY_EGRESS_POLICY].value = toValue( orderer_dot_configuration_pb2.EgressPolicyNames( names=[BootstrapHelper.KEY_ACCEPT_ALL_POLICY])) + #New meta policy info + typeImplicitMeta = common_dot_policies_pb2.Policy.PolicyType.Value("IMPLICIT_META") + Policy = common_dot_policies_pb2.Policy + IMP=common_dot_policies_pb2.ImplicitMetaPolicy + ruleAny = common_dot_policies_pb2.ImplicitMetaPolicy.Rule.Value("ANY") + ruleMajority = common_dot_policies_pb2.ImplicitMetaPolicy.Rule.Value("MAJORITY") + channel.policies[BootstrapHelper.KEY_POLICY_READERS].policy.CopyFrom(Policy(type=typeImplicitMeta, policy=IMP( + rule=ruleAny, sub_policy=BootstrapHelper.KEY_POLICY_READERS).SerializeToString())) + channel.policies[BootstrapHelper.KEY_POLICY_WRITERS].policy.CopyFrom(Policy(type=typeImplicitMeta, policy=IMP( + rule=ruleAny, sub_policy=BootstrapHelper.KEY_POLICY_WRITERS).SerializeToString())) + channel.policies[BootstrapHelper.KEY_POLICY_ADMINS].policy.CopyFrom(Policy(type=typeImplicitMeta, policy=IMP( + rule=ruleMajority, sub_policy=BootstrapHelper.KEY_POLICY_ADMINS).SerializeToString())) + #New OrdererAddress + ordererAddress = common_dot_configuration_pb2.OrdererAddresses() + for ordererNodeTuple, cert in [(user_node_tuple, cert) for user_node_tuple, cert in directory.ordererAdminTuples.iteritems() if + "orderer" in user_node_tuple.user and "signer" in user_node_tuple.user.lower()]: + ordererAddress.addresses.append("{0}:7050".format(ordererNodeTuple.nodeName)) + assert len(ordererAddress.addresses) > 0, "No orderer nodes were found while trying to create channel ConfigGroup" + channel.values[BootstrapHelper.KEY_ORDERER_ADDRESSES].value = toValue(ordererAddress) return channel def createConfigUpdateTxEnvelope(chainId, configUpdateEnvelope): @@ -662,8 +716,8 @@ def createConfigUpdateTxEnvelope(chainId, configUpdateEnvelope): ) payloadHeader = common_dot_common_pb2.Header( - channel_header=payloadChainHeader, - signature_header=payloadSignatureHeader, + channel_header=payloadChainHeader.SerializeToString(), + signature_header=payloadSignatureHeader.SerializeToString(), ) payload = common_dot_common_pb2.Payload(header=payloadHeader, data=configUpdateEnvelope.SerializeToString()) envelope = common_dot_common_pb2.Envelope(payload=payload.SerializeToString(), signature=None) @@ -684,8 +738,8 @@ def createConfigTxEnvelope(chainId, config_envelope): ) payloadHeader = common_dot_common_pb2.Header( - channel_header=payloadChainHeader, - signature_header=payloadSignatureHeader, + channel_header=payloadChainHeader.SerializeToString(), + signature_header=payloadSignatureHeader.SerializeToString(), ) payload = common_dot_common_pb2.Payload(header=payloadHeader, data=config_envelope.SerializeToString()) envelope = common_dot_common_pb2.Envelope(payload=payload.SerializeToString(), signature=None) @@ -694,9 +748,7 @@ def createConfigTxEnvelope(chainId, config_envelope): return configEnvelope def createNewConfigUpdateEnvelope(channelConfig, chainId): - configUpdate = common_dot_configtx_pb2.ConfigUpdate(header=common_dot_common_pb2.ChannelHeader(channel_id=chainId, - type=common_dot_common_pb2.HeaderType.Value( - "CONFIG_UPDATE")), + configUpdate = common_dot_configtx_pb2.ConfigUpdate(channel_id=chainId, write_set=channelConfig) configUpdateEnvelope = common_dot_configtx_pb2.ConfigUpdateEnvelope(config_update=configUpdate.SerializeToString(), signatures =[]) return configUpdateEnvelope @@ -724,7 +776,7 @@ def createGenesisBlock(context, chainId, consensusType, signedConfigItems=[]): directory = getDirectory(context) assert len(directory.ordererAdminTuples) > 0, "No orderer admin tuples defined!!!" - channelConfig = createChannelConfigGroup() + channelConfig = createChannelConfigGroup(directory) for configGroup in signedConfigItems: mergeConfigGroups(channelConfig, configGroup) @@ -733,9 +785,8 @@ def createGenesisBlock(context, chainId, consensusType, signedConfigItems=[]): # f.write(channelConfig.SerializeToString()) config = common_dot_configtx_pb2.Config( - header=common_dot_common_pb2.ChannelHeader(channel_id=chainId, - type=common_dot_common_pb2.HeaderType.Value("CONFIG")), - channel=channelConfig) + sequence=0, + channel_group=channelConfig) configEnvelope = common_dot_configtx_pb2.ConfigEnvelope(config=config) envelope = createConfigTxEnvelope(chainId=chainId, config_envelope=configEnvelope) @@ -792,7 +843,7 @@ def getLocalMspConfigPath(self, composition, compose_service, pathType=PathType. return "{0}/{1}/localMspConfig".format(self.getVolumePath(composition, pathType), compose_service) def _writeMspFiles(self, directory , composition, compose_service, network): - localMspConfigPath = self.getLocalMspConfigPath(composition, compose_service=compose_service) + localMspConfigPath = self.getLocalMspConfigPath(composition, compose_service) os.makedirs("{0}/{1}".format(localMspConfigPath, "signcerts")) os.makedirs("{0}/{1}".format(localMspConfigPath, "admincerts")) os.makedirs("{0}/{1}".format(localMspConfigPath, "cacerts")) @@ -818,7 +869,11 @@ def _writeMspFiles(self, directory , composition, compose_service, network): user = directory.getUser(pnt.user, shouldCreate=False) with open("{0}/keystore/{1}.pem".format(localMspConfigPath, pnt.user), "w") as f: f.write(user.ecdsaSigningKey.to_pem()) - # f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, user.pKey)) + + def _getMspId(self, compose_service, directory): + matchingNATs = [nat for nat in directory.getNamedCtxTuples() if ((compose_service in nat.user) and ("Signer" in nat.user) and ((compose_service in nat.nodeName)))] + assert len(matchingNATs)==1, "Unexpected number of matching NodeAdminTuples: {0}".format(matchingNATs) + return matchingNATs[0].organization class OrdererGensisBlockCompositionCallback(compose.CompositionCallback, CallbackHelper): @@ -829,16 +884,8 @@ def __init__(self, context, genesisBlock, genesisFileName="genesis_file"): self.context = context self.genesisFileName = genesisFileName self.genesisBlock = genesisBlock - self.volumeRootPathInContainer = "/var/hyperledger/bddtests" compose.Composition.RegisterCallbackInContext(context, self) - def getVolumePath(self, composition, pathType=PathType.Local): - assert pathType in PathType, "Expected pathType of {0}".format(PathType) - basePath = "." - if pathType == PathType.Container: - basePath = self.volumeRootPathInContainer - return "{0}/volumes/orderer/{1}".format(basePath, composition.projectName) - def getGenesisFilePath(self, composition, pathType=PathType.Local): return "{0}/{1}".format(self.getVolumePath(composition, pathType), self.genesisFileName) @@ -863,79 +910,49 @@ def decomposing(self, composition, context): shutil.rmtree(self.getVolumePath(composition)) def getEnv(self, composition, context, env): + directory = getDirectory(context) env["ORDERER_GENERAL_GENESISMETHOD"] = "file" env["ORDERER_GENERAL_GENESISFILE"] = self.getGenesisFilePath(composition, pathType=PathType.Container) for ordererService in self.getOrdererList(composition): localMspConfigPath = self.getLocalMspConfigPath(composition, ordererService, pathType=PathType.Container) env["{0}_ORDERER_GENERAL_LOCALMSPDIR".format(ordererService.upper())] = localMspConfigPath + env["{0}_ORDERER_GENERAL_LOCALMSPID".format(ordererService.upper())] = self._getMspId(compose_service=ordererService, directory=directory) + -class PeerCompositionCallback(compose.CompositionCallback): +class PeerCompositionCallback(compose.CompositionCallback, CallbackHelper): 'Responsible for setting up Peer nodes upon composition' def __init__(self, context): + CallbackHelper.__init__(self, discriminator="peer") self.context = context - self.volumeRootPathInContainer = "/var/hyperledger/bddtests" compose.Composition.RegisterCallbackInContext(context, self) - def getVolumePath(self, composition, pathType=PathType.Local): - assert pathType in PathType, "Expected pathType of {0}".format(PathType) - basePath = "." - if pathType == PathType.Container: - basePath = self.volumeRootPathInContainer - return "{0}/volumes/peer/{1}".format(basePath, composition.projectName) - def getPeerList(self, composition): return [serviceName for serviceName in composition.getServiceNames() if "peer" in serviceName] - def getLocalMspConfigPath(self, composition, peerService, pathType=PathType.Local): - return "{0}/{1}/localMspConfig".format(self.getVolumePath(composition, pathType), peerService) - - def _createLocalMspConfigDirs(self, mspConfigPath): - os.makedirs("{0}/{1}".format(mspConfigPath, "signcerts")) - os.makedirs("{0}/{1}".format(mspConfigPath, "admincerts")) - os.makedirs("{0}/{1}".format(mspConfigPath, "cacerts")) - os.makedirs("{0}/{1}".format(mspConfigPath, "keystore")) - def composing(self, composition, context): 'Will copy local MSP info over at this point for each peer node' directory = getDirectory(context) for peerService in self.getPeerList(composition): - localMspConfigPath = self.getLocalMspConfigPath(composition, peerService) - self._createLocalMspConfigDirs(localMspConfigPath) - # Loop through directory and place Peer Organization Certs into cacerts folder - for peerOrg in [org for orgName, org in directory.organizations.items() if Network.Peer in org.networks]: - with open("{0}/cacerts/{1}.pem".format(localMspConfigPath, peerOrg.name), "w") as f: - f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, peerOrg.getSelfSignedCert())) - - # Loop through directory and place Peer Organization Certs into admincerts folder - # TODO: revisit this, ASO recommended for now - for peerOrg in [org for orgName, org in directory.organizations.items() if Network.Peer in org.networks]: - with open("{0}/admincerts/{1}.pem".format(localMspConfigPath, peerOrg.name), "w") as f: - f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, peerOrg.getSelfSignedCert())) - - # Find the peer signer Tuple for this peer and add to signcerts folder - for pnt, cert in [(peerNodeTuple, cert) for peerNodeTuple, cert in directory.ordererAdminTuples.items() if - peerService in peerNodeTuple.user and "signer" in peerNodeTuple.user.lower()]: - # Put the PEM file in the signcerts folder - with open("{0}/signcerts/{1}.pem".format(localMspConfigPath, pnt.user), "w") as f: - f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert)) - # Put the associated private key into the keystore folder - user = directory.getUser(pnt.user, shouldCreate=False) - with open("{0}/keystore/{1}.pem".format(localMspConfigPath, pnt.user), "w") as f: - f.write(user.ecdsaSigningKey.to_pem()) - # f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, user.pKey)) + self._writeMspFiles(directory=directory, + compose_service=peerService, + composition=composition, + network=Network.Peer) def decomposing(self, composition, context): 'Will remove the orderer volume path folder for the context' shutil.rmtree(self.getVolumePath(composition)) def getEnv(self, composition, context, env): + directory = getDirectory(context) + # First figure out which organization provided the signer cert for this for peerService in self.getPeerList(composition): localMspConfigPath = self.getLocalMspConfigPath(composition, peerService, pathType=PathType.Container) env["{0}_CORE_PEER_MSPCFGPATH".format(peerService.upper())] = localMspConfigPath + env["{0}_CORE_PEER_LOCALMSPID".format(peerService.upper())] = self._getMspId(compose_service=peerService, directory=directory) def createChainCreationPolicyNames(context, chainCreationPolicyNames, chaindId): @@ -958,8 +975,8 @@ def createChainCreatorsPolicy(context, chainCreatePolicyName, chaindId, orgNames mspPrincipalList = [] for org in [directory.getOrganization(orgName) for orgName in orgNames]: mspPrincipalList.append(msp_principal_pb2.MSPPrincipal( - PrincipalClassification=msp_principal_pb2.MSPPrincipal.Classification.Value("ByIdentity"), - Principal=crypto.dump_certificate(crypto.FILETYPE_ASN1, org.getSelfSignedCert()))) + principal_classification=msp_principal_pb2.MSPPrincipal.Classification.Value("IDENTITY"), + principal=crypto.dump_certificate(crypto.FILETYPE_ASN1, org.getSelfSignedCert()))) policy = common_dot_policies_pb2.Policy( type=common_dot_policies_pb2.Policy.PolicyType.Value("SIGNATURE"), policy=AuthDSLHelper.Envelope( diff --git a/bddtests/steps/chaincode_rbac_impl.py b/bddtests/steps/chaincode_rbac_impl.py deleted file mode 100644 index 4c70978a568..00000000000 --- a/bddtests/steps/chaincode_rbac_impl.py +++ /dev/null @@ -1,138 +0,0 @@ -import os -import re -import time -import copy -import base64 -from datetime import datetime, timedelta - -import sys, requests, json - -import bdd_test_util - -import bdd_grpc_util -from grpc.beta import implementations - -import fabric_pb2 -import chaincode_pb2 -import devops_pb2 - -LAST_REQUESTED_TCERT="lastRequestedTCert" - - -@when(u'user "{enrollId}" requests a new application TCert') -def step_impl(context, enrollId): - assert 'users' in context, "users not found in context. Did you register a user?" - (channel, userRegistration) = bdd_grpc_util.getGRPCChannelAndUser(context, enrollId) - - stub = devops_pb2.beta_create_Devops_stub(channel) - - secret = bdd_grpc_util.getSecretForUserRegistration(userRegistration) - response = stub.EXP_GetApplicationTCert(secret,2) - assert response.status == fabric_pb2.Response.SUCCESS, 'Failure getting TCert from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) - tcert = response.msg - - userRegistration.lastResult = tcert - -@when(u'user "{enrollId}" stores their last result as "{tagName}"') -def step_impl(context, enrollId, tagName): - assert 'users' in context, "users not found in context. Did you register a user?" - # Retrieve the userRegistration from the context - userRegistration = bdd_test_util.getUserRegistration(context, enrollId) - userRegistration.tags[tagName] = userRegistration.lastResult - -@when(u'user "{enrollId}" sets metadata to their stored value "{tagName}"') -def step_impl(context, enrollId, tagName): - assert 'users' in context, "users not found in context. Did you register a user?" - # Retrieve the userRegistration from the context - userRegistration = bdd_test_util.getUserRegistration(context, enrollId) - assert tagName in userRegistration.tags, 'Tag "{0}" not found in user "{1}" tags'.format(tagName, enrollId) - context.metadata = userRegistration.tags[tagName] - - -@when(u'user "{enrollId}" deploys chaincode "{chaincodePath}" aliased as "{ccAlias}" with ctor "{ctor}" and args') -def step_impl(context, enrollId, chaincodePath, ccAlias, ctor): - bdd_grpc_util.deployChaincode(context, enrollId, chaincodePath, ccAlias, ctor) - - -@when(u'user "{enrollId}" gives stored value "{tagName}" to "{recipientEnrollId}"') -def step_impl(context, enrollId, tagName, recipientEnrollId): - assert 'users' in context, "users not found in context. Did you register a user?" - # Retrieve the userRegistration from the context - userRegistration = bdd_test_util.getUserRegistration(context, enrollId) - recipientUserRegistration = bdd_test_util.getUserRegistration(context, recipientEnrollId) - # Copy value from target to recipient - recipientUserRegistration.tags[tagName] = userRegistration.tags[tagName] - - -@when(u'"{enrollId}" uses application TCert "{assignerAppTCert}" to assign role "{role}" to application TCert "{assigneeAppTCert}"') -def step_impl(context, enrollId, assignerAppTCert, role, assigneeAppTCert): - assert 'users' in context, "users not found in context. Did you register a user?" - assert 'compose_containers' in context, "compose_containers not found in context" - - (channel, userRegistration) = bdd_grpc_util.getGRPCChannelAndUser(context, enrollId) - - stub = devops_pb2.beta_create_Devops_stub(channel) - - # First get binding with EXP_PrepareForTx - secret = bdd_grpc_util.getSecretForUserRegistration(userRegistration) - response = stub.EXP_PrepareForTx(secret,2) - assert response.status == fabric_pb2.Response.SUCCESS, 'Failure getting Binding from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) - binding = response.msg - - # Now produce the sigma EXP_ProduceSigma - chaincodeInput = chaincode_pb2.ChaincodeInput(function = "addRole", args = (base64.b64encode(userRegistration.tags[assigneeAppTCert]), role) ) - chaincodeInputRaw = chaincodeInput.SerializeToString() - appTCert = userRegistration.tags[assignerAppTCert] - sigmaInput = devops_pb2.SigmaInput(secret = secret, appTCert = appTCert, data = chaincodeInputRaw + binding) - response = stub.EXP_ProduceSigma(sigmaInput,2) - assert response.status == fabric_pb2.Response.SUCCESS, 'Failure prducing sigma from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) - sigmaOutputBytes = response.msg - # Parse the msg bytes as a SigmaOutput message - sigmaOutput = devops_pb2.SigmaOutput() - sigmaOutput.ParseFromString(sigmaOutputBytes) - print('Length of sigma = {0}'.format(len(sigmaOutput.sigma))) - - # Now execute the transaction with the saved binding, EXP_ExecuteWithBinding - assert "grpcChaincodeSpec" in context, "grpcChaincodeSpec NOT found in context" - newChaincodeSpec = chaincode_pb2.ChaincodeSpec() - newChaincodeSpec.CopyFrom(context.grpcChaincodeSpec) - newChaincodeSpec.metadata = sigmaOutput.asn1Encoding - newChaincodeSpec.ctorMsg.CopyFrom(chaincodeInput) - - ccInvocationSpec = chaincode_pb2.ChaincodeInvocationSpec(chaincodeSpec = newChaincodeSpec) - - executeWithBinding = devops_pb2.ExecuteWithBinding(chaincodeInvocationSpec = ccInvocationSpec, binding = binding) - - response = stub.EXP_ExecuteWithBinding(executeWithBinding,60) - assert response.status == fabric_pb2.Response.SUCCESS, 'Failure executeWithBinding from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) - context.response = response - context.transactionID = response.msg - - -@then(u'"{enrollId}"\'s last transaction should have failed with message that contains "{msg}"') -def step_impl(context, enrollId, msg): - assert 'users' in context, "users not found in context. Did you register a user?" - assert 'compose_containers' in context, "compose_containers not found in context" - txResult = bdd_grpc_util.getTxResult(context, enrollId) - assert txResult.errorCode > 0, "Expected failure (errorCode > 0), instead found errorCode={0}".format(txResult.errorCode) - assert msg in txResult.error, "Expected error to contain'{0}', instead found '{1}".format(msg, txResult.error) - -@then(u'"{enrollId}"\'s last transaction should have succeeded') -def step_impl(context, enrollId): - txResult = bdd_grpc_util.getTxResult(context, enrollId) - assert txResult.errorCode == 0, "Expected success (errorCode == 0), instead found errorCode={0}, error={1}".format(txResult.errorCode, txResult.error) - -@when(u'user "{enrollId}" invokes chaincode "{ccAlias}" function name "{functionName}" with args') -def step_impl(context, enrollId, ccAlias, functionName): - response = bdd_grpc_util.invokeChaincode(context, enrollId, ccAlias, functionName) - context.response = response - context.transactionID = response.msg - #assert response.status == fabric_pb2.Response.SUCCESS, 'Failure invoking chaincode {0} on {1}, for user "{2}": {3}'.format(ccAlias, userRegistration.composeService,enrollId, response.msg) - -@given(u'user "{enrollId}" stores a reference to chaincode "{ccAlias}" as "{tagName}"') -def step_impl(context, enrollId, ccAlias, tagName): - # Retrieve the userRegistration from the context - userRegistration = bdd_test_util.getUserRegistration(context, enrollId) - deployedCcSpec = bdd_grpc_util.getDeployment(context, ccAlias) - assert deployedCcSpec != None, "Deployment NOT found for chaincode alias '{0}'".format(ccAlias) - userRegistration.tags[tagName] = deployedCcSpec.chaincodeID.name diff --git a/bddtests/steps/compose.py b/bddtests/steps/compose.py index 8b80f036dde..69960dc105f 100644 --- a/bddtests/steps/compose.py +++ b/bddtests/steps/compose.py @@ -17,11 +17,29 @@ import uuid import bdd_test_util from contexthelper import ContextHelper -import peer_basic_impl import json from abc import ABCMeta, abstractmethod +class ContainerData: + def __init__(self, containerName, ipAddress, envFromInspect, composeService, ports): + self.containerName = containerName + self.ipAddress = ipAddress + self.envFromInspect = envFromInspect + self.composeService = composeService + self.ports = ports + + def getEnv(self, key): + envValue = None + for val in self.envFromInspect: + if val.startswith(key): + envValue = val[len(key):] + break + if envValue == None: + raise Exception("ENV key not found ({0}) for container ({1})".format(key, self.containerName)) + return envValue + + class CompositionCallback: __metaclass__ = ABCMeta @abstractmethod @@ -73,9 +91,10 @@ def __init__(self, context, composeFilesYaml, projectName = None, self.context = context self.containerDataList = [] self.composeFilesYaml = composeFilesYaml - self.serviceNames = [] self.serviceNames = self._collectServiceNames() + # Register with contextHelper (Supports docgen) + self.contextHelper.registerComposition(self) [callback.composing(self, context) for callback in Composition.GetCompositionCallbacksFromContext(context)] self.up(context, force_recreate, components) @@ -199,7 +218,7 @@ def rebuildContainerData(self): # container docker-compose service container_compose_service = container['Config']['Labels']['com.docker.compose.service'] - self.containerDataList.append(peer_basic_impl.ContainerData(container_name, container_ipaddress, container_env, container_compose_service, container_ports)) + self.containerDataList.append(ContainerData(container_name, container_ipaddress, container_env, container_compose_service, container_ports)) def decompose(self): self.issueCommand(["unpause"]) diff --git a/bddtests/steps/contexthelper.py b/bddtests/steps/contexthelper.py index b111b9d63c7..caef36427c5 100644 --- a/bddtests/steps/contexthelper.py +++ b/bddtests/steps/contexthelper.py @@ -82,6 +82,10 @@ def before_step(self, step): print("before_step: {0}".format(self)) print("") + def after_step(self, step): + print("after_step: {0}".format(self)) + print("") + def registerComposition(self, composition): return composition diff --git a/bddtests/steps/docgen.py b/bddtests/steps/docgen.py index 2b29f8f4464..9299dde48be 100644 --- a/bddtests/steps/docgen.py +++ b/bddtests/steps/docgen.py @@ -14,7 +14,6 @@ ) from bootstrap_util import getDirectory -from compose import Composition class DocumentGenerator: @@ -27,25 +26,32 @@ def __init__(self, contextHelper, scenario): self.composition = None #Weave advices into contextHelper - weave(target=self.contextHelper.before_step, advices=self.stepAdvice) + weave(target=self.contextHelper.before_step, advices=self.beforeStepAdvice) + weave(target=self.contextHelper.after_step, advices=self.afterStepAdvice) weave(target=self.contextHelper.after_scenario, advices=self.afterScenarioAdvice) weave(target=self.contextHelper.getBootrapHelper, advices=self.getBootstrapHelperAdvice) - - - weave(target=Composition.__init__, advices=self.registerCompositionAdvice) + weave(target=self.contextHelper.registerComposition, advices=self.registerCompositionAdvice) # Weave advices into Directory weave(target=self.directory._registerOrg, advices=self.registerOrgAdvice) weave(target=self.directory._registerUser, advices=self.registerUserAdvice) weave(target=self.directory.registerOrdererAdminTuple, advices=self.registerNamedNodeAdminTupleAdvice) - def stepAdvice(self, joinpoint): + def beforeStepAdvice(self, joinpoint): self.currentStep += 1 step = joinpoint.kwargs['step'] # Now the jinja template self.output.write(env.get_template("html/step.html").render(step_id="Step {0}".format(self.currentStep), step=step)) return joinpoint.proceed() + def afterStepAdvice(self, joinpoint): + step = joinpoint.kwargs['step'] + # Now the jinja template + if step.status=="failed": + self.output.write(env.get_template("html/error.html").render(err=step.error_message)) + return joinpoint.proceed() + + def compositionCallCLIAdvice(self, joinpoint): 'This advice is called around the compositions usage of the cli' result = joinpoint.proceed() @@ -110,11 +116,8 @@ def _writeNetworkJson(self): def registerCompositionAdvice(self, joinpoint): - composition = None - if joinpoint.kwargs['context'] == self.contextHelper.context: - # This is our context, weave into issue_command - composition = joinpoint.kwargs['self'] - weave(target=composition._callCLI, advices=self.compositionCallCLIAdvice) + composition = joinpoint.kwargs['composition'] + weave(target=composition._callCLI, advices=self.compositionCallCLIAdvice) result = joinpoint.proceed() if composition: #Now get the config for the composition and dump out. @@ -146,7 +149,7 @@ def registerOrgAdvice(self, joinpoint): f.write(orgCert) self._addLinkToFile(fileName=fileName, linkText="Public cert for Organization") #Now the jinja output - self.output.write(env.get_template("html/org.html").render(org=newlyRegisteredOrg, cert_href=self._getLinkInfoForFile(fileName))) + self.output.write(env.get_template("html/org.html").render(org=newlyRegisteredOrg, cert_href=self._getLinkInfoForFile(fileName), path_to_cert=fileName)) return newlyRegisteredOrg def registerUserAdvice(self, joinpoint): @@ -212,6 +215,13 @@ def _isListOfProtobufMessages(self, target): result = len(messageList) == len(target) return result + def _isDictOfProtobufMessages(self, target): + result = False + if isinstance(target, dict): + messageList = [item for item in target.values() if self._isProtobufMessage(item)] + result = len(messageList) == len(target) + return result + def _writeProtobuf(self, fileName, msg): import ntpath baseName = ntpath.basename(fileName) @@ -237,12 +247,15 @@ def userSetTagValueAdvice(self, joinpoint): self._writeProtobuf(fileName=fileName, msg=tagValue) # If protobuf message, write out in binary form elif self._isListOfProtobufMessages(tagValue): - import ntpath index = 0 for msg in tagValue: (fileName, fileExists) = self.contextHelper.getTmpPathForName("{0}-{1}-{2:0>4}".format(user.getUserName(), tagKey, index), extension="protobuf") self._writeProtobuf(fileName=fileName, msg=msg) index += 1 + elif self._isDictOfProtobufMessages(tagValue): + for key,msg in tagValue.iteritems(): + (fileName, fileExists) = self.contextHelper.getTmpPathForName("{0}-{1}-{2}".format(user.getUserName(), tagKey, key), extension="protobuf") + self._writeProtobuf(fileName=fileName, msg=msg) else: self.output.write(env.get_template("html/cli.html").render(command=str(tagValue))) return result \ No newline at end of file diff --git a/bddtests/steps/endorser_impl.py b/bddtests/steps/endorser_impl.py index 529542a4359..bd7e3becdeb 100644 --- a/bddtests/steps/endorser_impl.py +++ b/bddtests/steps/endorser_impl.py @@ -13,12 +13,9 @@ # limitations under the License. # -import os import endorser_util import bdd_grpc_util -import bdd_test_util import bootstrap_util -import devops_pb2 @when(u'user "{userName}" creates a chaincode spec "{ccSpecAlias}" with name "{chaincodeName}" of type "{ccType}" for chaincode "{chaincodePath}" with args') def step_impl(context, userName, ccType, chaincodeName, chaincodePath, ccSpecAlias): @@ -35,16 +32,36 @@ def step_impl(context, userName, ccDeploymentSpecAlias, ccSpecAlias, devopsCompo directory = bootstrap_util.getDirectory(context=context) user = directory.getUser(userName=userName) assert ccSpecAlias in user.tags, "ChaincodeSpec alias '{0}' not found for user '{1}'".format(ccSpecAlias, userName) - - ipAddress = bdd_test_util.ipFromContainerNamePart(devopsComposeService, context.compose_containers) - channel = bdd_grpc_util.getGRPCChannel(ipAddress) - devopsStub = devops_pb2.beta_create_Devops_stub(channel) - deploymentSpec = devopsStub.Build(user.tags[ccSpecAlias],20) + deploymentSpec = None + raise Exception("Not Implemented") #user.setTagValue(ccDeploymentSpecAlias, deploymentSpec) user.setTagValue(ccDeploymentSpecAlias, deploymentSpec) -@when(u'user "{userName}" using cert alias "{certAlias}" creates a deployment proposal "{proposalAlias}" for channel "{channelName}" using chaincode spec "{ccSpecAlias}"') +@when(u'user "{userName}" using cert alias "{certAlias}" creates a install proposal "{proposalAlias}" for channel "{channelName}" using chaincode spec "{ccSpecAlias}"') +def step_impl(context, userName, certAlias, proposalAlias, channelName, ccSpecAlias): + directory = bootstrap_util.getDirectory(context=context) + user = directory.getUser(userName=userName) + assert ccSpecAlias in user.tags, "ChaincodeSpec alias '{0}' not found for user '{1}'".format(ccSpecAlias, userName) + ccSpec = user.tags[ccSpecAlias] + + + ccDeploymentSpec = endorser_util.createDeploymentSpec(context=context, ccSpec=ccSpec) + lcChaincodeSpec = endorser_util.createInstallChaincodeSpecForBDD(ccDeploymentSpec=ccDeploymentSpec, chainID=str(channelName)) + # Find the cert using the cert tuple information saved for the user under certAlias + nodeAdminTuple = user.tags[certAlias] + signersCert = directory.findCertForNodeAdminTuple(nodeAdminTuple) + mspID = nodeAdminTuple.organization + + proposal = endorser_util.createInvokeProposalForBDD(context, ccSpec=lcChaincodeSpec, chainID=channelName,signersCert=signersCert, Mspid=mspID, type="ENDORSER_TRANSACTION") + + signedProposal = endorser_util.signProposal(proposal=proposal, entity=user, signersCert=signersCert) + + # proposal = endorser_util.createDeploymentProposalForBDD(ccDeploymentSpec) + assert not proposalAlias in user.tags, "Proposal alias '{0}' already exists for '{1}'".format(proposalAlias, userName) + user.setTagValue(proposalAlias, signedProposal) + +@when(u'user "{userName}" using cert alias "{certAlias}" creates a instantiate proposal "{proposalAlias}" for channel "{channelName}" using chaincode spec "{ccSpecAlias}"') def step_impl(context, userName, certAlias, proposalAlias, channelName, ccSpecAlias): directory = bootstrap_util.getDirectory(context=context) user = directory.getUser(userName=userName) @@ -53,6 +70,7 @@ def step_impl(context, userName, certAlias, proposalAlias, channelName, ccSpecAl ccDeploymentSpec = endorser_util.createDeploymentSpec(context=context, ccSpec=ccSpec) + ccDeploymentSpec.code_package = "" lcChaincodeSpec = endorser_util.createDeploymentChaincodeSpecForBDD(ccDeploymentSpec=ccDeploymentSpec, chainID=str(channelName)) # Find the cert using the cert tuple information saved for the user under certAlias nodeAdminTuple = user.tags[certAlias] @@ -67,6 +85,25 @@ def step_impl(context, userName, certAlias, proposalAlias, channelName, ccSpecAl assert not proposalAlias in user.tags, "Proposal alias '{0}' already exists for '{1}'".format(proposalAlias, userName) user.setTagValue(proposalAlias, signedProposal) +@when(u'user "{userName}" using cert alias "{certAlias}" creates a proposal "{proposalAlias}" for channel "{channelName}" using chaincode spec "{ccSpecAlias}"') +def step_impl(context, userName, certAlias, proposalAlias, channelName, ccSpecAlias): + directory = bootstrap_util.getDirectory(context=context) + user = directory.getUser(userName=userName) + assert ccSpecAlias in user.tags, "ChaincodeSpec alias '{0}' not found for user '{1}'".format(ccSpecAlias, userName) + lcChaincodeSpec = user.tags[ccSpecAlias] + # Find the cert using the cert tuple information saved for the user under certAlias + nodeAdminTuple = user.tags[certAlias] + signersCert = directory.findCertForNodeAdminTuple(nodeAdminTuple) + mspID = nodeAdminTuple.organization + + proposal = endorser_util.createInvokeProposalForBDD(context, ccSpec=lcChaincodeSpec, chainID=channelName,signersCert=signersCert, Mspid=mspID, type="ENDORSER_TRANSACTION") + + signedProposal = endorser_util.signProposal(proposal=proposal, entity=user, signersCert=signersCert) + + # proposal = endorser_util.createDeploymentProposalForBDD(ccDeploymentSpec) + assert not proposalAlias in user.tags, "Proposal alias '{0}' already exists for '{1}'".format(proposalAlias, userName) + user.setTagValue(proposalAlias, signedProposal) + @when(u'user "{userName}" sends proposal "{proposalAlias}" to endorsers with timeout of "{timeout}" seconds with proposal responses "{proposalResponsesAlias}"') @@ -83,8 +120,8 @@ def step_impl(context, userName, proposalAlias, timeout, proposalResponsesAlias) endorserStubs = endorser_util.getEndorserStubs(context, endorsers) proposalResponseFutures = [endorserStub.ProcessProposal.future(signedProposal, int(timeout)) for endorserStub in endorserStubs] resultsDict = dict(zip(endorsers, [respFuture.result() for respFuture in proposalResponseFutures])) - #user.setTagValue(proposalResponsesAlias, resultsDict) - user.tags[proposalResponsesAlias] = resultsDict + user.setTagValue(proposalResponsesAlias, resultsDict) + # user.tags[proposalResponsesAlias] = resultsDict @then(u'user "{userName}" expects proposal responses "{proposalResponsesAlias}" with status "{statusCode}" from endorsers') @@ -116,3 +153,21 @@ def step_impl(context, userName, proposalResponsesAlias): endorserToProposalResponseHashDict = dict(zip(endorsers, [user.computeHash(proposalRespDict[endorser].payload) for endorser in endorsers])) setOfHashes = set(endorserToProposalResponseHashDict.values()) assert len(setOfHashes) == 1, "Hashes from endorsers did NOT match: {0}".format(endorserToProposalResponseHashDict) + +@when(u'user "{userName}" creates a chaincode invocation spec "{chaincodeInvocationSpecName}" using spec "{templateSpecName}" with input') +def step_impl(context, userName, chaincodeInvocationSpecName, templateSpecName): + directory = bootstrap_util.getDirectory(context=context) + user = directory.getUser(userName) + args = bootstrap_util.getArgsFromContextForUser(context, userName) + template_chaincode_spec = user.tags[templateSpecName] + cc_invocation_spec = endorser_util.getChaincodeSpecUsingTemplate(template_chaincode_spec=template_chaincode_spec, args=bdd_grpc_util.toStringArray(args)) + user.setTagValue(chaincodeInvocationSpecName, cc_invocation_spec) + +@when(u'the user "{userName}" creates transaction "{transactionAlias}" from proposal "{proposalAlias}" and proposal responses "{proposalResponseAlias}" for channel "{channelId}"') +def step_impl(context, userName, transactionAlias, proposalAlias, proposalResponseAlias, channelId): + directory = bootstrap_util.getDirectory(context=context) + user = directory.getUser(userName) + proposalResponsesDict = user.tags[proposalResponseAlias] + proposal = user.tags[proposalAlias] + signedTx = endorser_util.createSignedTx(user, proposal, proposalResponsesDict.values()) + user.setTagValue(transactionAlias, signedTx) diff --git a/bddtests/steps/endorser_util.py b/bddtests/steps/endorser_util.py index 3d37052422e..472948293b4 100644 --- a/bddtests/steps/endorser_util.py +++ b/bddtests/steps/endorser_util.py @@ -6,7 +6,7 @@ import bdd_grpc_util import bootstrap_util from peer import chaincode_pb2 -from peer import chaincode_proposal_pb2 +from peer import transaction_pb2 from peer import proposal_pb2 from peer import peer_pb2_grpc import identities_pb2 @@ -22,6 +22,16 @@ def getChaincodeSpec(ccType, path, name, args): input = chaincode_pb2.ChaincodeInput(args = args)) return ccSpec +def getChaincodeSpecUsingTemplate(template_chaincode_spec, args): + # make chaincode spec for chaincode to be deployed + ccSpec = chaincode_pb2.ChaincodeSpec() + input = chaincode_pb2.ChaincodeInput(args = args) + ccSpec.CopyFrom(template_chaincode_spec) + ccSpec.input.CopyFrom(input) + return ccSpec + + + def createPropsalId(): return 'TODO proposal Id' @@ -50,7 +60,7 @@ def createInvokeProposalForBDD(context, ccSpec, chainID, signersCert, Mspid, typ chainHdr = bootstrapHelper.makeChainHeader(type=common_dot_common_pb2.HeaderType.Value(type), txID=tx_id, extension=ccHdrExt.SerializeToString()) - header = common_dot_common_pb2.Header(channel_header=chainHdr, signature_header=sigHdr) + header = common_dot_common_pb2.Header(channel_header=chainHdr.SerializeToString(), signature_header=sigHdr.SerializeToString()) # make proposal proposal = proposal_pb2.Proposal(header=header.SerializeToString(), payload=ccProposalPayload.SerializeToString()) @@ -58,6 +68,34 @@ def createInvokeProposalForBDD(context, ccSpec, chainID, signersCert, Mspid, typ return proposal +def createSignedTx(user, signed_proposal, proposal_responses): + assert len(proposal_responses) > 0, "Expected at least 1 ProposalResponse" + #Unpack signed proposal + proposal = proposal_pb2.Proposal() + proposal.ParseFromString(signed_proposal.proposal_bytes) + header = common_dot_common_pb2.Header() + header.ParseFromString(proposal.header) + ccProposalPayload = proposal_pb2.ChaincodeProposalPayload() + ccProposalPayload.ParseFromString(proposal.payload) + # Be sure to clear the TransientMap + ccProposalPayload.TransientMap.clear() + + endorsements = [p.endorsement for p in proposal_responses] + ccEndorsedAction = transaction_pb2.ChaincodeEndorsedAction(proposal_response_payload=proposal_responses[0].payload, endorsements=endorsements) + + ccActionPayload = transaction_pb2.ChaincodeActionPayload(chaincode_proposal_payload=ccProposalPayload.SerializeToString(), action=ccEndorsedAction) + + transaction = transaction_pb2.Transaction() + action = transaction.actions.add() + action.header = header.signature_header + action.payload = ccActionPayload.SerializeToString() + payload = common_dot_common_pb2.Payload(header=header, data=transaction.SerializeToString()) + payloadBytes = payload.SerializeToString() + signature = user.sign(payloadBytes) + envelope = common_dot_common_pb2.Envelope(payload=payloadBytes, signature=signature) + return envelope + + def signProposal(proposal, entity, signersCert): import binascii @@ -74,9 +112,11 @@ def signProposal(proposal, entity, signersCert): def createDeploymentChaincodeSpecForBDD(ccDeploymentSpec, chainID): lc_chaincode_spec = getChaincodeSpec(ccType="GOLANG", path="", name="lccc", args=['deploy', chainID, ccDeploymentSpec.SerializeToString()]) - # lc_chaincode_spec = chaincode_pb2.ChaincodeSpec(type = chaincode_pb2.ChaincodeSpec.GOLANG, - # chaincode_id = chaincode_pb2.ChaincodeID(name="lccc"), - # input = chaincode_pb2.ChaincodeInput(args = ['deploy', chainID, ccDeploymentSpec.SerializeToString()])) + return lc_chaincode_spec + +def createInstallChaincodeSpecForBDD(ccDeploymentSpec, chainID): + lc_chaincode_spec = getChaincodeSpec(ccType="GOLANG", path="", name="lccc", + args=['install', ccDeploymentSpec.SerializeToString()]) return lc_chaincode_spec def getEndorserStubs(context, composeServices): diff --git a/bddtests/steps/orderer_impl.py b/bddtests/steps/orderer_impl.py index a549e0755b8..a8fa7114fed 100644 --- a/bddtests/steps/orderer_impl.py +++ b/bddtests/steps/orderer_impl.py @@ -14,19 +14,9 @@ # limitations under the License. # -import os -import re import time -import subprocess -import devops_pb2 -import fabric_pb2 -import chaincode_pb2 import orderer_util -from grpc.framework.interfaces.face.face import NetworkError -from grpc.beta.interfaces import StatusCode - -from grpc.beta import implementations @given(u'user "{enrollId}" is an authorized user of the ordering service') def step_impl(context, enrollId): diff --git a/bddtests/steps/orderer_util.py b/bddtests/steps/orderer_util.py index 797fbe7179e..5c04ae93b6a 100644 --- a/bddtests/steps/orderer_util.py +++ b/bddtests/steps/orderer_util.py @@ -14,26 +14,17 @@ # limitations under the License. # -import os -import re import time import datetime import Queue -import subprocess -import devops_pb2 -import fabric_pb2 -import chaincode_pb2 from orderer import ab_pb2 from common import common_pb2 import bdd_test_util -import bdd_grpc_util from grpc.beta import implementations -from grpc.framework.interfaces.face.face import NetworkError from grpc.framework.interfaces.face.face import AbortionError from grpc.beta.interfaces import StatusCode -from common.common_pb2 import Payload # The default chain ID when the system is statically bootstrapped for testing TEST_CHAIN_ID = "testchainid" @@ -109,14 +100,33 @@ def handleNetworkError(self, networkError): class DeliverStreamHelper(StreamHelper): - def __init__(self, ordererStub, timeout = 1): + def __init__(self, ordererStub, timeout = 110): StreamHelper.__init__(self) # Set the UpdateMessage and start the stream sendGenerator = self.createSendGenerator(timeout) self.replyGenerator = ordererStub.Deliver(sendGenerator, timeout + 1) + def createSeekInfo(self, chainID, start = 'Oldest', end = 'Newest', behavior = 'FAIL_IF_NOT_READY'): + seekInfo = ab_pb2.SeekInfo( + start = seekPosition(start), + stop = seekPosition(end), + behavior = ab_pb2.SeekInfo.SeekBehavior.Value(behavior), + ) + print("SeekInfo = {0}".format(seekInfo)) + print("") + return common_pb2.Envelope( + payload = common_pb2.Payload( + header = common_pb2.Header( + channel_header = common_pb2.ChannelHeader( channel_id = chainID ).SerializeToString(), + signature_header = common_pb2.SignatureHeader().SerializeToString(), + ), + data = seekInfo.SerializeToString(), + ).SerializeToString(), + ) + def seekToRange(self, chainID = TEST_CHAIN_ID, start = 'Oldest', end = 'Newest'): - self.sendQueue.put(createSeekInfo(start = start, chainID = chainID)) + seekInfo = self.createSeekInfo(start = start, end = end, chainID = chainID) + self.sendQueue.put(seekInfo) def getBlocks(self): blocks = [] @@ -149,6 +159,10 @@ def __init__(self, userName): def getUserName(self): return self.userName + def closeStreams(self): + for compose_service, deliverStreamHelper in self.abDeliversStreamHelperDict.iteritems(): + deliverStreamHelper.sendQueue.put(None) + def connectToDeliverFunction(self, context, composeService, timeout=1): 'Connect to the deliver function and drain messages to associated orderer queue' assert not composeService in self.abDeliversStreamHelperDict, "Already connected to deliver stream on {0}".format(composeService) @@ -230,8 +244,8 @@ def createSeekInfo(chainID = TEST_CHAIN_ID, start = 'Oldest', end = 'Newest', b return common_pb2.Envelope( payload = common_pb2.Payload( header = common_pb2.Header( - channel_header = common_pb2.ChannelHeader( channel_id = chainID ), - signature_header = common_pb2.SignatureHeader(), + channel_header = common_pb2.ChannelHeader( channel_id = chainID ).SerializeToString(), + signature_header = common_pb2.SignatureHeader().SerializeToString(), ), data = ab_pb2.SeekInfo( start = seekPosition(start), diff --git a/bddtests/steps/peer_basic_impl.py b/bddtests/steps/peer_basic_impl.py deleted file mode 100644 index 046df0dda21..00000000000 --- a/bddtests/steps/peer_basic_impl.py +++ /dev/null @@ -1,768 +0,0 @@ -# -# 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. -# - -import os -import os.path -import re -import time -import copy -from behave import * -from datetime import datetime, timedelta -import base64 -import uuid - -import sys, requests, json - -import bdd_test_util -import compose -import bootstrap_util - -CORE_REST_PORT = 7050 -JSONRPC_VERSION = "2.0" - -class ContainerData: - def __init__(self, containerName, ipAddress, envFromInspect, composeService, ports): - self.containerName = containerName - self.ipAddress = ipAddress - self.envFromInspect = envFromInspect - self.composeService = composeService - self.ports = ports - - def getEnv(self, key): - envValue = None - for val in self.envFromInspect: - if val.startswith(key): - envValue = val[len(key):] - break - if envValue == None: - raise Exception("ENV key not found ({0}) for container ({1})".format(key, self.containerName)) - return envValue - -def buildUrl(context, ipAddress, path): - schema = "http" - if 'TLS' in context.tags: - schema = "https" - return "{0}://{1}:{2}{3}".format(schema, ipAddress, CORE_REST_PORT, path) - -def currentTime(): - return time.strftime("%H:%M:%S") - -def getDockerComposeFileArgsFromYamlFile(compose_yaml): - parts = compose_yaml.split() - args = [] - for part in parts: - args = args + ["-f"] + [part] - return args - -@given(u'we compose "{composeYamlFile}"') -def step_impl(context, composeYamlFile): - # time.sleep(10) # Should be replaced with a definitive interlock guaranteeing that all peers/membersrvc are ready - composition = compose.Composition(context, composeYamlFile) - context.compose_containers = composition.containerDataList - context.composition = composition - -@when(u'requesting "{path}" from "{containerName}"') -def step_impl(context, path, containerName): - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, path) - print("Requesting path = {0}".format(request_url)) - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - assert resp.status_code == 200, "Failed to GET url %s: %s" % (request_url,resp.text) - context.response = resp - print("") - -@then(u'I should get a JSON response containing "{attribute}" attribute') -def step_impl(context, attribute): - getAttributeFromJSON(attribute, context.response.json(), "Attribute not found in response (%s)" %(attribute)) - -@then(u'I should get a JSON response containing no "{attribute}" attribute') -def step_impl(context, attribute): - try: - getAttributeFromJSON(attribute, context.response.json(), "") - assert None, "Attribute found in response (%s)" %(attribute) - except AssertionError: - print("Attribute not found as was expected.") - -def getAttributeFromJSON(attribute, jsonObject, msg): - return getHierarchyAttributesFromJSON(attribute.split("."), jsonObject, msg) - -def getHierarchyAttributesFromJSON(attributes, jsonObject, msg): - if len(attributes) > 0: - assert attributes[0] in jsonObject, msg - return getHierarchyAttributesFromJSON(attributes[1:], jsonObject[attributes[0]], msg) - return jsonObject - -def formatStringToCompare(value): - # double quotes are replaced by simple quotes because is not possible escape double quotes in the attribute parameters. - return str(value).replace("\"", "'") - -@then(u'I should get a JSON response with "{attribute}" = "{expectedValue}"') -def step_impl(context, attribute, expectedValue): - foundValue = getAttributeFromJSON(attribute, context.response.json(), "Attribute not found in response (%s)" %(attribute)) - assert (formatStringToCompare(foundValue) == expectedValue), "For attribute %s, expected (%s), instead found (%s)" % (attribute, expectedValue, foundValue) - -@then(u'I should get a JSON response with array "{attribute}" contains "{expectedValue}" elements') -def step_impl(context, attribute, expectedValue): - foundValue = getAttributeFromJSON(attribute, context.response.json(), "Attribute not found in response (%s)" %(attribute)) - assert (len(foundValue) == int(expectedValue)), "For attribute %s, expected array of size (%s), instead found (%s)" % (attribute, expectedValue, len(foundValue)) - -@given(u'I wait "{seconds}" seconds') -def step_impl(context, seconds): - time.sleep(float(seconds)) - -@when(u'I wait "{seconds}" seconds') -def step_impl(context, seconds): - time.sleep(float(seconds)) - -@then(u'I wait "{seconds}" seconds') -def step_impl(context, seconds): - time.sleep(float(seconds)) - -@when(u'I deploy lang chaincode "{chaincodePath}" of "{chainLang}" with ctor "{ctor}" to "{containerName}"') -def step_impl(context, chaincodePath, chainLang, ctor, containerName): - print("Printing chaincode language " + chainLang) - - chaincode = { - "path": chaincodePath, - "language": chainLang, - "constructor": ctor, - "args": getArgsFromContext(context), - } - - deployChainCodeToContainer(context, chaincode, containerName) - -def getArgsFromContext(context): - args = [] - if 'table' in context: - # There is ctor arguments - args = context.table[0].cells - return args - -@when(u'I deploy chaincode "{chaincodePath}" with ctor "{ctor}" to "{containerName}"') -def step_impl(context, chaincodePath, ctor, containerName): - chaincode = { - "path": chaincodePath, - "language": "GOLANG", - "constructor": ctor, - "args": getArgsFromContext(context), - } - - deployChainCodeToContainer(context, chaincode, containerName) - -@when(u'I deploy chaincode with name "{chaincodeName}" and with ctor "{ctor}" to "{containerName}"') -def step_impl(context, chaincodeName, ctor, containerName): - chaincode = { - "name": chaincodeName, - "language": "GOLANG", - "constructor": ctor, - "args": getArgsFromContext(context), - } - - deployChainCodeToContainer(context, chaincode, containerName) - time.sleep(2.0) # After #2068 implemented change this to only apply after a successful ping - -def deployChainCodeToContainer(context, chaincode, containerName): - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/chaincode") - print("Requesting path = {0}".format(request_url)) - - chaincodeSpec = createChaincodeSpec(context, chaincode) - chaincodeOpPayload = createChaincodeOpPayload("deploy", chaincodeSpec) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeOpPayload), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - chaincodeName = resp.json()['result']['message'] - chaincodeSpec['chaincodeID']['name'] = chaincodeName - context.chaincodeSpec = chaincodeSpec - print(json.dumps(chaincodeSpec, indent=4)) - print("") - -def createChaincodeSpec(context, chaincode): - chaincode = validateChaincodeDictionary(chaincode) - args = prepend(chaincode["constructor"], chaincode["args"]) - # Create a ChaincodeSpec structure - chaincodeSpec = { - "type": getChaincodeTypeValue(chaincode["language"]), - "chaincodeID": { - "path" : chaincode["path"], - "name" : chaincode["name"] - }, - "ctorMsg": { - "args" : args - }, - } - - if 'userName' in context: - chaincodeSpec["secureContext"] = context.userName - if 'metadata' in context: - chaincodeSpec["metadata"] = context.metadata - - return chaincodeSpec - -def validateChaincodeDictionary(chaincode): - chaincodeFields = ["path", "name", "language", "constructor", "args"] - - for field in chaincodeFields: - if field not in chaincode: - chaincode[field] = "" - - return chaincode - -def getChaincodeTypeValue(chainLang): - if chainLang == "GOLANG": - return 1 - elif chainLang =="JAVA": - return 4 - elif chainLang == "NODE": - return 2 - elif chainLang == "CAR": - return 3 - elif chainLang == "UNDEFINED": - return 0 - return 1 - -@when(u'I mock deploy chaincode with name "{chaincodeName}"') -def step_impl(context, chaincodeName): - chaincode = { - "name": chaincodeName, - "language": "GOLANG" - } - - context.chaincodeSpec = createChaincodeSpec(context, chaincode) - -@then(u'I should have received a chaincode name') -def step_impl(context): - if 'chaincodeSpec' in context: - assert context.chaincodeSpec['chaincodeID']['name'] != "" - # Set the current transactionID to the name passed back - context.transactionID = context.chaincodeSpec['chaincodeID']['name'] - elif 'grpcChaincodeSpec' in context: - assert context.grpcChaincodeSpec.chaincodeID.name != "" - # Set the current transactionID to the name passed back - context.transactionID = context.grpcChaincodeSpec.chaincodeID.name - else: - fail('chaincodeSpec not in context') - -@when(u'I invoke chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}" with "{idGenAlg}"') -def step_impl(context, chaincodeName, functionName, containerName, idGenAlg): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - invokeChaincode(context, "invoke", functionName, containerName, idGenAlg) - -@when(u'I invoke chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}" "{times}" times') -def step_impl(context, chaincodeName, functionName, containerName, times): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/chain") - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - assert resp.status_code == 200, "Failed to get chain height %s: %s" % (request_url,resp.text) - context.chainheight = getAttributeFromJSON("height", resp.json(), "Height not found in response.") - context.txcount = times - for i in range(int(times)): - invokeChaincode(context, "invoke", functionName, containerName) - -@when(u'I invoke chaincode "{chaincodeName}" function name "{functionName}" with attributes "{attrs}" on "{containerName}"') -def step_impl(context, chaincodeName, functionName, attrs, containerName): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - assert attrs, "attrs were not specified" - invokeChaincode(context, "invoke", functionName, containerName, None, attrs.split(",")) - -@when(u'I invoke chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}"') -def step_impl(context, chaincodeName, functionName, containerName): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - invokeChaincode(context, "invoke", functionName, containerName) - -@when(u'I invoke master chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}"') -def step_impl(context, chaincodeName, functionName, containerName): - invokeMasterChaincode(context, "invoke", chaincodeName, functionName, containerName) - -@then(u'I should have received a transactionID') -def step_impl(context): - assert 'transactionID' in context, 'transactionID not found in context' - assert context.transactionID != "" - pass - -@when(u'I unconditionally query chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}"') -def step_impl(context, chaincodeName, functionName, containerName): - invokeChaincode(context, "query", functionName, containerName) - -@when(u'I query chaincode "{chaincodeName}" function name "{functionName}" on "{containerName}"') -def step_impl(context, chaincodeName, functionName, containerName): - invokeChaincode(context, "query", functionName, containerName) - -def createChaincodeOpPayload(method, chaincodeSpec): - chaincodeOpPayload = { - "jsonrpc": JSONRPC_VERSION, - "method" : method, - "params" : chaincodeSpec, - "id" : 1 - } - return chaincodeOpPayload - -def invokeChaincode(context, devopsFunc, functionName, containerName, idGenAlg=None, attributes=[]): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - # Update the chaincodeSpec ctorMsg for invoke - args = [] - if 'table' in context: - # There is ctor arguments - args = context.table[0].cells - args = prepend(functionName, args) - for idx, attr in enumerate(attributes): - attributes[idx] = attr.strip() - - context.chaincodeSpec['attributes'] = attributes - - #If idGenAlg is passed then, we still using the deprecated devops API because this parameter can't be passed in the new API. - if idGenAlg != None: - context.chaincodeSpec['ctorMsg']['args'] = to_bytes(args) - invokeUsingDevopsService(context, devopsFunc, functionName, containerName, idGenAlg) - else: - context.chaincodeSpec['ctorMsg']['args'] = args - invokeUsingChaincodeService(context, devopsFunc, functionName, containerName) - -def invokeUsingChaincodeService(context, devopsFunc, functionName, containerName): - # Invoke the POST - chaincodeOpPayload = createChaincodeOpPayload(devopsFunc, context.chaincodeSpec) - - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - - request_url = buildUrl(context, ipAddress, "/chaincode") - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - print("Using attributes {0}".format(context.chaincodeSpec['attributes'])) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeOpPayload), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - print("RESULT from {0} of chaincode from peer {1}".format(functionName, containerName)) - print(json.dumps(context.response.json(), indent = 4)) - if 'result' in resp.json(): - result = resp.json()['result'] - if 'message' in result: - transactionID = result['message'] - context.transactionID = transactionID - -def invokeUsingDevopsService(context, devopsFunc, functionName, containerName, idGenAlg): - # Invoke the POST - chaincodeInvocationSpec = { - "chaincodeSpec" : context.chaincodeSpec - } - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - if idGenAlg is not None: - chaincodeInvocationSpec['idGenerationAlg'] = idGenAlg - request_url = buildUrl(context, ipAddress, "/devops/{0}".format(devopsFunc)) - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeInvocationSpec), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - print("RESULT from {0} of chaincode from peer {1}".format(functionName, containerName)) - print(json.dumps(context.response.json(), indent = 4)) - if 'message' in resp.json(): - transactionID = context.response.json()['message'] - context.transactionID = transactionID - -def invokeMasterChaincode(context, devopsFunc, chaincodeName, functionName, containerName): - args = [] - if 'table' in context: - args = context.table[0].cells - args = prepend(functionName, args) - typeGolang = 1 - chaincodeSpec = { - "type": typeGolang, - "chaincodeID": { - "name" : chaincodeName - }, - "ctorMsg": { - "args" : args - } - } - if 'userName' in context: - chaincodeSpec["secureContext"] = context.userName - - chaincodeOpPayload = createChaincodeOpPayload(devopsFunc, chaincodeSpec) - - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/chaincode") - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeOpPayload), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - print("RESULT from {0} of chaincode from peer {1}".format(functionName, containerName)) - print(json.dumps(context.response.json(), indent = 4)) - if 'result' in resp.json(): - result = resp.json()['result'] - if 'message' in result: - transactionID = result['message'] - context.transactionID = transactionID - -@then(u'I wait "{seconds}" seconds for chaincode to build') -def step_impl(context, seconds): - """ This step takes into account the chaincodeImagesUpToDate tag, in which case the wait is reduce to some default seconds""" - reducedWaitTime = 4 - if 'chaincodeImagesUpToDate' in context.tags: - print("Assuming images are up to date, sleeping for {0} seconds instead of {1} in scenario {2}".format(reducedWaitTime, seconds, context.scenario.name)) - time.sleep(float(reducedWaitTime)) - else: - time.sleep(float(seconds)) - -@then(u'I wait "{seconds}" seconds for transaction to be committed to block on "{containerName}"') -def step_impl(context, seconds, containerName): - assert 'transactionID' in context, "transactionID not found in context" - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/transactions/{0}".format(context.transactionID)) - print("{0} GETing path = {1}".format(currentTime(), request_url)) - - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - -def multiRequest(context, seconds, containerDataList, pathBuilderFunc): - """Perform a multi request against the system""" - # Build map of "containerName" : response - respMap = {container.containerName:None for container in containerDataList} - # Set the max time before stopping attempts - maxTime = datetime.now() + timedelta(seconds = int(seconds)) - for container in containerDataList: - ipAddress = container.ipAddress - request_url = buildUrl(context, ipAddress, pathBuilderFunc(context, container)) - - # Loop unless failure or time exceeded - while (datetime.now() < maxTime): - print("{0} GETing path = {1}".format(currentTime(), request_url)) - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - respMap[container.containerName] = resp - else: - raise Exception("Max time exceeded waiting for multiRequest with current response map = {0}".format(respMap)) - -@then(u'I wait up to "{seconds}" seconds for transaction to be committed to all peers') -def step_impl(context, seconds): - assert 'transactionID' in context, "transactionID not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - - # Build map of "containerName" : resp.statusCode - respMap = {container.containerName:0 for container in context.compose_containers} - - # Set the max time before stopping attempts - maxTime = datetime.now() + timedelta(seconds = int(seconds)) - for container in context.compose_containers: - ipAddress = container.ipAddress - request_url = buildUrl(context, ipAddress, "/transactions/{0}".format(context.transactionID)) - - # Loop unless failure or time exceeded - while (datetime.now() < maxTime): - print("{0} GETing path = {1}".format(currentTime(), request_url)) - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - if resp.status_code == 404: - # Pause then try again - respMap[container.containerName] = 404 - time.sleep(1) - continue - elif resp.status_code == 200: - # Success, continue - respMap[container.containerName] = 200 - break - else: - raise Exception("Error requesting {0}, returned result code = {1}".format(request_url, resp.status_code)) - else: - raise Exception("Max time exceeded waiting for transactions with current response map = {0}".format(respMap)) - print("Result of request to all peers = {0}".format(respMap)) - print("") - -@then(u'I check the transaction ID if it is "{tUUID}"') -def step_impl(context, tUUID): - assert 'transactionID' in context, "transactionID not found in context" - assert context.transactionID == tUUID, "transactionID is not tUUID" - -@then(u'I wait up to "{seconds}" seconds for transaction to be committed to peers') -def step_impl(context, seconds): - assert 'transactionID' in context, "transactionID not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers) not found in context" - - aliases = context.table.headings - containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, aliases, lambda containerData: containerData) - - # Build map of "containerName" : resp.statusCode - respMap = {container.containerName:0 for container in containerDataList} - - # Set the max time before stopping attempts - maxTime = datetime.now() + timedelta(seconds = int(seconds)) - for container in containerDataList: - ipAddress = container.ipAddress - request_url = buildUrl(context, ipAddress, "/transactions/{0}".format(context.transactionID)) - - # Loop unless failure or time exceeded - while (datetime.now() < maxTime): - print("{0} GETing path = {1}".format(currentTime(), request_url)) - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - if resp.status_code == 404: - # Pause then try again - respMap[container.containerName] = 404 - time.sleep(1) - continue - elif resp.status_code == 200: - # Success, continue - respMap[container.containerName] = 200 - break - else: - raise Exception("Error requesting {0}, returned result code = {1}".format(request_url, resp.status_code)) - else: - raise Exception("Max time exceeded waiting for transactions with current response map = {0}".format(respMap)) - print("Result of request to all peers = {0}".format(respMap)) - print("") - -@then(u'I wait up to "{seconds}" seconds for transactions to be committed to peers') -def step_impl(context, seconds): - assert 'chainheight' in context, "chainheight not found in context" - assert 'txcount' in context, "txcount not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers) not found in context" - - aliases = context.table.headings - containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, aliases, lambda containerData: containerData) - - # Build map of "containerName" : resp.statusCode - respMap = {container.containerName:0 for container in containerDataList} - - # Set the max time before stopping attempts - maxTime = datetime.now() + timedelta(seconds = int(seconds)) - for container in containerDataList: - ipAddress = container.ipAddress - request_url = buildUrl(context, ipAddress, "/chain") - - # Loop unless failure or time exceeded - while (datetime.now() < maxTime): - print("{0} GETing path = {1}".format(currentTime(), request_url)) - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - if resp.status_code == 404: - # Pause then try again - respMap[container.containerName] = 404 - time.sleep(1) - continue - elif resp.status_code == 200: - height = getAttributeFromJSON("height", resp.json(), "Height not found in response.") - if height >= int(context.chainheight) + int(context.txcount): - # Success, continue - respMap[container.containerName] = 200 - break - else: - continue - else: - raise Exception("Error requesting {0}, returned result code = {1}".format(request_url, resp.status_code)) - else: - raise Exception("Max time exceeded waiting for transactions with current response map = {0}".format(respMap)) - print("Result of request to all peers = {0}".format(respMap)) - print("") - - -@then(u'I should get a rejection message in the listener after stopping it') -def step_impl(context): - assert "eventlistener" in context, "no eventlistener is started" - context.eventlistener.terminate() - output = context.eventlistener.stdout.read() - rejection = "Received rejected transaction" - assert rejection in output, "no rejection message was found" - assert output.count(rejection) == 1, "only one rejection message should be found" - - -@when(u'I query chaincode "{chaincodeName}" function name "{functionName}" on all peers') -def step_impl(context, chaincodeName, functionName): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - # Update the chaincodeSpec ctorMsg for invoke - args = [] - if 'table' in context: - # There is ctor arguments - args = context.table[0].cells - args = prepend(functionName, args) - context.chaincodeSpec['ctorMsg']['args'] = args #context.table[0].cells if ('table' in context) else [] - # Invoke the POST - chaincodeOpPayload = createChaincodeOpPayload("query", context.chaincodeSpec) - - responses = [] - for container in context.compose_containers: - request_url = buildUrl(context, container.ipAddress, "/chaincode") - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeOpPayload), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - responses.append(resp) - context.responses = responses - -@when(u'I unconditionally query chaincode "{chaincodeName}" function name "{functionName}" with value "{value}" on peers') -def step_impl(context, chaincodeName, functionName, value): - query_common(context, chaincodeName, functionName, value, False) - -@when(u'I query chaincode "{chaincodeName}" function name "{functionName}" with value "{value}" on peers') -def step_impl(context, chaincodeName, functionName, value): - query_common(context, chaincodeName, functionName, value, True) - -def query_common(context, chaincodeName, functionName, value, failOnError): - assert 'chaincodeSpec' in context, "chaincodeSpec not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers) not found in context" - assert 'peerToSecretMessage' in context, "peerToSecretMessage map not found in context" - - aliases = context.table.headings - containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, aliases, lambda containerData: containerData) - - # Update the chaincodeSpec ctorMsg for invoke - context.chaincodeSpec['ctorMsg']['args'] = [functionName, value] - # Invoke the POST - # Make deep copy of chaincodeSpec as we will be changing the SecurityContext per call. - chaincodeOpPayload = createChaincodeOpPayload("query", copy.deepcopy(context.chaincodeSpec)) - - responses = [] - for container in containerDataList: - # Change the SecurityContext per call - chaincodeOpPayload['params']["secureContext"] = context.peerToSecretMessage[container.composeService]['enrollId'] - print("Container {0} enrollID = {1}".format(container.containerName, container.getEnv("CORE_SECURITY_ENROLLID"))) - request_url = buildUrl(context, container.ipAddress, "/chaincode") - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(chaincodeOpPayload), timeout=30, verify=False) - if failOnError: - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - print("RESULT from {0} of chaincode from peer {1}".format(functionName, container.containerName)) - print(json.dumps(resp.json(), indent = 4)) - responses.append(resp) - context.responses = responses - -@then(u'I should get a JSON response from all peers with "{attribute}" = "{expectedValue}"') -def step_impl(context, attribute, expectedValue): - assert 'responses' in context, "responses not found in context" - for resp in context.responses: - foundValue = getAttributeFromJSON(attribute, resp.json(), "Attribute not found in response (%s)" %(attribute)) - assert (formatStringToCompare(foundValue) == expectedValue), "For attribute %s, expected (%s), instead found (%s)" % (attribute, expectedValue, foundValue) - -@then(u'I should get a JSON response from peers with "{attribute}" = "{expectedValue}"') -def step_impl(context, attribute, expectedValue): - assert 'responses' in context, "responses not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers) not found in context" - - for resp in context.responses: - foundValue = getAttributeFromJSON(attribute, resp.json(), "Attribute not found in response (%s)" %(attribute)) - assert (formatStringToCompare(foundValue) == expectedValue), "For attribute %s, expected (%s), instead found (%s)" % (attribute, expectedValue, foundValue) - -@given(u'I register with CA supplying username "{userName}" and secret "{secret}" on peers') -def step_impl(context, userName, secret): - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers) not found in context" - - # Get list of IPs to login to - aliases = context.table.headings - containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, aliases, lambda containerData: containerData) - - secretMsg = { - "enrollId": userName, - "enrollSecret" : secret - } - - # Login to each container specified - for containerData in containerDataList: - request_url = buildUrl(context, containerData.ipAddress, "/registrar") - print("{0} POSTing path = {1}".format(currentTime(), request_url)) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(secretMsg), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - print("message = {0}".format(resp.json())) - - # Create new User entry - bdd_test_util.registerUser(context, secretMsg, containerData.composeService) - - # Store the username in the context - context.userName = userName - # if we already have the chaincodeSpec, change secureContext - if 'chaincodeSpec' in context: - context.chaincodeSpec["secureContext"] = context.userName - - -@given(u'I use the following credentials for querying peers') -def step_impl(context): - assert 'compose_containers' in context, "compose_containers not found in context" - assert 'table' in context, "table (of peers, username, secret) not found in context" - - peerToSecretMessage = {} - - # Login to each container specified using username and secret - for row in context.table.rows: - peer, userName, secret = row['peer'], row['username'], row['secret'] - secretMsg = { - "enrollId": userName, - "enrollSecret" : secret - } - - ipAddress = bdd_test_util.ipFromContainerNamePart(peer, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/registrar") - print("POSTing to service = {0}, path = {1}".format(peer, request_url)) - - resp = requests.post(request_url, headers={'Content-type': 'application/json'}, data=json.dumps(secretMsg), verify=False) - assert resp.status_code == 200, "Failed to POST to %s: %s" %(request_url, resp.text) - context.response = resp - print("message = {0}".format(resp.json())) - peerToSecretMessage[peer] = secretMsg - context.peerToSecretMessage = peerToSecretMessage - - -@given(u'I stop peers') -def step_impl(context): - compose_op(context, "stop") - - -@given(u'I start a listener') -def step_impl(context): - gopath = os.environ.get('GOPATH') - assert gopath is not None, "Please set GOPATH properly!" - listener = os.path.join(gopath, "src/github.com/hyperledger/fabric/build/bin/block-listener") - assert os.path.isfile(listener), "Please build the block-listener binary!" - bdd_test_util.start_background_process(context, "eventlistener", [listener, "-listen-to-rejections"] ) - - -@given(u'I start peers') -def step_impl(context): - compose_op(context, "start") - -@given(u'I pause peers') -def step_impl(context): - compose_op(context, "pause") - -@given(u'I unpause peers') -def step_impl(context): - compose_op(context, "unpause") - -def compose_op(context, op): - assert 'table' in context, "table (of peers) not found in context" - assert 'composition' in context, "composition not found in context" - services = context.table.headings - context.composition.issueCommand([op] + services) - context.compose_containers = context.composition.containerDataList - -def to_bytes(strlist): - return [base64.standard_b64encode(s.encode('ascii')) for s in strlist] - -def prepend(elem, l): - if l is None or l == "": - tail = [] - else: - tail = l - if elem is None: - return tail - return [elem] + tail - -@given(u'I do nothing') -def step_impl(context): - pass diff --git a/bddtests/steps/peer_cli_impl.py b/bddtests/steps/peer_cli_impl.py deleted file mode 100644 index 43f5b3bc28f..00000000000 --- a/bddtests/steps/peer_cli_impl.py +++ /dev/null @@ -1,97 +0,0 @@ -# -# 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. -# - -import json -from behave import * -from bdd_test_util import cli_call, fullNameFromContainerNamePart -from peer_basic_impl import getAttributeFromJSON - -@when(u'I execute "{command}" in container {containerName}') -def step_impl(context, command, containerName): - print("Run command: \"{0}\" in container {1}".format(command, containerName)) - executeCommandInContainer(context, command, containerName) - print("stdout: {0}".format(context.command["stdout"])) - print("stderr: {0}".format(context.command["stderr"])) - print("returnCode: {0}".format(context.command["returnCode"])) - -def executeCommandInContainer(context, command, container): - fullContainerName = fullNameFromContainerNamePart(container, context.compose_containers) - command = "docker exec {} {}".format(fullContainerName, command) - executeCommand(context, command) - -def executeCommand(context, command): - # cli_call expects an array of arguments, hence splitting here. - commandArgs = command.split() - stdout, stderr, retcode = cli_call(commandArgs, expect_success=False) - - context.command = { - "stdout": stdout, - "stderr": stderr, - "returnCode": retcode - } - -@then(u'the command should not complete successfully') -def step_impl(context): - assert not commandCompletedSuccessfully(context) - -@then(u'the command should complete successfully') -def step_impl(context): - assert commandCompletedSuccessfully(context) - -def commandCompletedSuccessfully(context): - return isSuccessfulReturnCode(context.command["returnCode"]) - -def isSuccessfulReturnCode(returnCode): - return returnCode == 0 - -@then(u'{stream} should contain JSON') -def step_impl(context, stream): - assertIsJson(context.command[stream]) - -@then(u'{stream} should contain JSON with "{attribute}" array of length {length}') -def step_impl(context, stream, attribute, length): - data = context.command[stream] - assertIsJson(data) - - json = decodeJson(data) - array = getAttribute(attribute, json) - assertLength(array, int(length)) - -@then(u'I should get result with "{expectResult}"') -def step_impl(context, expectResult): - assert context.command["stdout"].strip('\n') == expectResult - -def assertIsJson(data): - assert isJson(data), "Data is not in JSON format" - -def isJson(data): - try: - decodeJson(data) - except ValueError: - return False - - return True - -def decodeJson(data): - return json.loads(data) - -def getAttribute(attribute, json): - return getAttributeFromJSON(attribute, json, - "Attribute '{}' missing from JSON".format(attribute)) - -def assertLength(array, length): - arrayLength = len(array) - assert arrayLength == length, "Unexpected array length. Expected {}, got {}".format(length, arrayLength) diff --git a/bddtests/steps/peer_logging_impl.py b/bddtests/steps/peer_logging_impl.py deleted file mode 100755 index 177b4349ed4..00000000000 --- a/bddtests/steps/peer_logging_impl.py +++ /dev/null @@ -1,61 +0,0 @@ -# -# 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. -# - -import os -import os.path -import re -import time -import copy -from datetime import datetime, timedelta -from behave import * - -import sys, requests, json - -import bdd_test_util - -@then(u'I wait up to {waitTime} seconds for an error in the logs for peer {peerName}') -def step_impl(context, waitTime, peerName): - timeout = time.time() + float(waitTime) - hasError = False - - while timeout > time.time(): - stdout, stderr = getPeerLogs(context, peerName) - hasError = logHasError(stdout) or logHasError(stderr) - - if hasError: - break - - time.sleep(1.0) - - assert hasError is True - -def getPeerLogs(context, peerName): - fullContainerName = bdd_test_util.fullNameFromContainerNamePart(peerName, context.compose_containers) - stdout, stderr, retcode = bdd_test_util.cli_call(["docker", "logs", fullContainerName], expect_success=True) - - return stdout, stderr - -def logHasError(logText): - # This seems to be an acceptable heuristic for detecting errors - return logText.find("-> ERRO") >= 0 - -@then(u'ensure after {waitTime} seconds there are no errors in the logs for peer {peerName}') -def step_impl(context, waitTime, peerName): - time.sleep(float(waitTime)) - stdout, stderr = getPeerLogs(context, peerName) - - assert logHasError(stdout) is False - assert logHasError(stderr) is False \ No newline at end of file diff --git a/bddtests/steps/peer_rest_impl.py b/bddtests/steps/peer_rest_impl.py deleted file mode 100644 index 59f25d9bf9c..00000000000 --- a/bddtests/steps/peer_rest_impl.py +++ /dev/null @@ -1,51 +0,0 @@ -# -# 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. -# - -import requests -from behave import * -from peer_basic_impl import buildUrl -from peer_basic_impl import getAttributeFromJSON - -import bdd_test_util - - -@when(u'I request transaction certs with query parameters on "{containerName}"') -def step_impl(context, containerName): - assert 'table' in context, "table (of query parameters) not found in context" - assert 'userName' in context, "userName not found in context" - assert 'compose_containers' in context, "compose_containers not found in context" - - ipAddress = bdd_test_util.ipFromContainerNamePart(containerName, context.compose_containers) - request_url = buildUrl(context, ipAddress, "/registrar/{0}/tcert".format(context.userName)) - print("Requesting path = {0}".format(request_url)) - queryParams = {} - for row in context.table.rows: - key, value = row['key'], row['value'] - queryParams[key] = value - - print("Query parameters = {0}".format(queryParams)) - resp = requests.get(request_url, params=queryParams, headers={'Accept': 'application/json'}, verify=False) - - assert resp.status_code == 200, "Failed to GET to %s: %s" % (request_url, resp.text) - context.response = resp - print("") - -@then(u'I should get a JSON response with "{expectedValue}" different transaction certs') -def step_impl(context, expectedValue): - print(context.response.json()) - foundValue = getAttributeFromJSON("OK", context.response.json(), "Attribute not found in response (OK)") - print(len(set(foundValue))) - assert (len(set(foundValue)) == int(expectedValue)), "For attribute OK, expected different transaction cert of size (%s), instead found (%s)" % (expectedValue, len(set(foundValue))) \ No newline at end of file diff --git a/bddtests/steps/sdk_impl.py b/bddtests/steps/sdk_impl.py deleted file mode 100644 index e149cec21c7..00000000000 --- a/bddtests/steps/sdk_impl.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import re -import time -import copy -import base64 -from datetime import datetime, timedelta - -import sys, requests, json - -import bdd_test_util - -from grpc.beta import implementations - -import fabric_pb2 -import chaincode_pb2 -import devops_pb2 - -SDK_NODE_APP_REST_PORT = 8080 - -def buildUrl(context, ipAddress, path): - schema = "http" - if 'TLS' in context.tags: - schema = "https" - return "{0}://{1}:{2}{3}".format(schema, ipAddress, SDK_NODE_APP_REST_PORT, path) - - -@given(u'I register thru the sample SDK app supplying username "{enrollId}" and secret "{enrollSecret}" on "{composeService}"') -def step_impl(context, enrollId, enrollSecret, composeService): - assert 'compose_containers' in context, "compose_containers not found in context" - - # Get the sampleApp IP Address - containerDataList = bdd_test_util.getContainerDataValuesFromContext(context, [composeService], lambda containerData: containerData) - sampleAppIpAddress = containerDataList[0].ipAddress - secretMsg = { - "enrollId": enrollId, - "enrollSecret" : enrollSecret - } - request_url = buildUrl(context, sampleAppIpAddress, "/") - resp = requests.get(request_url, headers={'Accept': 'application/json'}, verify=False) - assert resp.status_code == 200, "Failed to GET url %s: %s" % (request_url,resp.text) - context.response = resp - print("") - diff --git a/bddtests/templates/html/error.html b/bddtests/templates/html/error.html new file mode 100644 index 00000000000..6162cf4c2f0 --- /dev/null +++ b/bddtests/templates/html/error.html @@ -0,0 +1,5 @@ +
+ +{{ err }} + +
\ No newline at end of file diff --git a/bddtests/templates/html/org-py.html b/bddtests/templates/html/org-py.html new file mode 100644 index 00000000000..886ce9cfa83 --- /dev/null +++ b/bddtests/templates/html/org-py.html @@ -0,0 +1,17 @@ +
+ {% set certVarName = ['cert_for',org.name]|join('_') %} +
+ +from cryptography import x509 +from cryptography.hazmat.backends import default_backend + +pem_data = None +with open('{{ path_to_cert }}') as f: + pem_data = f.read() + +{{ certVarName }} = x509.load_pem_x509_certificate(pem_data, default_backend()) +ski_for_{{ org.name }}= {{ certVarName }}.extensions.get_extension_for_oid(x509.oid.ExtensionOID.SUBJECT_KEY_IDENTIFIER) + + +
+
diff --git a/bddtests/templates/html/org.html b/bddtests/templates/html/org.html index b79f4f95201..33698261e35 100644 --- a/bddtests/templates/html/org.html +++ b/bddtests/templates/html/org.html @@ -1,4 +1,7 @@

Created new organization {{ org.name }} with public cert

{{ org.getCertAsPEM() }} +{% if path_to_cert %} + {% include 'html/org-py.html' %} +{% endif %}
diff --git a/bddtests/templates/html/report.css b/bddtests/templates/html/report.css index 57f313aef62..e1ac712324f 100644 --- a/bddtests/templates/html/report.css +++ b/bddtests/templates/html/report.css @@ -21,6 +21,23 @@ li { padding: 2px; } +li.passed a{ + color: green; +} + +li.skipped a{ + color: blue; +} + +li.undefined a{ + color: yellow; + text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; +} + +li.failed a{ + color: red; +} + a:link { text-decoration: none; color: #1c7eba; diff --git a/bddtests/templates/html/scenario.html b/bddtests/templates/html/scenario.html index a37dbf05a48..d1a9345e596 100644 --- a/bddtests/templates/html/scenario.html +++ b/bddtests/templates/html/scenario.html @@ -1,12 +1,14 @@
+

{{ scenario.name }}


diff --git a/bddtests/utxo.feature b/bddtests/utxo.feature deleted file mode 100644 index 1baf249d533..00000000000 --- a/bddtests/utxo.feature +++ /dev/null @@ -1,46 +0,0 @@ -# -# Test openchain Peers -# -# Tags that can be used and will affect test internals: -# -# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. -# -# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! - -#@chaincodeImagesUpToDate -@preV1 -Feature: utxo - As an openchain developer - I want to be able to launch a 3 peers - - #@doNotDecompose - @wip - @issueUtxo - Scenario: UTXO chaincode test - Given we compose "docker-compose-1.yml" - And I wait "1" seconds - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "1" - When I deploy chaincode "github.com/openblockchain/obc-peer/examples/chaincode/go/utxo" with ctor "init" to "vp0" - || - || - - Then I should have received a chaincode name - Then I wait up to "60" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "2" - - When I invoke chaincode "map" function name "execute" on "vp0" - | arg1 | - | AQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////9NBP//AB0BBEVUaGUgVGltZXMgMDMvSmFuLzIwMDkgQ2hhbmNlbGxvciBvbiBicmluayBvZiBzZWNvbmQgYmFpbG91dCBmb3IgYmFua3P/////AQDyBSoBAAAAQ0EEZ4r9sP5VSCcZZ/GmcTC3EFzWqCjgOQmmeWLg6h9h3rZJ9rw/TO84xPNVBOUewRLeXDhN97oLjVeKTHAra/EdX6wAAAAA | - Then I should have received a transactionID - Then I wait up to "25" seconds for transaction to be committed to all peers - - When requesting "/chain" from "vp0" - Then I should get a JSON response with "height" = "3" - - # When I query chaincode "map" function name "get" on "vp0": - # | arg1| - # | key1 | - # Then I should get a JSON response with "OK" = "value1"