在dev_rc_jdk13_1.2.0的基础上手工合并did代码,部署合约和调用合约测试完成。

This commit is contained in:
jiangbuyun 2021-02-25 10:33:11 +08:00
parent d5566b35dc
commit 5ab71b37b4
9 changed files with 172 additions and 31 deletions

View File

@ -247,7 +247,29 @@
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="Permission_Appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logs/RepChain-Permission-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- each file should be at most 100MB, keep 30 days worth of history, but at most 3GB -->
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>TRACE</level>
</filter>
<immediateFlush>false</immediateFlush>
<append>false</append>
<encoder charset="UTF-8">
<pattern>%date{ISO8601} %-5level %logger{36} %X{akkaSource} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<!--level过滤器简化版-->
@ -307,6 +329,10 @@
<appender-ref ref="APIAccess_Appender"/>
</logger>
<logger name="Permission_Logger" additivity="false" level="TRACE">
<appender-ref ref="Permission_Appender"/>
</logger>
<root level="DEBUG">
<appender-ref ref="STDOUT" additivity="false"/>
</root>

View File

@ -86,6 +86,7 @@ akka.http {
system {
#创世节点的名称,在系统初始化时,将根据该节点是否是创世节点进行创世块的建立
genesis_node_name = "121000005l35120456.node1"
chain_cert_name = "951002007l78123233.super_admin"
#api是否开启
#如果是单机多节点测试模式Repchain则选择0默认节点1会开启
ws_enable = 1#api 0,不开启;1,开启
@ -132,7 +133,7 @@ system {
, "921000006e0012v696.node5"]
}
account {
chaincodename = "ContractCert"#账户管理合约的名称
chaincodename = "RdidOperateAuthorizeTPL"#账户管理合约的名称
chaincodeversion = 1
#证书状态改变函数名
CertStatusChangeFunction = "UpdateCertStatus"

View File

@ -46,18 +46,27 @@ message Event {
}
//
message Signer{
string name = 1; //,
string credit_code = 2; //,
string mobile = 3; // ,
repeated string cert_names = 4;//便
//map<string, Certificate> certs = 4; //
message Signer{
string name = 1;//
string credit_code = 2;//DID使DID
string mobile = 3; // ,
repeated string cert_names = 4;//便did_certname
repeated string authorize_ids = 5;//id
repeated string operate_ids = 6;//id
repeated string credential_metadata_ids = 7;//id
repeated Certificate authentication_certs = 8;//
string signer_info = 9;//json格式
google.protobuf.Timestamp create_time = 10; //
google.protobuf.Timestamp disable_time = 11; //
bool signer_valid = 12;//=false
string version=13 ;//1.0
}
//
message CertId {
string credit_code = 1;
string cert_name = 2;//
string credit_code = 1;//DID使DID
string cert_name = 2;//
string version=3;//1.0
}
//
@ -65,17 +74,100 @@ message Certificate {
string certificate = 1; //
string alg_type = 2;//:ECDSA下的SHA1withECDSA,SHA512withECDSA等
bool cert_valid = 3;//true false protobuf默认该值为false
google.protobuf.Timestamp reg_Time = 4; //
google.protobuf.Timestamp unreg_Time = 5; //
google.protobuf.Timestamp reg_Time = 4; //
google.protobuf.Timestamp unreg_Time = 5; //
enum CertType {
CERT_UNDEFINED = 0;
CERT_AUTHENTICATION = 1;
CERT_CUSTOM = 2;
}
CertType cert_type = 6; //1=2=
CertId id = 7; //
string cert_hash = 8;//SHA256
string version=9;//1.0
}
message Operate{
string op_id = 1;//iduuid自动生成
string description = 2;//
string register = 3;//使credit code或者rdid
bool is_publish = 4;//rdid就可以调用false
enum OperateType {
OPERATE_UNDEFINED = 0;
OPERATE_CONTRACT = 1;
OPERATE_SERVICE = 2;
}
OperateType operate_type = 5;//访
repeated string operate_service_name = 6;//
string operate_endpoint = 7;//
string auth_full_name = 8;//访
google.protobuf.Timestamp create_time = 9; //
google.protobuf.Timestamp disable_time = 10; //
bool op_valid = 11;//=false
string version=12;//1.0
}
message Authorize{
string id = 1;//id
string grant = 2;//credit code或者rdid
repeated string granted = 3;//,credit code或者rdid
repeated string op_id = 4;//id
enum TransferType {
TRANSFER_DISABLE = 0;
TRANSFER_ONCE = 1;
TRANSFER_REPEATEDLY = 2;
}
TransferType is_transfer = 5;//TRANSFER_DISABLE TRANSFER_ONCE TRANSFER_REPEATEDLY
google.protobuf.Timestamp create_time = 6; //
google.protobuf.Timestamp disable_time = 7; //
bool authorize_valid = 8;//=false
string version=9;//1.0
}
message BindCertToAuthorize{
string authorize_id = 1 ;//id
CertId granted = 2;//
string version=3;//1.0
}
message Credential{
string id=1;//id便
string credential_type = 2;//
string credential_type_version=3 ;//
CertId granter = 4;//
google.protobuf.Timestamp grant_time = 5;//
string credential_holder = 6;//使did
string credential_content = 7;//
string credential_content_hash = 8;//hashSHA256
string signature_alg_type = 9;//
string signature_value = 10;//
bool credential_valid = 11;//
string version=12;//1.0
}
message MetadataDefine{
string key = 1;
bool is_open = 2;
repeated MetadataDefine childs = 3;
}
message CredentialContentMetadata{
string id=1;//ccm id id
string publisher = 2;//did
repeated MetadataDefine metadata = 3;
string meta_version = 4;
google.protobuf.Timestamp update_time = 5; //
string version = 6;
}
//Transaction和Block
message Signature {
//
CertId cert_id = 1;
google.protobuf.Timestamp tm_local = 2; //
//
bytes signature = 3;
bytes signature = 3;
}
//
@ -90,19 +182,26 @@ message ChaincodeId {
}
// ,/
message ChaincodeDeploy {
//Type only support javascript
//Type only support javascript
int32 timeout = 1;
//
string code_package = 2;
//
string legal_prose =3;
enum CodeType {
CODE_UNDEFINED = 0;
CODE_UNDEFINED = 0;
CODE_JAVASCRIPT = 1;
CODE_SCALA = 2;
CODE_SCALA_PARALLEL = 3;
}
CodeType ctype = 4;
}
enum ContractClassification {
CONTRACT_UNDEFINED = 0;
CONTRACT_SYSTEM = 1;
CONTRACT_CUSTOM = 2;
}
ContractClassification cclassification = 5;
}
/*
*
@ -122,7 +221,7 @@ message Transaction {
ChaincodeId cid = 3;
oneof para {
ChaincodeDeploy spec = 4;
ChaincodeInput ipt = 5;
ChaincodeInput ipt = 5;
bool state = 6;
}
Signature signature = 7;
@ -174,3 +273,20 @@ message BlockchainInfo {
bytes currentStateHash = 5;
}
//zhj
message MPbftPrepare {
Signature signature = 1;
}
//zhj
message MPbftCommit {
repeated MPbftPrepare prepares = 1;
Signature signature = 2;
}
//zhj
message MPbftReply {
repeated MPbftCommit commits = 1;
Signature signature = 2;
}

View File

@ -1,3 +0,0 @@
子模块说明
========================
TODO:在本文件中描述与本模块相关的问题

View File

@ -1,7 +0,0 @@
子模块说明
========================
TODO:在本文件中描述与本模块相关的问题
---
1. 模块注释
. EventActor

View File

@ -197,7 +197,7 @@ class PreloaderForTransaction(moduleName: String) extends ModuleBase(moduleName)
RepLogger.error(RepLogger.Consensus_Logger, this.getLogMsgPrefix(s" AssembleTransResult error, error: ${e.getMessage}"))
None
} finally {
//ImpDataPreloadMgr.Free(pe.getSysTag,db_indentifier)
ImpDataPreloadMgr.Free(pe.getSysTag,db_indentifier)
}
}

View File

@ -324,14 +324,22 @@ class SandboxDispatcher(moduleName: String, cid: String) extends ModuleBase(modu
sender ! rs.toSeq
}
}
private def createErrorData(ts:scala.collection.Seq[Transaction],err: Option[akka.actor.Status.Failure]):Array[DoTransactionResult]={
/*private def createErrorData(ts:scala.collection.Seq[Transaction],err: Option[akka.actor.Status.Failure]):Array[DoTransactionResult]={
var rs = scala.collection.mutable.ArrayBuffer[DoTransactionResult]()
ts.foreach(t=>{
rs += new DoTransactionResult(t.id, null, null, err)
})
rs.toArray
}
}*/
private def createErrorData(ts: scala.collection.Seq[Transaction], err: Option[akka.actor.Status.Failure]): Array[TransactionResult] = {
var rs = scala.collection.mutable.ArrayBuffer[TransactionResult]()
ts.foreach(t => {
rs += new TransactionResult(t.id, _root_.scala.Seq.empty, Option(ActionResult(105, err.get.cause.getMessage))) //new TransactionResult(t.id, null, null, err)
})
rs.toArray
}
/**
* 请求消息的调度处理
*

View File

@ -223,7 +223,7 @@ object CreateGenesisInfo {
val rstr = pretty(render(r))
println(rstr)
val pw = new PrintWriter("json/gensis.json","UTF-8")
val pw = new PrintWriter("json/genesis.json","UTF-8")
pw.write(rstr)
pw.flush()
pw.close()