diff --git a/Base58.py b/Base58.py deleted file mode 100644 index e0f2191d832d976ba28eab09a8c0470c981fdfab..0000000000000000000000000000000000000000 --- a/Base58.py +++ /dev/null @@ -1,32 +0,0 @@ -""" base58 encoding / decoding functions """ - -alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -base_count = len(alphabet) - -def encode(num): - """ Returns num in a base58-encoded string """ - encode = '' - - if (num < 0): - return '' - - while (num >= base_count): - mod = num % base_count - encode = alphabet[mod] + encode - num = num // base_count - - if (num): - encode = alphabet[num] + encode - - return encode - -def decode(s): - """ Decodes the base58-encoded string s into an integer """ - decoded = 0 - multi = 1 - s = s[::-1] - for char in s: - decoded += multi * alphabet.index(char) - multi = multi * base_count - - return decoded \ No newline at end of file diff --git a/Client.py b/Client.py index 94ad10f6040d05fb821f3272d747a2501afa56c8..8f92374c8658dd166703d6378e7c26761aa8d7fb 100644 --- a/Client.py +++ b/Client.py @@ -1,131 +1,155 @@ -import peer_pb2 as peer -import tool +# -*-coding:utf-8-*- + +from . import peer_pb2 as peer import time from google.protobuf import timestamp_pb2 -from google.protobuf.text_format import MessageToString import uuid -from cryptography.x509 import load_pem_x509_certificate from cryptography.hazmat.backends import default_backend import cryptography.hazmat.primitives.serialization as serial from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec import requests import json -#import base64 import binascii -import hashlib +import os -class Client: - def __init__(self, host, jksPath, password, alias): +class Client: + # 主机名,pem文件路径,pem文件密码,别名,证书名,用户名 + def __init__(self, host="localhost:8081", pem_path=os.path.join(os.path.dirname(__file__), "certs", "121000005l35120456.node1.pem"), password=None, credit_code="121000005l35120456", cert_name="node1"): self.host = host - self.jksPath = jksPath + self.pem_path = pem_path self.password = password - self.alias = alias - - def createTransaction(self, tranType,chainCodeIdPath, chaincodeInputFunc,\ - param, spcPackage, chaincodeId, ctype): + self.credit_code = credit_code + self.cert_name = cert_name - if ctype != peer.ChaincodeSpec.CODE_JAVASCRIPT: - ctype = peer.ChaincodeSpec.CODE_SCALA - else: - ctype = peer.ChaincodeSpec.CODE_JAVASCRIPT + # 指定唯一合约:名称+版本号 + def __get_cid(self, chaincode_name, chaincode_ver): + cid = peer.ChaincodeId() + cid.chaincodeName = chaincode_name + cid.version = int(chaincode_ver) + return cid - name = chaincodeId; - if chaincodeId == '': - name = hashlib.sha256(spcPackage.encode('utf-8')).hexdigest() - else: - if chaincodeId.strip() == '': - pass - else: - name = chaincodeId - #print('name : ' + str(name)) - + # 指定用于签名的证书:证书名+用户名 + def __get_certid(self): + certid = peer.CertId() + certid.credit_code = self.credit_code + certid.cert_name = self.cert_name + return certid + + # 从pem文件中得到私钥 + def __get_pvkey(self): + input_file = open(self.pem_path, 'rb') + input = input_file.read() + input_file.close() + pvkey = serial.load_pem_private_key(input, self.password, default_backend()) + return pvkey + + # 得到对交易的签名signature + def __get_sig(self, transaction): # 生成时间戳 now = time.time() seconds = int(now) - nanos = int((now - seconds) * 10**9) - - # deploy时取脚本内容hash作为 chaincodeId/name - # invoke时调用者应该知道要调用的 chaincodeId - cid = peer.ChaincodeID() - cid.path = chainCodeIdPath - cid.name = name - # 构建运行代码 - cip = peer.ChaincodeInput() - cip.function = chaincodeInputFunc - cip.args.append(param) - # 初始化链码 - chaincodeSpec = peer.ChaincodeSpec() - chaincodeSpec.chaincodeID.CopyFrom(cid) - chaincodeSpec.ctorMsg.CopyFrom(cip) - chaincodeSpec.timeout = 1000 - chaincodeSpec.secureContext = 'secureContext' - chaincodeSpec.code_package = spcPackage.encode('utf-8') - chaincodeSpec.ctype = ctype - + nanos = int((now - seconds) * 10 ** 9) + # 证书标识,时间戳,对整个交易的签名 + sig = peer.Signature() + sig.cert_id.CopyFrom(self.__get_certid()) + sig.tm_local.CopyFrom(timestamp_pb2.Timestamp(seconds=seconds, nanos=nanos)) + sig_bytes = self.__get_pvkey().sign(transaction.SerializeToString(), ec.ECDSA(hashes.SHA1())) + sig.signature = sig_bytes + return sig + + ##从文件路径得到内容 + def __get_code(self, package_path): + f = open( package_path, 'rb') + return f.read() + + # 创建设置状态交易:交易标识string,合约名称string,合约版本int,更改状态bool + def create_trans_set_state(self, trans_id, chaincode_name, chaincode_ver, state): + # 创建交易:交易标识符(如未指定,则随机),交易类型,指定合约,指定状态 trans = peer.Transaction() - trans.type = tranType - trans.chaincodeID = MessageToString(cid).encode('utf-8') - trans.payload.CopyFrom(chaincodeSpec) - trans.metadata = ''.encode('utf-8') - trans.timestamp.CopyFrom(timestamp_pb2.Timestamp(seconds=seconds, nanos=nanos)) - trans.confidentialityLevel = peer.PUBLIC - trans.confidentialityProtocolVersion = 'confidentialityProtocolVersion-1.0' - trans.nonce = 'nonce'.encode('utf-8') - trans.toValidators = 'toValidators'.encode('utf-8') - trans.signature = ''.encode('utf-8') - - txid = '' - if tranType == peer.Transaction.CHAINCODE_DEPLOY: - txid = name; + if ("" == trans_id): + trans.id = str(uuid.uuid4()) else: - txid = str(uuid.uuid4()) - trans.txid = txid - # 构造证书(短地址) - input_file = open(self.jksPath, 'rb') - input = input_file.read() - input_file.close() - - cert = load_pem_x509_certificate(input, default_backend()) - pbkey = cert.public_key() - # jks转换为pem文件后需要6位密码,这里是123456 - pvkey = serial.load_pem_private_key(input, '123456'.encode('utf-8'), default_backend()) - - # generate_address的传入参数需要是一个65位的byte[],包括0x04+x+y - # pbkey_numbers.encode_point()返回的是0x04+x+y的65位byte - # pbkey_serial是88位的序列化的公钥 - # DER进行base64编码后为PEM - pbkey_numbers = pbkey.public_numbers() - #pbkey_numbers.encode_point() - pbkey_serial = pbkey.public_bytes(serial.Encoding.DER, serial.PublicFormat.SubjectPublicKeyInfo) - #pvkey_serial = pvkey.private_bytes(serial.Encoding.PEM, serial.PrivateFormat.PKCS8, serial.NoEncryption()) + trans.id = trans_id + trans.type = peer.Transaction.CHAINCODE_SET_STATE + trans.cid.CopyFrom(self.__get_cid(chaincode_name, chaincode_ver)) + trans.state = state + trans.signature.CopyFrom(self.__get_sig(trans)) + return trans - short_addr = tool.generate_address(pbkey_serial) - trans.cert = short_addr.encode('utf-8') + # 创建部署/升级合约交易:交易标识string,合约名称string,合约版本int,合约代码类型string, + # 超时时间int,合约路径string,法律描述string + def create_trans_deploy(self, trans_id, chaincode_name, chaincode_ver, chaincode_type, \ + timeout=1000, package_path=os.path.dirname(__file__) + '\\contracts\\ConEvidence.scala', legalprose=""): + trans = peer.Transaction() + if ("" == trans_id): + trans.id = str(uuid.uuid4()) + else: + trans.id = trans_id + ctype_dict = { + "javascript": peer.ChaincodeDeploy.CODE_JAVASCRIPT, + "scala": peer.ChaincodeDeploy.CODE_SCALA, + "scalaparallel": peer.ChaincodeDeploy.CODE_SCALA_PARALLEL + } + ctype = ctype_dict.get(chaincode_type) + if None == ctype: + ctype = peer.ChaincodeDeploy.CODE_UNDEFINED + trans.type = peer.Transaction.CHAINCODE_DEPLOY + trans.cid.CopyFrom(self.__get_cid(chaincode_name, chaincode_ver)) + spec = peer.ChaincodeDeploy() + spec.timeout = timeout + spec.code_package = self.__get_code(package_path) + spec.legal_prose = legalprose + spec.ctype = ctype + trans.spec.CopyFrom(spec) + trans.signature.CopyFrom(self.__get_sig(trans)) + return trans - # 构造签名 - sig = pvkey.sign(hashlib.sha256(trans.SerializeToString()).digest(), ec.ECDSA(hashes.SHA1())) - #pbkey.verify(sig, hashlib.sha256(trans.SerializeToString()).digest(), ec.ECDSA(hashes.SHA1())) - trans.signature = sig - + # 创建调用合约交易:交易标识string,合约名称string,合约版本int,合约方法string,方法参数string + def create_trans_invoke(self, trans_id, chaincode_name, chaincode_ver, func, params): + trans = peer.Transaction() + if ("" == trans_id): + trans.id = str(uuid.uuid4()) + else: + trans.id = trans_id + trans.type = peer.Transaction.CHAINCODE_INVOKE + trans.cid.CopyFrom(self.__get_cid(chaincode_name, chaincode_ver)) + ipt = peer.ChaincodeInput() + ipt.function = func + print(params) + ipt.args.append(params) + trans.ipt.CopyFrom(ipt) + trans.signature.CopyFrom(self.__get_sig(trans)) return trans + ## 进行http请求 def doPost(self, url, data): headers = {'Content-Type': 'application/json'} try: response = requests.post(url=url, headers=headers, data=json.dumps(data)) except requests.exceptions.Timeout as e: - print('TimeOut: '+str(e.message)) + print('TimeOut: ' + str(e.message)) except requests.exceptions.HTTPError as e: - print('HTTPError: '+str(e.message)) + print('HTTPError: ' + str(e.message)) return response - + + # 提交带签名的交易 def postTranByString(self, data): - # data = createTransaction.trans - #url ="http://"+self.host + "/transaction/postTranByString"; - url = self.host + "/transaction/postTranByString"; + url = "http://" + self.host + "/transaction/postTranByString" # data类型为byte(bin),先转换成byte(hex),再转换成string(hex) data = binascii.hexlify(data.SerializeToString()) - jsonObject = self.doPost(url,data.decode('utf-8')); - return jsonObject; \ No newline at end of file + jsonObject = self.doPost(url, data.decode('utf-8')) + return jsonObject; + + # 从交易id得到交易内容 + def getTransById(self, tx_id): + url = "http://" + self.host + "/transaction/" + tx_id + headers = {'Content-Type': 'application/json'} + try: + response = requests.get(url=url, headers=headers) + except requests.exceptions.Timeout as e: + print('TimeOut: '+str(e.message)) + except requests.exceptions.HTTPError as e: + print('HTTPError: '+str(e.message)) + return response diff --git a/README.md b/README.md index bfdf03bb61149ff70f512402042c6115be6a0100..ba99060e85777a7fea6efb70061e1ea1535dbd26 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ python连接RepChain的示范性项目,提交交易并获取返回结果,同 #### 使用说明 -1. Client.py用来构建签名交易并提交 -2. test_putproof.py用来测试存证过程 -3. test_retrival.py用来测试检索过程 +1. client.py用来构建签名交易并提交 +2. test.py用来测试部署和调用合约的过程 +3. 请注意,在使用Repchain2.0版本时,可能需要修改交易的签名方法,例如尝试将hashes.SHA1改为hashes.SHA2。(具体请关注RepChain2.0设计) #### 参与贡献 1. Fork 本项目 2. 新建 Feat_xxx 分支 3. 提交代码 -4. 新建 Pull Request +4. 新建 Pull Request \ No newline at end of file diff --git a/certs/121000005l35120456.node1.cer b/certs/121000005l35120456.node1.cer new file mode 100644 index 0000000000000000000000000000000000000000..6494e8355f55ce01d25672e6cb53e2a8f4483d4e --- /dev/null +++ b/certs/121000005l35120456.node1.cer @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBTDCB9KADAgECAgRd7wBCMAoGCCqGSM49BAMCMC8xETAPBgNVBAoMCHJlcGNo +YWluMQ4wDAYDVQQLDAVpc2NhczEKMAgGA1UEAwwBMTAeFw0xOTEyMTAwMjE3Mzha +Fw0yMDEyMDkwMjE3MzhaMC8xETAPBgNVBAoMCHJlcGNoYWluMQ4wDAYDVQQLDAVp +c2NhczEKMAgGA1UEAwwBMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJu7PT4Z +s5hqqNha9SrP60TecIDVYGry0v6ayV5lP8w5FJ2UtRECrpUxuoO2pfaHfxyYIXCZ +A8w7YaZU0s4CEfcwCgYIKoZIzj0EAwIDRwAwRAIgcAxkxmiNexPx8CF+DvII7168 +eeVcfsJwoMcFFLKCWrECICSIkc9vC6Vwze3s2UwBuIiSlwNxZ0YDJcdlbcmESWHy +-----END CERTIFICATE----- diff --git a/certs/121000005l35120456.node1.jks b/certs/121000005l35120456.node1.jks new file mode 100644 index 0000000000000000000000000000000000000000..acb35dc240c359a5d532fd927c1564946b905fda Binary files /dev/null and b/certs/121000005l35120456.node1.jks differ diff --git a/certs/121000005l35120456.node1.pem b/certs/121000005l35120456.node1.pem new file mode 100644 index 0000000000000000000000000000000000000000..c2a55c230c3bcff28830720e49907feaa7570ace --- /dev/null +++ b/certs/121000005l35120456.node1.pem @@ -0,0 +1,15 @@ +-----BEGIN PRIVATE KEY----- +MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgMwOg+N/MxN5qRBo2 +X/wLmUHqEoDZEF3/aSpTVUvvkuugCgYIKoZIzj0DAQehRANCAASbuz0+GbOYaqjY +WvUqz+tE3nCA1WBq8tL+msleZT/MORSdlLURAq6VMbqDtqX2h38cmCFwmQPMO2Gm +VNLOAhH3 +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIBTDCB9KADAgECAgRd7wBCMAoGCCqGSM49BAMCMC8xETAPBgNVBAoMCHJlcGNo +YWluMQ4wDAYDVQQLDAVpc2NhczEKMAgGA1UEAwwBMTAeFw0xOTEyMTAwMjE3Mzha +Fw0yMDEyMDkwMjE3MzhaMC8xETAPBgNVBAoMCHJlcGNoYWluMQ4wDAYDVQQLDAVp +c2NhczEKMAgGA1UEAwwBMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJu7PT4Z +s5hqqNha9SrP60TecIDVYGry0v6ayV5lP8w5FJ2UtRECrpUxuoO2pfaHfxyYIXCZ +A8w7YaZU0s4CEfcwCgYIKoZIzj0EAwIDRwAwRAIgcAxkxmiNexPx8CF+DvII7168 +eeVcfsJwoMcFFLKCWrECICSIkc9vC6Vwze3s2UwBuIiSlwNxZ0YDJcdlbcmESWHy +-----END CERTIFICATE----- diff --git a/contracts/CREvidence.scala b/contracts/CREvidence.scala new file mode 100644 index 0000000000000000000000000000000000000000..bd20aef042aada55536af2770820ec4ad0eedb92 --- /dev/null +++ b/contracts/CREvidence.scala @@ -0,0 +1,80 @@ + +/* + * Copyright 2019 Blockchain Technology and Application Joint Lab, Fintech Research Center of ISCAS. + * 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" BA SIS, + * 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 org.json4s.JsonDSL._ +import org.json4s._ +import org.json4s.jackson.JsonMethods._ + +import rep.protos.peer.ChaincodeId +import rep.utils.IdTool +import rep.sc.scalax.IContract + +import rep.sc.scalax.ContractContext +import rep.sc.scalax.ContractException +import rep.protos.peer.ActionResult +/** + * 文物信息存证合约v1.0 + */ + +class ContractEvidence extends IContract{ +case class Evidence(from:String, to:String) + + implicit val formats = DefaultFormats + + val id =" " //标识符 + val location_information=" " //位置信息(ip定位,精确到市) + val time_service_center=" " //时间(NTP时间),后端ntp协议时间实现 + val personnel_information=" " //人员信息(post传值,用户名) + val equipment_information=" " //设备信息(post传值,mac地址) + + + def init(ctx: ContractContext){ + println(s"tid: $ctx.t.txid") + } + + def put_proof(ctx: ContractContext, data:Map[String,String]):ActionResult={ + val v = compact(render(data)) + print("v"); + val k = data.get("id").get + var pv0 = ctx.api.getVal(k) + if(pv0 != null) + throw new Exception("["+k+"]已存在,当前值["+pv0+"]"); + ctx.api.setVal(k,v); + print("putProof:"+k+":"+v); + null + } + + def retrieval(ctx: ContractContext, k:String):ActionResult= { + val v = ctx.api.getVal(k).toString() + val ar = new ActionResult(0,v) + ar + } + + def onAction(ctx: ContractContext,action:String, sdata:String ):ActionResult={ + val json = parse(sdata) + + action match { + case "put_proof" => + println(s"put_proof") + put_proof(ctx, json.extract[Map[String,String]]) + case "retrieval"=> + println(s"retrieval") + retrieval(ctx, json.extract[String]) + + } + } +} diff --git a/peer_pb2.py b/peer_pb2.py index 66ce54e8c97dcc8dde9cd5907515ab77266e0eee..f2099be1af83b057f8017ba1a655f7ac21e50eb8 100644 --- a/peer_pb2.py +++ b/peer_pb2.py @@ -1,9 +1,7 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: peer.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 +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -18,187 +16,204 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__ DESCRIPTOR = _descriptor.FileDescriptor( name='peer.proto', - package='', + package='rep.protos', syntax='proto3', - serialized_options=_b('\n\nrep.protos'), - serialized_pb=_b('\n\npeer.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x14\n\x04\x42ook\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xb9\x02\n\x05\x45vent\x12\x0c\n\x04\x66rom\x18\x01 \x01(\t\x12\n\n\x02to\x18\x02 \x01(\t\x12\x1d\n\x06\x61\x63tion\x18\x03 \x01(\x0e\x32\r.Event.Action\x12\x13\n\x03\x62lk\x18\x04 \x01(\x0b\x32\x06.Block\"\xe1\x01\n\x06\x41\x63tion\x12\x13\n\x0fSUBSCRIBE_TOPIC\x10\x00\x12\x0f\n\x0bTRANSACTION\x10\x01\x12\r\n\tBLOCK_NEW\x10\x02\x12\x15\n\x11\x42LOCK_ENDORSEMENT\x10\x03\x12\x0f\n\x0b\x45NDORSEMENT\x10\x04\x12\r\n\tMEMBER_UP\x10\x05\x12\x0f\n\x0bMEMBER_DOWN\x10\x06\x12\x0e\n\nCANDIDATOR\x10\x07\x12\x11\n\rGENESIS_BLOCK\x10\x08\x12\x0e\n\nBLOCK_SYNC\x10\t\x12\x13\n\x0f\x42LOCK_SYNC_DATA\x10\n\x12\x12\n\x0e\x42LOCK_SYNC_SUC\x10\x0b\"2\n\x0b\x45ndorsement\x12\x10\n\x08\x65ndorser\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\")\n\x0b\x43haincodeID\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"0\n\x0e\x43haincodeInput\x12\x10\n\x08\x66unction\x18\x01 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x02 \x03(\t\"\xff\x01\n\rChaincodeSpec\x12!\n\x0b\x63haincodeID\x18\x01 \x01(\x0b\x32\x0c.ChaincodeID\x12 \n\x07\x63torMsg\x18\x02 \x01(\x0b\x32\x0f.ChaincodeInput\x12\x0f\n\x07timeout\x18\x03 \x01(\x05\x12\x15\n\rsecureContext\x18\x04 \x01(\t\x12\x14\n\x0c\x63ode_package\x18\x05 \x01(\x0c\x12&\n\x05\x63type\x18\x06 \x01(\x0e\x32\x17.ChaincodeSpec.CodeType\"C\n\x08\x43odeType\x12\x12\n\x0e\x43ODE_UNDEFINED\x10\x00\x12\x13\n\x0f\x43ODE_JAVASCRIPT\x10\x01\x12\x0e\n\nCODE_SCALA\x10\x02\"\xc7\x03\n\x0bTransaction\x12\x1f\n\x04type\x18\x01 \x01(\x0e\x32\x11.Transaction.Type\x12\x13\n\x0b\x63haincodeID\x18\x02 \x01(\x0c\x12\x1f\n\x07payload\x18\x03 \x01(\x0b\x32\x0e.ChaincodeSpec\x12\x10\n\x08metadata\x18\x04 \x01(\x0c\x12\x0c\n\x04txid\x18\x05 \x01(\t\x12-\n\ttimestamp\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x14\x63onfidentialityLevel\x18\x07 \x01(\x0e\x32\x15.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\"\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\x0c.Transaction\x12\x11\n\tstateHash\x18\x04 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x05 \x01(\x0c\x12\'\n\x11\x63onsensusMetadata\x18\x06 \x03(\x0b\x32\x0c.Endorsement\x12!\n\x0bnonHashData\x18\x07 \x01(\x0b\x32\x0c.NonHashData\"}\n\x0bNonHashData\x12>\n\x1alocalLedgerCommitTimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\x12transactionResults\x18\x02 \x03(\x0b\x32\x12.TransactionResult\":\n\x07OperLog\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x10\n\x08oldValue\x18\x02 \x01(\x0c\x12\x10\n\x08newValue\x18\x03 \x01(\x0c\"Y\n\x11TransactionResult\x12\x0c\n\x04txid\x18\x01 \x01(\t\x12\x14\n\x02ol\x18\x02 \x03(\x0b\x32\x08.OperLog\x12\x11\n\terrorCode\x18\x03 \x01(\r\x12\r\n\x05\x65rror\x18\x04 \x01(\t\"#\n\nBlockChain\x12\x15\n\x05\x62lock\x18\x01 \x03(\x0b\x32\x06.Block\"\x8f\x01\n\x0e\x42lockchainInfo\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x19\n\x11totalTransactions\x18\x02 \x01(\x04\x12\x18\n\x10\x63urrentBlockHash\x18\x03 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x04 \x01(\x0c\x12\x1d\n\x15\x63urrentWorldStateHash\x18\x05 \x01(\x0c*I\n\x14\x43onfidentialityLevel\x12\x13\n\x0fLEVEL_UNDEFINED\x10\x00\x12\n\n\x06PUBLIC\x10\x01\x12\x10\n\x0c\x43ONFIDENTIAL\x10\x02\x42\x0c\n\nrep.protosb\x06proto3') + serialized_options=b'\n\nrep.protos', + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\npeer.proto\x12\nrep.protos\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcf\x02\n\x05\x45vent\x12\x0c\n\x04\x66rom\x18\x01 \x01(\t\x12\n\n\x02to\x18\x02 \x01(\t\x12(\n\x06\x61\x63tion\x18\x03 \x01(\x0e\x32\x18.rep.protos.Event.Action\x12\x1e\n\x03\x62lk\x18\x04 \x01(\x0b\x32\x11.rep.protos.Block\"\xe1\x01\n\x06\x41\x63tion\x12\x13\n\x0fSUBSCRIBE_TOPIC\x10\x00\x12\x0f\n\x0bTRANSACTION\x10\x01\x12\r\n\tBLOCK_NEW\x10\x02\x12\x15\n\x11\x42LOCK_ENDORSEMENT\x10\x03\x12\x0f\n\x0b\x45NDORSEMENT\x10\x04\x12\r\n\tMEMBER_UP\x10\x05\x12\x0f\n\x0bMEMBER_DOWN\x10\x06\x12\x0e\n\nCANDIDATOR\x10\x07\x12\x11\n\rGENESIS_BLOCK\x10\x08\x12\x0e\n\nBLOCK_SYNC\x10\t\x12\x13\n\x0f\x42LOCK_SYNC_DATA\x10\n\x12\x12\n\x0e\x42LOCK_SYNC_SUC\x10\x0b\"O\n\x06Signer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x63redit_code\x18\x02 \x01(\t\x12\x0e\n\x06mobile\x18\x03 \x01(\t\x12\x12\n\ncert_names\x18\x04 \x03(\t\"0\n\x06\x43\x65rtId\x12\x13\n\x0b\x63redit_code\x18\x01 \x01(\t\x12\x11\n\tcert_name\x18\x02 \x01(\t\"\xa6\x01\n\x0b\x43\x65rtificate\x12\x13\n\x0b\x63\x65rtificate\x18\x01 \x01(\t\x12\x10\n\x08\x61lg_type\x18\x02 \x01(\t\x12\x12\n\ncert_valid\x18\x03 \x01(\x08\x12,\n\x08reg_Time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nunreg_Time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"q\n\tSignature\x12#\n\x07\x63\x65rt_id\x18\x01 \x01(\x0b\x32\x12.rep.protos.CertId\x12,\n\x08tm_local\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tsignature\x18\x03 \x01(\x0c\"0\n\x0e\x43haincodeInput\x12\x10\n\x08\x66unction\x18\x01 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x02 \x03(\t\"5\n\x0b\x43haincodeId\x12\x15\n\rchaincodeName\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\"\xe0\x01\n\x0f\x43haincodeDeploy\x12\x0f\n\x07timeout\x18\x01 \x01(\x05\x12\x14\n\x0c\x63ode_package\x18\x02 \x01(\t\x12\x13\n\x0blegal_prose\x18\x03 \x01(\t\x12\x33\n\x05\x63type\x18\x04 \x01(\x0e\x32$.rep.protos.ChaincodeDeploy.CodeType\"\\\n\x08\x43odeType\x12\x12\n\x0e\x43ODE_UNDEFINED\x10\x00\x12\x13\n\x0f\x43ODE_JAVASCRIPT\x10\x01\x12\x0e\n\nCODE_SCALA\x10\x02\x12\x17\n\x13\x43ODE_SCALA_PARALLEL\x10\x03\"\xe2\x02\n\x0bTransaction\x12\n\n\x02id\x18\x01 \x01(\t\x12*\n\x04type\x18\x02 \x01(\x0e\x32\x1c.rep.protos.Transaction.Type\x12$\n\x03\x63id\x18\x03 \x01(\x0b\x32\x17.rep.protos.ChaincodeId\x12+\n\x04spec\x18\x04 \x01(\x0b\x32\x1b.rep.protos.ChaincodeDeployH\x00\x12)\n\x03ipt\x18\x05 \x01(\x0b\x32\x1a.rep.protos.ChaincodeInputH\x00\x12\x0f\n\x05state\x18\x06 \x01(\x08H\x00\x12(\n\tsignature\x18\x07 \x01(\x0b\x32\x15.rep.protos.Signature\"Z\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\x17\n\x13\x43HAINCODE_SET_STATE\x10\x03\x42\x06\n\x04para\"\x82\x02\n\x05\x42lock\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\x04\x12-\n\x0ctransactions\x18\x03 \x03(\x0b\x32\x17.rep.protos.Transaction\x12\x39\n\x12transactionResults\x18\x04 \x03(\x0b\x32\x1d.rep.protos.TransactionResult\x12\x13\n\x0bhashOfBlock\x18\x05 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x06 \x01(\x0c\x12+\n\x0c\x65ndorsements\x18\x07 \x03(\x0b\x32\x15.rep.protos.Signature\x12\x11\n\tstateHash\x18\x08 \x01(\x0c\":\n\x07OperLog\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x10\n\x08oldValue\x18\x02 \x01(\x0c\x12\x10\n\x08newValue\x18\x03 \x01(\x0c\",\n\x0c\x41\x63tionResult\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0e\n\x06reason\x18\x02 \x01(\t\"l\n\x11TransactionResult\x12\x0c\n\x04txId\x18\x01 \x01(\t\x12\x1f\n\x02ol\x18\x02 \x03(\x0b\x32\x13.rep.protos.OperLog\x12(\n\x06result\x18\x03 \x01(\x0b\x32\x18.rep.protos.ActionResult\"\x8a\x01\n\x0e\x42lockchainInfo\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x19\n\x11totalTransactions\x18\x02 \x01(\x04\x12\x18\n\x10\x63urrentBlockHash\x18\x03 \x01(\x0c\x12\x19\n\x11previousBlockHash\x18\x04 \x01(\x0c\x12\x18\n\x10\x63urrentStateHash\x18\x05 \x01(\x0c\"8\n\x0cMPbftPrepare\x12(\n\tsignature\x18\x01 \x01(\x0b\x32\x15.rep.protos.Signature\"c\n\x0bMPbftCommit\x12*\n\x08prepares\x18\x01 \x03(\x0b\x32\x18.rep.protos.MPbftPrepare\x12(\n\tsignature\x18\x02 \x01(\x0b\x32\x15.rep.protos.Signature\"`\n\nMPbftReply\x12(\n\x07\x63ommits\x18\x01 \x03(\x0b\x32\x17.rep.protos.MPbftCommit\x12(\n\tsignature\x18\x02 \x01(\x0b\x32\x15.rep.protos.SignatureB\x0c\n\nrep.protosb\x06proto3' , dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) -_CONFIDENTIALITYLEVEL = _descriptor.EnumDescriptor( - name='ConfidentialityLevel', - full_name='ConfidentialityLevel', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='LEVEL_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='PUBLIC', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CONFIDENTIAL', index=2, number=2, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=1939, - serialized_end=2012, -) -_sym_db.RegisterEnumDescriptor(_CONFIDENTIALITYLEVEL) - -ConfidentialityLevel = enum_type_wrapper.EnumTypeWrapper(_CONFIDENTIALITYLEVEL) -LEVEL_UNDEFINED = 0 -PUBLIC = 1 -CONFIDENTIAL = 2 _EVENT_ACTION = _descriptor.EnumDescriptor( name='Action', - full_name='Event.Action', + full_name='rep.protos.Event.Action', filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='SUBSCRIBE_TOPIC', index=0, number=0, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TRANSACTION', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLOCK_NEW', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLOCK_ENDORSEMENT', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENDORSEMENT', index=4, number=4, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MEMBER_UP', index=5, number=5, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MEMBER_DOWN', index=6, number=6, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CANDIDATOR', index=7, number=7, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='GENESIS_BLOCK', index=8, number=8, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLOCK_SYNC', index=9, number=9, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLOCK_SYNC_DATA', index=10, number=10, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='BLOCK_SYNC_SUC', index=11, number=11, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=158, - serialized_end=383, + serialized_start=170, + serialized_end=395, ) _sym_db.RegisterEnumDescriptor(_EVENT_ACTION) -_CHAINCODESPEC_CODETYPE = _descriptor.EnumDescriptor( +_CHAINCODEDEPLOY_CODETYPE = _descriptor.EnumDescriptor( name='CodeType', - full_name='ChaincodeSpec.CodeType', + full_name='rep.protos.ChaincodeDeploy.CodeType', filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='CODE_UNDEFINED', index=0, number=0, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CODE_JAVASCRIPT', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CODE_SCALA', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_SCALA_PARALLEL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=719, - serialized_end=786, + serialized_start=1050, + serialized_end=1142, ) -_sym_db.RegisterEnumDescriptor(_CHAINCODESPEC_CODETYPE) +_sym_db.RegisterEnumDescriptor(_CHAINCODEDEPLOY_CODETYPE) _TRANSACTION_TYPE = _descriptor.EnumDescriptor( name='Type', - full_name='Transaction.Type', + full_name='rep.protos.Transaction.Type', filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNDEFINED', index=0, number=0, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHAINCODE_DEPLOY', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='CHAINCODE_INVOKE', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='CHAINCODE_QUERY', index=3, number=3, + name='CHAINCODE_SET_STATE', index=3, number=3, serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='CHAINCODE_TERMINATE', index=4, number=4, - serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=1133, - serialized_end=1244, + serialized_start=1401, + serialized_end=1491, ) _sym_db.RegisterEnumDescriptor(_TRANSACTION_TYPE) -_BOOK = _descriptor.Descriptor( - name='Book', - full_name='Book', +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='rep.protos.Event', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='name', full_name='Book.name', index=0, + name='from', full_name='rep.protos.Event.from', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='to', full_name='rep.protos.Event.to', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='action', full_name='rep.protos.Event.action', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='blk', full_name='rep.protos.Event.blk', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ + _EVENT_ACTION, ], serialized_options=None, is_extendable=False, @@ -206,52 +221,52 @@ _BOOK = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=47, - serialized_end=67, + serialized_start=60, + serialized_end=395, ) -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='Event', +_SIGNER = _descriptor.Descriptor( + name='Signer', + full_name='rep.protos.Signer', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='from', full_name='Event.from', index=0, + name='name', full_name='rep.protos.Signer.name', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='to', full_name='Event.to', index=1, + name='credit_code', full_name='rep.protos.Signer.credit_code', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='action', full_name='Event.action', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, + name='mobile', full_name='rep.protos.Signer.mobile', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='blk', full_name='Event.blk', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='cert_names', full_name='rep.protos.Signer.cert_names', index=3, + number=4, 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ - _EVENT_ACTION, ], serialized_options=None, is_extendable=False, @@ -259,32 +274,33 @@ _EVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=70, - serialized_end=383, + serialized_start=397, + serialized_end=476, ) -_ENDORSEMENT = _descriptor.Descriptor( - name='Endorsement', - full_name='Endorsement', +_CERTID = _descriptor.Descriptor( + name='CertId', + full_name='rep.protos.CertId', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='endorser', full_name='Endorsement.endorser', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='credit_code', full_name='rep.protos.CertId.credit_code', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='signature', full_name='Endorsement.signature', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='cert_name', full_name='rep.protos.CertId.cert_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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -297,32 +313,54 @@ _ENDORSEMENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=385, - serialized_end=435, + serialized_start=478, + serialized_end=526, ) -_CHAINCODEID = _descriptor.Descriptor( - name='ChaincodeID', - full_name='ChaincodeID', +_CERTIFICATE = _descriptor.Descriptor( + name='Certificate', + full_name='rep.protos.Certificate', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='path', full_name='ChaincodeID.path', index=0, + name='certificate', full_name='rep.protos.Certificate.certificate', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='name', full_name='ChaincodeID.name', index=1, + name='alg_type', full_name='rep.protos.Certificate.alg_type', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='cert_valid', full_name='rep.protos.Certificate.cert_valid', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='reg_Time', full_name='rep.protos.Certificate.reg_Time', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='unreg_Time', full_name='rep.protos.Certificate.unreg_Time', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -335,32 +373,79 @@ _CHAINCODEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=437, - serialized_end=478, + serialized_start=529, + serialized_end=695, +) + + +_SIGNATURE = _descriptor.Descriptor( + name='Signature', + full_name='rep.protos.Signature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='cert_id', full_name='rep.protos.Signature.cert_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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='tm_local', full_name='rep.protos.Signature.tm_local', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='signature', full_name='rep.protos.Signature.signature', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=697, + serialized_end=810, ) _CHAINCODEINPUT = _descriptor.Descriptor( name='ChaincodeInput', - full_name='ChaincodeInput', + full_name='rep.protos.ChaincodeInput', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='function', full_name='ChaincodeInput.function', index=0, + name='function', full_name='rep.protos.ChaincodeInput.function', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='args', full_name='ChaincodeInput.args', index=1, + name='args', full_name='rep.protos.ChaincodeInput.args', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -373,66 +458,92 @@ _CHAINCODEINPUT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=480, - serialized_end=528, + serialized_start=812, + serialized_end=860, ) -_CHAINCODESPEC = _descriptor.Descriptor( - name='ChaincodeSpec', - full_name='ChaincodeSpec', +_CHAINCODEID = _descriptor.Descriptor( + name='ChaincodeId', + full_name='rep.protos.ChaincodeId', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='chaincodeID', full_name='ChaincodeSpec.chaincodeID', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='chaincodeName', full_name='rep.protos.ChaincodeId.chaincodeName', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ctorMsg', full_name='ChaincodeSpec.ctorMsg', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='version', full_name='rep.protos.ChaincodeId.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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=862, + serialized_end=915, +) + + +_CHAINCODEDEPLOY = _descriptor.Descriptor( + name='ChaincodeDeploy', + full_name='rep.protos.ChaincodeDeploy', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='timeout', full_name='ChaincodeSpec.timeout', index=2, - number=3, type=5, cpp_type=1, label=1, + name='timeout', full_name='rep.protos.ChaincodeDeploy.timeout', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='secureContext', full_name='ChaincodeSpec.secureContext', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + name='code_package', full_name='rep.protos.ChaincodeDeploy.code_package', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='code_package', full_name='ChaincodeSpec.code_package', index=4, - number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='legal_prose', full_name='rep.protos.ChaincodeDeploy.legal_prose', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ctype', full_name='ChaincodeSpec.ctype', index=5, - number=6, type=14, cpp_type=8, label=1, + name='ctype', full_name='rep.protos.ChaincodeDeploy.ctype', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ - _CHAINCODESPEC_CODETYPE, + _CHAINCODEDEPLOY_CODETYPE, ], serialized_options=None, is_extendable=False, @@ -440,102 +551,68 @@ _CHAINCODESPEC = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=531, - serialized_end=786, + serialized_start=918, + serialized_end=1142, ) _TRANSACTION = _descriptor.Descriptor( name='Transaction', - full_name='Transaction', + full_name='rep.protos.Transaction', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='type', full_name='Transaction.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, + name='id', full_name='rep.protos.Transaction.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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='chaincodeID', full_name='Transaction.chaincodeID', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='type', full_name='rep.protos.Transaction.type', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='payload', full_name='Transaction.payload', index=2, + name='cid', full_name='rep.protos.Transaction.cid', 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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='metadata', full_name='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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='txid', full_name='Transaction.txid', 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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='timestamp', full_name='Transaction.timestamp', index=5, - number=6, type=11, cpp_type=10, label=1, + name='spec', full_name='rep.protos.Transaction.spec', 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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='confidentialityLevel', full_name='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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='confidentialityProtocolVersion', full_name='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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='nonce', full_name='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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='toValidators', full_name='Transaction.toValidators', index=9, - number=10, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='ipt', full_name='rep.protos.Transaction.ipt', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='cert', full_name='Transaction.cert', index=10, - number=11, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='state', full_name='rep.protos.Transaction.state', index=5, + number=6, 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='signature', full_name='Transaction.signature', index=11, - number=12, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='signature', full_name='rep.protos.Transaction.signature', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -548,68 +625,81 @@ _TRANSACTION = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='para', full_name='rep.protos.Transaction.para', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=789, - serialized_end=1244, + serialized_start=1145, + serialized_end=1499, ) _BLOCK = _descriptor.Descriptor( name='Block', - full_name='Block', + full_name='rep.protos.Block', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='version', full_name='Block.version', index=0, + name='version', full_name='rep.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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='timestamp', full_name='Block.timestamp', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='height', full_name='rep.protos.Block.height', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='transactions', full_name='Block.transactions', index=2, + name='transactions', full_name='rep.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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='stateHash', full_name='Block.stateHash', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='transactionResults', full_name='rep.protos.Block.transactionResults', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='previousBlockHash', full_name='Block.previousBlockHash', index=4, + name='hashOfBlock', full_name='rep.protos.Block.hashOfBlock', index=4, number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='previousBlockHash', full_name='rep.protos.Block.previousBlockHash', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='consensusMetadata', full_name='Block.consensusMetadata', index=5, - number=6, type=11, cpp_type=10, label=3, + name='endorsements', full_name='rep.protos.Block.endorsements', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='nonHashData', full_name='Block.nonHashData', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='stateHash', full_name='rep.protos.Block.stateHash', index=7, + number=8, 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -622,32 +712,40 @@ _BLOCK = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1247, - serialized_end=1476, + serialized_start=1502, + serialized_end=1760, ) -_NONHASHDATA = _descriptor.Descriptor( - name='NonHashData', - full_name='NonHashData', +_OPERLOG = _descriptor.Descriptor( + name='OperLog', + full_name='rep.protos.OperLog', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='localLedgerCommitTimestamp', full_name='NonHashData.localLedgerCommitTimestamp', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='key', full_name='rep.protos.OperLog.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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='transactionResults', full_name='NonHashData.transactionResults', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], + name='oldValue', full_name='rep.protos.OperLog.oldValue', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='newValue', full_name='rep.protos.OperLog.newValue', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -660,39 +758,33 @@ _NONHASHDATA = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1478, - serialized_end=1603, + serialized_start=1762, + serialized_end=1820, ) -_OPERLOG = _descriptor.Descriptor( - name='OperLog', - full_name='OperLog', +_ACTIONRESULT = _descriptor.Descriptor( + name='ActionResult', + full_name='rep.protos.ActionResult', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='key', full_name='OperLog.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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='oldValue', full_name='OperLog.oldValue', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='code', full_name='rep.protos.ActionResult.code', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='newValue', full_name='OperLog.newValue', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='reason', full_name='rep.protos.ActionResult.reason', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -705,46 +797,100 @@ _OPERLOG = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1605, - serialized_end=1663, + serialized_start=1822, + serialized_end=1866, ) _TRANSACTIONRESULT = _descriptor.Descriptor( name='TransactionResult', - full_name='TransactionResult', + full_name='rep.protos.TransactionResult', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='txid', full_name='TransactionResult.txid', index=0, + name='txId', full_name='rep.protos.TransactionResult.txId', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ol', full_name='TransactionResult.ol', index=1, + name='ol', full_name='rep.protos.TransactionResult.ol', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='result', full_name='rep.protos.TransactionResult.result', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1868, + serialized_end=1976, +) + + +_BLOCKCHAININFO = _descriptor.Descriptor( + name='BlockchainInfo', + full_name='rep.protos.BlockchainInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='height', full_name='rep.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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='errorCode', full_name='TransactionResult.errorCode', index=2, - number=3, type=13, cpp_type=3, label=1, + name='totalTransactions', full_name='rep.protos.BlockchainInfo.totalTransactions', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='error', full_name='TransactionResult.error', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + name='currentBlockHash', full_name='rep.protos.BlockchainInfo.currentBlockHash', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='previousBlockHash', full_name='rep.protos.BlockchainInfo.previousBlockHash', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='currentStateHash', full_name='rep.protos.BlockchainInfo.currentStateHash', 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, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -757,25 +903,26 @@ _TRANSACTIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1665, - serialized_end=1754, + serialized_start=1979, + serialized_end=2117, ) -_BLOCKCHAIN = _descriptor.Descriptor( - name='BlockChain', - full_name='BlockChain', +_MPBFTPREPARE = _descriptor.Descriptor( + name='MPbftPrepare', + full_name='rep.protos.MPbftPrepare', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='block', full_name='BlockChain.block', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], + name='signature', full_name='rep.protos.MPbftPrepare.signature', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -788,53 +935,72 @@ _BLOCKCHAIN = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1756, - serialized_end=1791, + serialized_start=2119, + serialized_end=2175, ) -_BLOCKCHAININFO = _descriptor.Descriptor( - name='BlockchainInfo', - full_name='BlockchainInfo', +_MPBFTCOMMIT = _descriptor.Descriptor( + name='MPbftCommit', + full_name='rep.protos.MPbftCommit', filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='height', full_name='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, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='totalTransactions', full_name='BlockchainInfo.totalTransactions', index=1, - number=2, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, + name='prepares', full_name='rep.protos.MPbftCommit.prepares', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='currentBlockHash', full_name='BlockchainInfo.currentBlockHash', index=2, - number=3, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='signature', full_name='rep.protos.MPbftCommit.signature', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2177, + serialized_end=2276, +) + + +_MPBFTREPLY = _descriptor.Descriptor( + name='MPbftReply', + full_name='rep.protos.MPbftReply', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='previousBlockHash', full_name='BlockchainInfo.previousBlockHash', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='commits', full_name='rep.protos.MPbftReply.commits', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='currentWorldStateHash', full_name='BlockchainInfo.currentWorldStateHash', index=4, - number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=_b(""), + name='signature', full_name='rep.protos.MPbftReply.signature', 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, - serialized_options=None, file=DESCRIPTOR), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -847,137 +1013,182 @@ _BLOCKCHAININFO = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=1794, - serialized_end=1937, + serialized_start=2278, + serialized_end=2374, ) _EVENT.fields_by_name['action'].enum_type = _EVENT_ACTION _EVENT.fields_by_name['blk'].message_type = _BLOCK _EVENT_ACTION.containing_type = _EVENT -_CHAINCODESPEC.fields_by_name['chaincodeID'].message_type = _CHAINCODEID -_CHAINCODESPEC.fields_by_name['ctorMsg'].message_type = _CHAINCODEINPUT -_CHAINCODESPEC.fields_by_name['ctype'].enum_type = _CHAINCODESPEC_CODETYPE -_CHAINCODESPEC_CODETYPE.containing_type = _CHAINCODESPEC +_CERTIFICATE.fields_by_name['reg_Time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_CERTIFICATE.fields_by_name['unreg_Time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_SIGNATURE.fields_by_name['cert_id'].message_type = _CERTID +_SIGNATURE.fields_by_name['tm_local'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_CHAINCODEDEPLOY.fields_by_name['ctype'].enum_type = _CHAINCODEDEPLOY_CODETYPE +_CHAINCODEDEPLOY_CODETYPE.containing_type = _CHAINCODEDEPLOY _TRANSACTION.fields_by_name['type'].enum_type = _TRANSACTION_TYPE -_TRANSACTION.fields_by_name['payload'].message_type = _CHAINCODESPEC -_TRANSACTION.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TRANSACTION.fields_by_name['confidentialityLevel'].enum_type = _CONFIDENTIALITYLEVEL +_TRANSACTION.fields_by_name['cid'].message_type = _CHAINCODEID +_TRANSACTION.fields_by_name['spec'].message_type = _CHAINCODEDEPLOY +_TRANSACTION.fields_by_name['ipt'].message_type = _CHAINCODEINPUT +_TRANSACTION.fields_by_name['signature'].message_type = _SIGNATURE _TRANSACTION_TYPE.containing_type = _TRANSACTION -_BLOCK.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_TRANSACTION.oneofs_by_name['para'].fields.append( + _TRANSACTION.fields_by_name['spec']) +_TRANSACTION.fields_by_name['spec'].containing_oneof = _TRANSACTION.oneofs_by_name['para'] +_TRANSACTION.oneofs_by_name['para'].fields.append( + _TRANSACTION.fields_by_name['ipt']) +_TRANSACTION.fields_by_name['ipt'].containing_oneof = _TRANSACTION.oneofs_by_name['para'] +_TRANSACTION.oneofs_by_name['para'].fields.append( + _TRANSACTION.fields_by_name['state']) +_TRANSACTION.fields_by_name['state'].containing_oneof = _TRANSACTION.oneofs_by_name['para'] _BLOCK.fields_by_name['transactions'].message_type = _TRANSACTION -_BLOCK.fields_by_name['consensusMetadata'].message_type = _ENDORSEMENT -_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 +_BLOCK.fields_by_name['transactionResults'].message_type = _TRANSACTIONRESULT +_BLOCK.fields_by_name['endorsements'].message_type = _SIGNATURE _TRANSACTIONRESULT.fields_by_name['ol'].message_type = _OPERLOG -_BLOCKCHAIN.fields_by_name['block'].message_type = _BLOCK -DESCRIPTOR.message_types_by_name['Book'] = _BOOK +_TRANSACTIONRESULT.fields_by_name['result'].message_type = _ACTIONRESULT +_MPBFTPREPARE.fields_by_name['signature'].message_type = _SIGNATURE +_MPBFTCOMMIT.fields_by_name['prepares'].message_type = _MPBFTPREPARE +_MPBFTCOMMIT.fields_by_name['signature'].message_type = _SIGNATURE +_MPBFTREPLY.fields_by_name['commits'].message_type = _MPBFTCOMMIT +_MPBFTREPLY.fields_by_name['signature'].message_type = _SIGNATURE DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['Endorsement'] = _ENDORSEMENT -DESCRIPTOR.message_types_by_name['ChaincodeID'] = _CHAINCODEID +DESCRIPTOR.message_types_by_name['Signer'] = _SIGNER +DESCRIPTOR.message_types_by_name['CertId'] = _CERTID +DESCRIPTOR.message_types_by_name['Certificate'] = _CERTIFICATE +DESCRIPTOR.message_types_by_name['Signature'] = _SIGNATURE DESCRIPTOR.message_types_by_name['ChaincodeInput'] = _CHAINCODEINPUT -DESCRIPTOR.message_types_by_name['ChaincodeSpec'] = _CHAINCODESPEC +DESCRIPTOR.message_types_by_name['ChaincodeId'] = _CHAINCODEID +DESCRIPTOR.message_types_by_name['ChaincodeDeploy'] = _CHAINCODEDEPLOY DESCRIPTOR.message_types_by_name['Transaction'] = _TRANSACTION DESCRIPTOR.message_types_by_name['Block'] = _BLOCK -DESCRIPTOR.message_types_by_name['NonHashData'] = _NONHASHDATA DESCRIPTOR.message_types_by_name['OperLog'] = _OPERLOG +DESCRIPTOR.message_types_by_name['ActionResult'] = _ACTIONRESULT DESCRIPTOR.message_types_by_name['TransactionResult'] = _TRANSACTIONRESULT -DESCRIPTOR.message_types_by_name['BlockChain'] = _BLOCKCHAIN DESCRIPTOR.message_types_by_name['BlockchainInfo'] = _BLOCKCHAININFO -DESCRIPTOR.enum_types_by_name['ConfidentialityLevel'] = _CONFIDENTIALITYLEVEL +DESCRIPTOR.message_types_by_name['MPbftPrepare'] = _MPBFTPREPARE +DESCRIPTOR.message_types_by_name['MPbftCommit'] = _MPBFTCOMMIT +DESCRIPTOR.message_types_by_name['MPbftReply'] = _MPBFTREPLY _sym_db.RegisterFileDescriptor(DESCRIPTOR) -Book = _reflection.GeneratedProtocolMessageType('Book', (_message.Message,), dict( - DESCRIPTOR = _BOOK, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:Book) - )) -_sym_db.RegisterMessage(Book) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), dict( - DESCRIPTOR = _EVENT, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:Event) - )) +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Event) + }) _sym_db.RegisterMessage(Event) -Endorsement = _reflection.GeneratedProtocolMessageType('Endorsement', (_message.Message,), dict( - DESCRIPTOR = _ENDORSEMENT, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:Endorsement) - )) -_sym_db.RegisterMessage(Endorsement) - -ChaincodeID = _reflection.GeneratedProtocolMessageType('ChaincodeID', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEID, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:ChaincodeID) - )) -_sym_db.RegisterMessage(ChaincodeID) - -ChaincodeInput = _reflection.GeneratedProtocolMessageType('ChaincodeInput', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODEINPUT, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:ChaincodeInput) - )) +Signer = _reflection.GeneratedProtocolMessageType('Signer', (_message.Message,), { + 'DESCRIPTOR' : _SIGNER, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Signer) + }) +_sym_db.RegisterMessage(Signer) + +CertId = _reflection.GeneratedProtocolMessageType('CertId', (_message.Message,), { + 'DESCRIPTOR' : _CERTID, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.CertId) + }) +_sym_db.RegisterMessage(CertId) + +Certificate = _reflection.GeneratedProtocolMessageType('Certificate', (_message.Message,), { + 'DESCRIPTOR' : _CERTIFICATE, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Certificate) + }) +_sym_db.RegisterMessage(Certificate) + +Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), { + 'DESCRIPTOR' : _SIGNATURE, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Signature) + }) +_sym_db.RegisterMessage(Signature) + +ChaincodeInput = _reflection.GeneratedProtocolMessageType('ChaincodeInput', (_message.Message,), { + 'DESCRIPTOR' : _CHAINCODEINPUT, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.ChaincodeInput) + }) _sym_db.RegisterMessage(ChaincodeInput) -ChaincodeSpec = _reflection.GeneratedProtocolMessageType('ChaincodeSpec', (_message.Message,), dict( - DESCRIPTOR = _CHAINCODESPEC, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:ChaincodeSpec) - )) -_sym_db.RegisterMessage(ChaincodeSpec) - -Transaction = _reflection.GeneratedProtocolMessageType('Transaction', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTION, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:Transaction) - )) +ChaincodeId = _reflection.GeneratedProtocolMessageType('ChaincodeId', (_message.Message,), { + 'DESCRIPTOR' : _CHAINCODEID, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.ChaincodeId) + }) +_sym_db.RegisterMessage(ChaincodeId) + +ChaincodeDeploy = _reflection.GeneratedProtocolMessageType('ChaincodeDeploy', (_message.Message,), { + 'DESCRIPTOR' : _CHAINCODEDEPLOY, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.ChaincodeDeploy) + }) +_sym_db.RegisterMessage(ChaincodeDeploy) + +Transaction = _reflection.GeneratedProtocolMessageType('Transaction', (_message.Message,), { + 'DESCRIPTOR' : _TRANSACTION, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Transaction) + }) _sym_db.RegisterMessage(Transaction) -Block = _reflection.GeneratedProtocolMessageType('Block', (_message.Message,), dict( - DESCRIPTOR = _BLOCK, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:Block) - )) +Block = _reflection.GeneratedProtocolMessageType('Block', (_message.Message,), { + 'DESCRIPTOR' : _BLOCK, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.Block) + }) _sym_db.RegisterMessage(Block) -NonHashData = _reflection.GeneratedProtocolMessageType('NonHashData', (_message.Message,), dict( - DESCRIPTOR = _NONHASHDATA, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:NonHashData) - )) -_sym_db.RegisterMessage(NonHashData) - -OperLog = _reflection.GeneratedProtocolMessageType('OperLog', (_message.Message,), dict( - DESCRIPTOR = _OPERLOG, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:OperLog) - )) +OperLog = _reflection.GeneratedProtocolMessageType('OperLog', (_message.Message,), { + 'DESCRIPTOR' : _OPERLOG, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.OperLog) + }) _sym_db.RegisterMessage(OperLog) -TransactionResult = _reflection.GeneratedProtocolMessageType('TransactionResult', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTIONRESULT, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:TransactionResult) - )) +ActionResult = _reflection.GeneratedProtocolMessageType('ActionResult', (_message.Message,), { + 'DESCRIPTOR' : _ACTIONRESULT, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.ActionResult) + }) +_sym_db.RegisterMessage(ActionResult) + +TransactionResult = _reflection.GeneratedProtocolMessageType('TransactionResult', (_message.Message,), { + 'DESCRIPTOR' : _TRANSACTIONRESULT, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.TransactionResult) + }) _sym_db.RegisterMessage(TransactionResult) -BlockChain = _reflection.GeneratedProtocolMessageType('BlockChain', (_message.Message,), dict( - DESCRIPTOR = _BLOCKCHAIN, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:BlockChain) - )) -_sym_db.RegisterMessage(BlockChain) - -BlockchainInfo = _reflection.GeneratedProtocolMessageType('BlockchainInfo', (_message.Message,), dict( - DESCRIPTOR = _BLOCKCHAININFO, - __module__ = 'peer_pb2' - # @@protoc_insertion_point(class_scope:BlockchainInfo) - )) +BlockchainInfo = _reflection.GeneratedProtocolMessageType('BlockchainInfo', (_message.Message,), { + 'DESCRIPTOR' : _BLOCKCHAININFO, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.BlockchainInfo) + }) _sym_db.RegisterMessage(BlockchainInfo) +MPbftPrepare = _reflection.GeneratedProtocolMessageType('MPbftPrepare', (_message.Message,), { + 'DESCRIPTOR' : _MPBFTPREPARE, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.MPbftPrepare) + }) +_sym_db.RegisterMessage(MPbftPrepare) + +MPbftCommit = _reflection.GeneratedProtocolMessageType('MPbftCommit', (_message.Message,), { + 'DESCRIPTOR' : _MPBFTCOMMIT, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.MPbftCommit) + }) +_sym_db.RegisterMessage(MPbftCommit) + +MPbftReply = _reflection.GeneratedProtocolMessageType('MPbftReply', (_message.Message,), { + 'DESCRIPTOR' : _MPBFTREPLY, + '__module__' : 'peer_pb2' + # @@protoc_insertion_point(class_scope:rep.protos.MPbftReply) + }) +_sym_db.RegisterMessage(MPbftReply) + DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope) diff --git a/test.py b/test.py new file mode 100644 index 0000000000000000000000000000000000000000..2516fcc3f5564170ee741e6ffc1fb8a177cde921 --- /dev/null +++ b/test.py @@ -0,0 +1,22 @@ +from client import Client +import json + +def main(): + client = Client() + # 部署evidence合约:交易标识string,合约名称string,合约版本int,合约代码类型string + # trans = client.create_trans_deploy("", "evidence", 1, "scala") + # 调用evidence合约:交易标识string,合约名称string,合约版本int,合约方法string,方法参数string + dict = {} + dict['file_hash'] = "hash120734332" + dict['location_information'] = "loc2" + dict['time_serviceretrival_center'] = "time2" + dict['personnel_information'] = "psn2" + dict['equipment_information'] = "eqp2" + trans = client.create_trans_invoke("", "evidence", 1, "put_proof", json.dumps(dict)) + # trans = client.create_trans_invoke("", "evidence", 1, "retrival", json.dumps("hash120734332")) + # 设置状态:交易标识string,合约名称string,合约版本int,更改状态bool + # trans = create_trans_set_state("", "evidence", 1, False) + print(client.postTranByString(trans).text) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/test_putproof.py b/test_putproof.py deleted file mode 100644 index 8349dc35974e0b2851d2909d868e73a3aea6f8de..0000000000000000000000000000000000000000 --- a/test_putproof.py +++ /dev/null @@ -1,51 +0,0 @@ -import peer_pb2 as peer -from Client import Client -from google.protobuf.text_format import MessageToString -import json - -host = 'http://192.168.2.88:8081' -#host ='http://repchain.scia-gd.com' -jksPath = 'D:\\new\\repchain\\jks\\mykeystore_1.pem' -password = '123' -alias = '1' - -client = Client(host, jksPath, password, alias) -# TODO: -# String cname = SupplyTpl.getPayload().getChaincodeID().getName() - -# 以下为调用存证合约参数 -tranType = peer.Transaction.CHAINCODE_INVOKE -chainCodeIdPath = "path" -chaincodeInputFunc = "put_proof" -dict = {} -dict['file_hash'] = "hash17" -dict['location_information'] = "loc2" -dict['time_serviceretrival_center'] = "time2" -dict['personnel_information'] = "psn2" -dict['equipment_information'] = "eqp2" -param = json.dumps(dict) -spcPackage = "string" -chaincodeId = "b499200e70062be0d33ecd7f0ec1171dc974046ab86e88b016c7d8a7ab830bbf" -ctype = peer.ChaincodeSpec.CODE_SCALA - - -# 以下为部署合约参数 -#f = open("C:/Users/admin/Downloads/ContractEvidence_new.scala",'r', encoding ='utf-8') -# f = open("D:/new/repchain/src/main/scala/ContractEvidence.scala",'r', encoding ='utf-8') -# str_contract = f.read() -# tranType = peer.Transaction.CHAINCODE_DEPLOY -# chainCodeIdPath = "path" -# chaincodeInputFunc = "" -# param = "" -# spcPackage = str_contract -# chaincodeId = "" -# ctype = peer.ChaincodeSpec.CODE_SCALA - -# 构造交易 -trans = client.createTransaction(tranType, chainCodeIdPath, chaincodeInputFunc, param, spcPackage, chaincodeId, ctype) -print(MessageToString(trans)) - -# 发送交易 -result = client.postTranByString(trans) -print(result.text) - diff --git a/test_retrival.py b/test_retrival.py deleted file mode 100644 index 3523bff58c296d58fcb65cf9edd221da267c634c..0000000000000000000000000000000000000000 --- a/test_retrival.py +++ /dev/null @@ -1,59 +0,0 @@ -import peer_pb2 as peer -from Client import Client -from google.protobuf.text_format import MessageToString -import json - -host = 'http://192.168.2.88:8081' -jksPath = 'D:\\new\\repchain\\jks\\mykeystore_1.pem' -password = '123' -alias = '1' - -client = Client(host, jksPath, password, alias) -# TODO: -# String cname = SupplyTpl.getPayload().getChaincodeID().getName() - -# 以下为调用存证合约参数 -# tranType = peer.Transaction.CHAINCODE_INVOKE -# chainCodeIdPath = "path" -# chaincodeInputFunc = "put_proof" -# dict = {} -# dict['file_hash'] = "hash17" -# dict['location_information'] = "loc2" -# dict['time_serviceretrival_center'] = "time2" -# dict['personnel_information'] = "psn2" -# dict['equipment_information'] = "eqp2" -# param = json.dumps(dict) -# spcPackage = "string" -# chaincodeId = "14cb0fea3ee284d3a7032698dc761a58e1d8f7e01aa2b0da69722cb4bd38d170" -# ctype = peer.ChaincodeSpec.CODE_SCALA - - -# -tranType = peer.Transaction.CHAINCODE_INVOKE -chainCodeIdPath = "path" -chaincodeInputFunc = "retrival" -param = json.dumps("hash17") -spcPackage = "string" -#chaincodeId = "14cb0fea3ee284d3a7032698dc761a58e1d8f7e01aa2b0da69722cb4bd38d170" -chaincodeId ="b499200e70062be0d33ecd7f0ec1171dc974046ab86e88b016c7d8a7ab830bbf" -ctype = peer.ChaincodeSpec.CODE_SCALA - -# 以下为部署合约参数 -# f = open("C:/Users/admin/Downloads/ContractEvidence_new.scala",'r', encoding ='utf-8') -# str_contract = f.read() -# tranType = peer.Transaction.CHAINCODE_DEPLOY -# chainCodeIdPath = "path" -# chaincodeInputFunc = "" -# param = "" -# spcPackage = str_contract -# chaincodeId = "" -# ctype = peer.ChaincodeSpec.CODE_SCALA - -# 构造交易 -trans = client.createTransaction(tranType, chainCodeIdPath, chaincodeInputFunc, param, spcPackage, chaincodeId, ctype) -print(MessageToString(trans)) - -# 发送交易 -result = client.postTranByString(trans) -print(result.text) - diff --git a/tool.py b/tool.py deleted file mode 100644 index c5ba42a2faaf08411dd53e0af369b10705288e9c..0000000000000000000000000000000000000000 --- a/tool.py +++ /dev/null @@ -1,38 +0,0 @@ -import hashlib -import Base58 - -def generate_address(public_key): - assert isinstance(public_key, bytes) - - #print('0x04 + x + y:', ''.join(['{:02X}'.format(i) for i in s])) - hasher = hashlib.sha256() - hasher.update(public_key) - r = hasher.digest() - #print('SHA256(0x04 + x + y):', ''.join(['{:02X}'.format(i) for i in r])) - - hasher = hashlib.new('ripemd160') - hasher.update(r) - r = hasher.digest() - #print('RIPEMD160(SHA256(0x04 + x + y)):', ''.join(['{:02X}'.format(i) for i in r])) - - # Since '1' is a zero byte, it won't be present in the output address - return '1' + base58_check(r, version=0) - -def base58_check(src, version=0): - src = bytes([version]) + src - - hasher = hashlib.sha256() - hasher.update(src) - r = hasher.digest() - #print('SHA256(0x00 + r):', ''.join(['{:02X}'.format(i) for i in r])) - - hasher = hashlib.sha256() - hasher.update(r) - r = hasher.digest() - #print('SHA256(SHA256(0x00 + r)):', ''.join(['{:02X}'.format(i) for i in r])) - - checksum = r[:4] - s = src + checksum - #print('src + checksum:', ''.join(['{:02X}'.format(i) for i in s])) - - return Base58.encode(int.from_bytes(s, 'big')) \ No newline at end of file