Skip to content

Commit

Permalink
Merge pull request #444 from WeBankBlockchain/lab-dev
Browse files Browse the repository at this point in the history
Lab rc2 to lab
  • Loading branch information
CodingCattwo authored May 9, 2022
2 parents 4892c15 + 1e0e693 commit 2eaeb17
Show file tree
Hide file tree
Showing 100 changed files with 4,924 additions and 835 deletions.
15 changes: 15 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@

### lab-rc2(2022-05-07)

**Add**
- 支持Liquid合约功能
- 支持BFS、CNS、权限管理、Event查看与事件订阅等功能

**兼容性**
- 支持FISCO-BCOS v3.0.0-rc2 及以上版本
- WeBASE-Web lab-rc2
- WeBASE-Front lab-rc2
- WeBASE-Sign lab-rc1

详细了解,请阅读[**技术文档**](https://webasedoc.readthedocs.io/zh_CN/lab/)

### lab-rc1(2021-12-09)

**Add**
Expand All @@ -10,6 +24,7 @@
- WeBASE-Web lab-rc1
- WeBASE-Front lab-rc1
- WeBASE-Sign lab-rc1

详细了解,请阅读[**技术文档**](https://webasedoc.readthedocs.io/zh_CN/lab/)


Expand Down
16 changes: 10 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
mavenLocal()
}

def springboot_version="2.1.18.RELEASE"
def springboot_version="2.3.12.RELEASE"
List springboot = [
"org.springframework.boot:spring-boot-starter-web:$springboot_version",
"org.springframework.boot:spring-boot-starter-security:$springboot_version",
Expand All @@ -31,7 +31,7 @@ List springboot = [
]

// cover old version
def spring_version="5.2.15.RELEASE"
def spring_version="5.2.20.RELEASE"
List spring = [
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-aop:$spring_version",
Expand Down Expand Up @@ -64,7 +64,7 @@ List lombok = [
"org.projectlombok:lombok:1.18.12"
]

def jackson_version = "2.11.4"
def jackson_version = "2.13.2"
List jackson = [
"com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.core:jackson-annotations:$jackson_version",
Expand All @@ -78,7 +78,7 @@ List test = [
"org.springframework.boot:spring-boot-starter-test:$springboot_version"
]

def log4j_version="2.15.0"
def log4j_version="2.17.1"
List log4j = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
Expand All @@ -105,21 +105,25 @@ List swagger = [

dependencies {
compile springboot,spring,spring_security,jaxb,jackson,log4j,scaffold,swagger
compile ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.0.0-rc1')
compile ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.0.0-rc2-bugfix-SNAPSHOT')
compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.0"
compile "org.apache.commons:commons-lang3:3.8.1"
compile 'org.apache.commons:commons-collections4:4.4'
compile 'org.apache.commons:commons-compress:1.21'
compile "mysql:mysql-connector-java:8.0.22"
compile "com.zaxxer:HikariCP:3.2.0"
compile "com.github.sgroschupf:zkclient:0.1"
compile 'org.bouncycastle:bcprov-jdk15on:1.67'
compile 'javax.validation:validation-api:2.0.1.Final'
compile 'org.hibernate.validator:hibernate-validator:6.0.21.Final'
// cover old version
compile 'com.google.guava:guava:28.2-jre'
compile 'org.slf4j:jcl-over-slf4j:1.7.30'
compile 'org.yaml:snakeyaml:1.30'

compile 'com.jcraft:jsch:0.1.55'
compile 'org.ini4j:ini4j:0.5.4'
compile ('com.github.docker-java:docker-java:3.2.1') {
compile ('com.github.docker-java:docker-java:3.2.13') {
exclude group: 'io.netty'
exclude group: 'org.bouncycastle'
}
Expand Down
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lab-rc1
lab-rc2
2 changes: 2 additions & 0 deletions script/webase-ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ CREATE TABLE IF NOT EXISTS tb_contract (
modify_time datetime DEFAULT NULL COMMENT '修改时间',
deploy_address varchar(64) DEFAULT NULL COMMENT '合约部署者地址',
deploy_user_name varchar(64) DEFAULT NULL COMMENT '合约部署者用戶名',
is_wasm tinyint(4) DEFAULT '0' COMMENT '是否为liquid合约(0-solidity合约,1-liquid合约)',
PRIMARY KEY (contract_id),
UNIQUE KEY uk_group_path_name (group_id,contract_path,contract_name,account)
) ENGINE=InnoDB AUTO_INCREMENT=200001 DEFAULT CHARSET=utf8 COMMENT='合约表';
Expand Down Expand Up @@ -329,6 +330,7 @@ CREATE TABLE IF NOT EXISTS tb_abi (
contract_bin mediumtext NOT NULL COMMENT '合约ABI的runtime-bin',
create_time datetime DEFAULT NULL COMMENT '合约ABI的创建时间',
modify_time datetime DEFAULT NULL COMMENT '合约ABI的修改时间',
is_wasm tinyint(4) DEFAULT '0' COMMENT '是否为liquid合约(0-solidity合约,1-liquid合约)',
PRIMARY KEY (abi_id),
UNIQUE KEY unique_address (group_id,account,contract_address)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合约ABI表';
Expand Down
293 changes: 191 additions & 102 deletions script/webase-dml.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.webank.webase.node.mgr.alert.task;

import com.webank.webase.node.mgr.precntauth.precompiled.consensus.ConsensusServiceInWebase;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
Expand All @@ -38,7 +38,6 @@
import com.webank.webase.node.mgr.node.NodeService;
import com.webank.webase.node.mgr.node.entity.Node;
import com.webank.webase.node.mgr.node.entity.TbNode;
import com.webank.webase.node.mgr.precompiled.PrecompiledService;

import lombok.extern.log4j.Log4j2;

Expand All @@ -54,7 +53,7 @@ public class NodeStatusMonitorTask {
@Autowired
private GroupService groupService;
@Autowired
private PrecompiledService precompiledService;
private ConsensusServiceInWebase consensusServiceInWebase;
@Autowired
private MailService alertMailService;
@Autowired
Expand Down Expand Up @@ -177,7 +176,7 @@ public Node checkAbnormalNodeIsNotRemove(String groupId, String nodeId) {
* @return [{nodeId=xxx,nodeType=xxx}, {..}]
*/
public List<LinkedHashMap<String, String>> getNodeListWithType(String groupId) {
Object responseFromFront = precompiledService.getNodeListService(groupId,
Object responseFromFront = consensusServiceInWebase.getNodeListService(groupId,
100, 1);
try {
// get data from response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ public class ConstantCode {
public static final RetCode BIND_PRIVATE_KEY_NOT_MATCH = RetCode.mark(202543,"Binding private key not match this user's address");
public static final RetCode BIND_PRIVATE_ALREADY_HAS_PK = RetCode.mark(202544,"This user already contain private key");

// lab
public static final RetCode LIQUID_COMPILE_FAILED = RetCode.mark(202550,"Liquid compile error");
public static final RetCode DEPLOY_LIQUID_ADDRESS_CANNOT_EMPTY = RetCode.mark(202551, "When deploying liquid, contract address must not be empty");



/* auth */
public static final RetCode USER_NOT_LOGGED_IN = RetCode.mark(302000, "user not logged in");
Expand All @@ -338,4 +343,13 @@ public class ConstantCode {
/* param exception */
public static final RetCode PARAM_EXCEPTION = RetCode.mark(402000, "param exception");

// consensus (node manager)
public static final RetCode INVALID_NODE_ID = RetCode.mark(201216,"node id is invalid");
public static final RetCode INVALID_NODE_TYPE = RetCode.mark(201217,"invalid node type: sealer, observer, remove ");
public static final RetCode FAIL_CHANGE_NODE_TYPE = RetCode.mark(201218,"set node consensus type fail, check permission or node's group config file");
public static final RetCode ADD_SEALER_WEIGHT_CANNOT_NULL = RetCode.mark(201621, "Sealer's weight cannot be null");

public static final RetCode EXEC_ENV_IS_WASM = RetCode.mark(201670, "exec env is wasm, don't support");


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2014-2022 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.webank.webase.node.mgr.base.enums;

/**
* compile liquid status
*/
public enum CompileStatus {
RUNNING(1), SUCCESS(2), FAIL(3), INIT(4);

private int value;

CompileStatus(Integer dataStatus) {
this.value = dataStatus;
}

public int getValue() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ public void registerCns(ReqRegisterCns inputParam) throws NodeMgrException {
params.put("contractAddress", inputParam.getContractAddress());
params.put("abiInfo", abiArray);

// register remove in 3.0
// frontRestTools.postForEntity(groupId, FrontRestTools.URI_CONTRACT_REGISTER_CNS, params,
// Object.class);
frontRestTools.postForEntity(groupId, FrontRestTools.URI_CONTRACT_REGISTER_CNS, params,
Object.class);
// save cns
TbCns tbCns = new TbCns();
BeanUtils.copyProperties(inputParam, tbCns);
Expand Down
Loading

0 comments on commit 2eaeb17

Please sign in to comment.