Skip to content

Commit

Permalink
Merge pull request #798 from WeBankBlockchain/lab-dev
Browse files Browse the repository at this point in the history
3.0.0 dev->lab
  • Loading branch information
youwenbusi authored Aug 29, 2022
2 parents 6db5cfd + 98f59fd commit 8718b39
Show file tree
Hide file tree
Showing 107 changed files with 1,529 additions and 1,149 deletions.
17 changes: 17 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@

### v3.0.0(2022-08-24)

**Add**
- 支持FISCO BCOS v3.0.0
- 支持solidity v0.8.11

**Fix**
- 支持基于BFS的CNS

**兼容性**
- 支持FISCO-BCOS v3.0.0 及以上版本
- WeBASE-Node-Manager v3.0.0
- WeBASE-Sign v3.0.0

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


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

**Add**
Expand Down
62 changes: 38 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories {

}

def spring_version="5.2.20.RELEASE"
def spring_version="5.2.22.RELEASE"
List spring =[
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-beans:$spring_version",
Expand All @@ -47,7 +47,9 @@ List spring_boot =[
"org.springframework.boot:spring-boot-autoconfigure:$spring_boot_version",
"org.springframework.boot:spring-boot-configuration-processor:$spring_boot_version",
"org.springframework.boot:spring-boot-starter-data-jpa:$spring_boot_version",
"org.springframework.boot:spring-boot-starter-amqp:$spring_boot_version"
"org.springframework.boot:spring-boot-starter-amqp:$spring_boot_version",
"org.springframework.boot:spring-boot-starter-validation:$spring_boot_version"

]


Expand All @@ -57,7 +59,7 @@ List swagger = [
]


def log4j_version="2.17.1"
def log4j_version="2.18.0"
List logger = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-core:$log4j_version",
Expand All @@ -72,24 +74,14 @@ List jaxb = [
"javax.activation:activation:1.1.1"
]

def jackson_version = "2.13.2"
def jackson_version = "2.13.3"
List jackson = [
"com.fasterxml.jackson.core:jackson-annotations:$jackson_version",
"com.fasterxml.jackson.core:jackson-core:$jackson_version",
// "com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.core:jackson-databind:2.13.2.2",
"com.fasterxml.jackson.core:jackson-databind:$jackson_version",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
]

// cover old version
def tomcat_version = "8.5.56"
List tomcat = [
"org.apache.tomcat.embed:tomcat-embed-core:$tomcat_version",
"org.apache.tomcat.embed:tomcat-embed-el:$tomcat_version",
"org.apache.tomcat.embed:tomcat-embed-websocket:$tomcat_version",
"org.apache.tomcat:tomcat-jdbc:$tomcat_version",
"org.apache.tomcat:tomcat-juli:$tomcat_version"
]

List scaffold = [
'com.webank.webase:solscaffold:1.0.2',
Expand All @@ -98,28 +90,30 @@ List scaffold = [
]

dependencies {
compile spring,spring_boot,swagger,logger,jaxb,jackson,tomcat,scaffold
compile ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.0.0-rc2-bugfix-SNAPSHOT')
// cover
compile 'javax.servlet:javax.servlet-api:4.0.1'
compile spring,spring_boot,swagger,logger,jaxb,jackson,scaffold
compile ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.0.0')
// support guomi/ecdsa same time, support solcJ-0.5.2
compile 'org.fisco-bcos:solcJ:0.4.25-rc1'
compile 'com.h2database:h2:1.4.200'
compile('org.fisco-bcos.code-generator:bcos-code-generator:1.0.0-SNAPSHOT') {
exclude group: "org.fisco-bcos.java-sdk"
exclude group: "org.slf4j"
}
compile 'com.h2database:h2:2.1.214'
annotationProcessor 'org.projectlombok:lombok:1.18.6'
compile 'org.projectlombok:lombok:1.18.6'
compile 'com.github.jsqlparser:jsqlparser:2.0'
compile 'org.apache.commons:commons-lang3:3.8.1'
compile 'org.apache.commons:commons-configuration2:2.8.0'

// cover low version
compile 'org.slf4j:jcl-over-slf4j:1.7.30'
compile 'com.google.guava:guava:29.0-jre'
compile 'com.google.guava:guava:30.0-jre'
compile 'org.yaml:snakeyaml:1.30'
compile 'javax.validation:validation-api:2.0.1.Final'

testCompile('org.springframework.boot:spring-boot-starter-test') {
testCompile('org.springframework.boot:spring-boot-starter-test:$spring_boot_version') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile 'junit:junit:4.12',
testCompile 'junit:junit:4.13.1',
'org.springframework.boot:spring-boot-starter-test:1.5.9.RELEASE',
'com.github.macdao:moscow:0.1.0',
'com.squareup.okhttp3:okhttp:3.1.2'
Expand Down Expand Up @@ -194,12 +188,16 @@ def downloadJs() {
String solc05gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.5.2-gm.js";
String solc06Path = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.6.10.js";
String solc06gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.6.10-gm.js";
String solc08Path = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.8.11.js";
String solc08gmPath = "src"+ File.separator + "main"+ File.separator + "resources"+ File.separator + "static"+ File.separator + "static"+ File.separator + "js"+ File.separator + "v0.8.11-gm.js";
File solc04 = new File(solc04Path);
File solc04gm = new File(solc04gmPath);
File solc05 = new File(solc05Path);
File solc05gm = new File(solc05gmPath);
File solc06 = new File(solc06Path);
File solc06gm = new File(solc06gmPath);
File solc08 = new File(solc08Path);
File solc08gm = new File(solc08gmPath);
if (!solc04.exists()) {
exec {
ExecSpec execSpec ->
Expand Down Expand Up @@ -248,5 +246,21 @@ def downloadJs() {
"-o", solc06gmPath
}
}
if (!solc08.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.8.11.js",
"-o", solc08Path
}
}
if (!solc08gm.exists()) {
exec {
ExecSpec execSpec ->
executable 'curl'
args '-#L', "https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.8.11-gm.js",
"-o", solc08gmPath
}
}
}

6 changes: 6 additions & 0 deletions get_solc_js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ get_solc_js(){
if [[ ! -f "${STATIC_JS_DIR}/v0.6.10-gm.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.6.10-gm.js -o "${STATIC_JS_DIR}"/v0.6.10-gm.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.8.11.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.8.11.js -o "${STATIC_JS_DIR}"/v0.8.11.js
fi
if [[ ! -f "${STATIC_JS_DIR}/v0.8.11-gm.js" ]]; then
curl -#L https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/download/solidity/wasm/v0.8.11-gm.js -o "${STATIC_JS_DIR}"/v0.8.11-gm.js
fi
fi
}
get_solc_js
Expand Down
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lab-rc2
v3.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,15 @@ public class ConstantCode {
public static final RetCode LIQUID_READ_ABI_BIN_FAILED = RetCode.mark(201640, "Read liquid contract's abi and bin file failed, please check 'liquid' directory in webase-front");

public static final RetCode BUILD_NEW_EVENT_SUBSCRIBE_FAILED = RetCode.mark(201665, "Build eventSubscribe instance of new group failed");
public static final RetCode ENCODE_TX_JNI_ERROR = RetCode.mark(201666, "Encode transaction in jni failed");

/* permission */
public static final RetCode EXEC_ENV_IS_WASM = RetCode.mark(201670, "exec env is wasm, don't support");
public static final RetCode MUST_BE_GOVERNOR = RetCode.mark(201671, "the account must be the governor.");
public static final RetCode MUST_BE_PROPOSER = RetCode.mark(201672, "the account must be the proposer of proposal.");
public static final RetCode OPEN_TABLE_FAILED = RetCode.mark(201673,"Open table failed, please check the existence of the table");
public static final RetCode NOT_SET_METHOD_AUTH_TYPE = RetCode.mark(201674,"The contract method auth type not set, please set method auth type first.");
public static final RetCode CHAIN_AUTH_NOT_ENABLE = RetCode.mark(201675, "auth of the chain not enable");

/* bfs path */
public static final RetCode BFS_INVALID_PATH = RetCode.mark(201680, "the PATH is invalid.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.webank.webase.front.base.config;

import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.v3.crypto.CryptoSuite;
import org.fisco.bcos.sdk.v3.model.CryptoType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand Down
18 changes: 6 additions & 12 deletions src/main/java/com/webank/webase/front/base/config/Web3Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@
*/
package com.webank.webase.front.base.config;


import com.webank.webase.front.configapi.ConfigService;
import com.webank.webase.front.util.JsonUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.fisco.bcos.sdk.BcosSDK;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.config.ConfigOption;
import org.fisco.bcos.sdk.config.exceptions.ConfigException;
import org.fisco.bcos.sdk.config.model.ConfigProperty;
import org.fisco.bcos.sdk.eventsub.EventSubscribe;
import org.fisco.bcos.sdk.jni.common.JniException;
import org.springframework.beans.factory.annotation.Autowired;
import org.fisco.bcos.sdk.v3.BcosSDK;
import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.config.ConfigOption;
import org.fisco.bcos.sdk.v3.config.exceptions.ConfigException;
import org.fisco.bcos.sdk.v3.config.model.ConfigProperty;
import org.fisco.bcos.sdk.v3.eventsub.EventSubscribe;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -41,9 +38,6 @@
@Configuration
@ConfigurationProperties(prefix = "sdk")
public class Web3Config {
// @Autowired
// private ConfigService configService;
// private boolean loadFromDb;

private String threadPoolSize;
private String certPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.webank.webase.front.base.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
* web 配置类
*/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {


/**
* 静态资源映射
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {

// 前端目录
registry.addResourceHandler(
"/static/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;
import org.springframework.beans.TypeMismatchException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
import java.util.Optional;
import java.util.Stack;
import lombok.extern.slf4j.Slf4j;
import org.fisco.bcos.sdk.BcosSDK;
import org.fisco.bcos.sdk.config.ConfigOption;
import org.fisco.bcos.sdk.config.model.CryptoMaterialConfig;
import org.fisco.bcos.sdk.config.model.NetworkConfig;
import org.fisco.bcos.sdk.config.model.ThreadPoolConfig;
import org.fisco.bcos.sdk.v3.BcosSDK;
import org.fisco.bcos.sdk.v3.config.ConfigOption;
import org.fisco.bcos.sdk.v3.config.model.CryptoMaterialConfig;
import org.fisco.bcos.sdk.v3.config.model.NetworkConfig;
import org.fisco.bcos.sdk.v3.config.model.ThreadPoolConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@Data
@Entity
@Table(uniqueConstraints = {
@UniqueConstraint(name = "unique_config", columnNames = {"type","key"})
@UniqueConstraint(name = "unique_config", columnNames = {"type","config_key"})
})
@NoArgsConstructor
@AllArgsConstructor
Expand All @@ -48,11 +48,12 @@ public class ConfigInfo {
/**
* example: key is "peers"
*/
@Column(name = "config_key")
private String key;
/**
* example: value is ["127.0.0.1:20200"]
*/
@Column(columnDefinition = "text")
@Column(name = "config_value", columnDefinition = "text")
private String value;
private Integer version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
package com.webank.webase.front.contract;

import java.util.List;
import org.fisco.bcos.sdk.codec.datatypes.Function;
import org.fisco.bcos.sdk.codec.datatypes.Type;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;
import org.fisco.bcos.sdk.v3.codec.datatypes.Function;
import org.fisco.bcos.sdk.v3.codec.datatypes.Type;
import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.contract.Contract;
import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.v3.model.TransactionReceipt;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;


/**
Expand Down
Loading

0 comments on commit 8718b39

Please sign in to comment.