Skip to content

Commit

Permalink
Merge pull request #187 from WeBankFinTech/release/1.0.23
Browse files Browse the repository at this point in the history
Release/1.0.23
  • Loading branch information
yanggang-JV authored Jan 26, 2021
2 parents f7f5e52 + c2d30d3 commit 3c5454f
Show file tree
Hide file tree
Showing 37 changed files with 1,326 additions and 906 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
### V1.0.23 (2021-01-26)

* 新增功能:
1. 支持国密版本安装部署
2. 新增数据概览面板
3. 支持CPT实时链上查询和分页查询
4. 支持Policy链上注册及查询

### V1.0.22 (2020-12-20)

* 新增功能:
1. 适配weid-java-sdk1.7.1

### V1.0.21 (2020-11-20)

* 新增功能:
1. 合约部署支持备注
2. 支持查询存证合约启用机构列表
3. 权威机构注册添加描述
4. 权威机构自主注册以及管理员认证和撤销
5. 安装脚本支持指定端口安装
6. 修复weid列表查询分页bug
7. 优化webase集成

### V1.0.20 (2020-11-10)

* 系统优化:
1. 升级web3sdk版本到2.4.4
2. 升级spring版本到5.2.8
3. 升级weid-java-sdk版本到1.6.7

### V1.0.19 (2020-09-19)

* 新增功能:
1. 优化cpt注册相关功能。
2. 支持weid历史查询。
3. 支持redis配置。
4. 集成webase安装,访问。
5. 其他界面节优化。

### V1.0.7 (2019-08-22)

* 新增功能:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WeIdentity JAVA SDK安装部署工具

| weid-build-tools 版本 | weid-java-sdk 版本 | weid-contract-java 版本 |
| :---- | :---- | :---- |
| v1.0.23 | v1.8.0 | v1.2.29 |
| v1.0.22 | v1.7.1 | v1.2.28 |
| v1.0.21 | v1.7.0 | v1.2.27 |
| v1.0.20 | v1.6.7 | v1.2.26 |
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.22
1.0.23
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
Expand Down Expand Up @@ -96,7 +96,7 @@ List redis_driver = [
"org.redisson:redisson:3.13.1"
]

def spring_version = "5.2.8.RELEASE"
def spring_version = "5.3.2"
List spring = [
"org.springframework:spring-aop:$spring_version",
"org.springframework:spring-beans:$spring_version",
Expand Down
12 changes: 10 additions & 2 deletions common/script/tpl/fisco.properties.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ web3sdk.keep-alive-seconds=60
#######################################################################################################
# Fisco-Bcos 2.x params, including Group ID and Encrypt Type
group.id=${GROUP_ID}
encrypt.type=0
# Fisco-Bcos encrypt type, 0:ECDSA 1:SM2
encrypt.type=${ENCRYPT_TYPE}


#######################################################################################################
Expand All @@ -62,4 +63,11 @@ v1.client-key-store-path=client.keystore
v1.key-store-password=123456
v2.ca-crt-path=ca.crt
v2.node-crt-path=node.crt
v2.node-key-path=node.key
v2.node-key-path=node.key

# gm
gm.ca-crt-path=gmca.crt
gm.sdk-crt-path=gmsdk.crt
gm.sdk-key-path=gmsdk.key
gmen.sdk-crt-path=gmensdk.crt
gmen.sdk-key-path=gmensdk.key
3 changes: 3 additions & 0 deletions common/script/tpl/run.config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ chain_id=1
#group id
group_id=1

#encrypt type, 0:非国密;1:国密
encrypt_type=0

#Configure your database information
persistence_type=
mysql_address=
Expand Down
3 changes: 2 additions & 1 deletion compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ function compile()
export BLOCKCHIAN_NODE_INFO=$(echo -e ${content})
export CHAIN_ID=${chain_id}
export GROUP_ID=${group_id}
export ENCRYPT_TYPE=${encrypt_type}
export CNS_PROFILE_ACTIVE=${cns_profile_active}
export FISCO_BCOS_VERSION=${blockchain_fiscobcos_version}
FISCOVAS='${GROUP_ID}:${CHAIN_ID}:${FISCO_BCOS_VERSION}:${CNS_PROFILE_ACTIVE}'
FISCOVAS='${GROUP_ID}:${CHAIN_ID}:${ENCRYPT_TYPE}:${FISCO_BCOS_VERSION}:${CNS_PROFILE_ACTIVE}'
envsubst ${FISCOVAS}} < ${FISCO_XML_CONFIG_TPL} >${FISCO_XML_CONFIG}
if [ -f ${FISCO_XML_CONFIG_TMP} ];then
rm ${FISCO_XML_CONFIG_TMP}
Expand Down
27 changes: 17 additions & 10 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ port=$(grep "server\.port" $applicationFile |awk -F "=" '{print $2}')
function reloadAddressForWeb() {
export WEB_PID=`ps aux|grep "BuildToolApplication" | grep -v grep|awk '{print $2}'|head -1`
if [ -n "$WEB_PID" ];then
curl http://localhost:${port}/reloadAddress
curl http://localhost:${port}/weid/weid-build-tools/reloadAddress
fi
}

Expand Down Expand Up @@ -106,21 +106,28 @@ function clean_data()

function check_node_cert(){

cd ${SOURCE_CODE_DIR}/resources
if [ "${blockchain_fiscobcos_version}" = "1" ];then
cd ${SOURCE_CODE_DIR}/resources
if [ "${blockchain_fiscobcos_version}" = "1" ];then
if [ ! -f ca.crt -o ! -f client.keystore ];then
echo "ERROR : fisco bcos version is 1.3, ca.crt and client.keystore are needed."
exit 1
fi
echo "ERROR : fisco bcos version is 1.3, ca.crt and client.keystore are needed."
exit 1
fi
elif [ "${blockchain_fiscobcos_version}" = "2" ];then
if [ ! -f ca.crt -o ! -f node.crt -o ! -f node.key ];then
echo "ERROR : fisco bcos version is 2.0. ca.crt, node.crt and node.key are needed."
exit 1
if [ "${encrypt_type}" = "0" ];then
if [ ! -f ca.crt -o ! -f node.crt -o ! -f node.key ];then
echo "ERROR : fisco bcos version is 2.0. encrypt type is ECDSA, ca.crt, node.crt and node.key are needed."
exit 1
fi
else
if [ ! -f gmca.crt -o ! -f gmsdk.crt -o ! -f gmsdk.key -o ! -f gmensdk.crt -o ! -f gmensdk.key ];then
echo "ERROR : fisco bcos version is 2.0, encrypt type is SM2, gmca.crt, gmsdk.crt, gmsdk.key, gmensdk.crt and gmensdk.key are needed."
exit 1
fi
fi
else
echo "the version : ${blockchain_fiscobcos_version} is not supported, we only support FISCO BCOS 1.3 and 2.0."
exit 1
fi
fi
}

function main()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
weidSdkVersion=1.7.1
weidSdkVersion=1.8.0
repoType=cn
jdkTlsNamedGroups=secp256r1,secp256k1
signing.keyId=
Expand Down
3 changes: 3 additions & 0 deletions run.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ chain_id=1
#group id
group_id=1

#encrypt type, 0:非国密;1:国密
encrypt_type=0

#Configure your database information
#persistence_type is "mysql" or "redis"
persistence_type=
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/webank/weid/command/DeployContract.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package com.webank.weid.command;

import org.apache.commons.lang3.StringUtils;
import org.fisco.bcos.web3j.crypto.EncryptType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -58,14 +59,15 @@ public static void main(String[] args) {
.parse(args);
String chainId = commandArgs.getChainId();
String privateKeyFile = commandArgs.getPrivateKey();
// 获取配置
FiscoConfig fiscoConfig = configService.loadNewFiscoConfig();
fiscoConfig.setChainId(chainId);
new EncryptType(Integer.parseInt(fiscoConfig.getEncryptType()));
// 说明给了私钥文件
if (StringUtils.isNotBlank(privateKeyFile)) {
String privateKey = FileUtils.readFile(privateKeyFile);
deployService.createAdmin(privateKey);
}
// 获取配置
FiscoConfig fiscoConfig = configService.loadNewFiscoConfig();
fiscoConfig.setChainId(chainId);
// 部署合约
String hash = deployService.deploy(fiscoConfig, DataFrom.COMMAND);
System.out.println("the contract deploy successfully --> hash : " + hash);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/webank/weid/command/UpgradeDataBucket.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@

package com.webank.weid.command;

import com.webank.weid.config.FiscoConfig;
import com.webank.weid.service.ConfigService;
import java.math.BigInteger;

import org.apache.commons.lang3.StringUtils;
import org.fisco.bcos.web3j.crypto.Credentials;
import org.fisco.bcos.web3j.crypto.EncryptType;
import org.fisco.bcos.web3j.crypto.gm.GenCredential;
import org.fisco.bcos.web3j.precompile.cns.CnsInfo;
import org.fisco.bcos.web3j.precompile.cns.CnsService;
Expand Down Expand Up @@ -52,6 +55,8 @@ public class UpgradeDataBucket {
* log4j.
*/
private static final Logger logger = LoggerFactory.getLogger(UpgradeDataBucket.class);

private static ConfigService configService = new ConfigService();

public static void main(String[] args) {
try {
Expand All @@ -62,6 +67,10 @@ public static void main(String[] args) {
System.out.println("the DataBucket upgrade fail: can not found the private key.");
System.exit(1);
}

FiscoConfig fiscoConfig = configService.loadNewFiscoConfig();
EncryptType encryptType = new EncryptType(Integer.parseInt(fiscoConfig.getEncryptType()));

// 根据私钥获取Credentials
Credentials credentials = GenCredential.create(new BigInteger(currentPrivateKey.getPrivateKey()).toString(16));
// 重新部署所有的DataBucket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package com.webank.weid.constant;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;

/**
* The Class WeIdConstant.
Expand Down Expand Up @@ -57,5 +59,6 @@ public final class BuildToolsConstant {
public static final String APPLY_NAME = "applyName";

public static final String EVIDENCE_NAME = "evidenceName";


public static final List<Integer> CPTID_LIST = Arrays.asList(11, 101, 103, 105, 106, 107, 108, 109, 110, 111);
}
Loading

0 comments on commit 3c5454f

Please sign in to comment.