mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-02 03:38:08 +08:00
在dev_rc_jdk13_1.2.0的基础上手工合并did代码,部署合约和调用合约测试完成。
This commit is contained in:
parent
d5566b35dc
commit
5ab71b37b4
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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;//操作的id,通过uuid自动生成,合约需要查重
|
||||
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;//凭据内容的hash,算法为SHA256
|
||||
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;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
子模块说明
|
||||
========================
|
||||
TODO:在本文件中描述与本模块相关的问题
|
@ -1,7 +0,0 @@
|
||||
子模块说明
|
||||
========================
|
||||
TODO:在本文件中描述与本模块相关的问题
|
||||
|
||||
---
|
||||
1. 模块注释
|
||||
. EventActor:
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
/**
|
||||
* 请求消息的调度处理
|
||||
*
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user