Skip to content

Commit 1ef3e2d

Browse files
authored
Release 2.1.0
Release 2.1.0
2 parents 145bc1d + 24580ea commit 1ef3e2d

File tree

117 files changed

+4825
-1309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4825
-1309
lines changed

.ci/ci_check.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/dev/tools/build_chain.sh && chmod u+x build_chain.sh
6+
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/dev/tools/ci/download_bin.sh) -b dev -m
7+
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
8+
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0
9+
./nodes/127.0.0.1/start_all.sh
10+
./nodes/127.0.0.1/fisco-bcos -v
11+
cp nodes/127.0.0.1/sdk/* src/integration-test/resources/
12+
mv src/integration-test/resources/applicationContext-sample.xml src/integration-test/resources/applicationContext.xml
13+
./gradlew verifyGoogleJavaFormat
14+
./gradlew build
15+
./gradlew test
16+
./gradlew integrationTest

.ci/ci_check_commit.sh

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
scan_code_script="cobra/cobra.py -f json -o /tmp/report.json -t "
6+
ignore_files=(PerformanceOkDSync.java SM2Algorithm.java SM2KeyGenerator.java test)
7+
8+
LOG_ERROR() {
9+
content=${1}
10+
echo -e "\033[31m${content}\033[0m"
11+
}
12+
13+
LOG_INFO() {
14+
content=${1}
15+
echo -e "\033[32m${content}\033[0m"
16+
}
17+
18+
should_ignore()
19+
{
20+
local file=${1}
21+
for ignore in ${ignore_files[*]}; do
22+
if echo ${file} | grep ${ignore} &>/dev/null; then
23+
echo "ignore ${file} ${ignore}"
24+
return 0
25+
fi
26+
done
27+
return 1
28+
}
29+
30+
scan_code()
31+
{
32+
# Redirect output to stderr.
33+
exec 1>&2
34+
for file in $(git diff-index --name-status HEAD^ | awk '{print $2}'); do
35+
if should_ignore ${file}; then continue; fi
36+
if [ ! -f ${file} ];then continue; fi
37+
LOG_INFO "check file ${file}"
38+
python ${scan_code_script} $file
39+
trigger_rules=$(jq -r '.' /tmp/report.json | grep 'trigger_rules' | awk '{print $2}' | sed 's/,//g')
40+
echo "trigger_rules is ${trigger_rules}"
41+
rm /tmp/report.json
42+
if [ ${trigger_rules} -ne 0 ]; then
43+
echo "######### ERROR: Scan code failed, please adjust them before commit"
44+
exit 1
45+
fi
46+
done
47+
}
48+
49+
install_cobra() {
50+
git clone https://github.com/WhaleShark-Team/cobra.git
51+
pip install -r cobra/requirements.txt
52+
cp cobra/config.template cobra/config
53+
}
54+
55+
install_cobra
56+
scan_code

.classpath

-36
This file was deleted.

.travis.yml

+38-21
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,53 @@ branches:
66
matrix:
77
fast_finish: true
88
include:
9-
- os: linux
10-
dist: xenial
11-
sudo: required
9+
- language: python
10+
python: 3.6
11+
dist: xenial
12+
before_cache:
13+
cache:
14+
before_install:
15+
script: |
16+
bash .ci/ci_check_commit.sh
1217
13-
language: java
14-
jdk:
15-
- openjdk8
18+
- language: java
19+
jdk: openjdk8
20+
os: linux
21+
dist: xenial
22+
sudo: required
23+
24+
- language: java
25+
jdk: openjdk9
26+
os: linux
27+
dist: xenial
28+
sudo: required
29+
30+
- language: java
31+
jdk: openjdk10
32+
os: linux
33+
dist: xenial
34+
sudo: required
35+
36+
- language: java
37+
jdk: openjdk11
38+
os: linux
39+
dist: xenial
40+
sudo: required
41+
42+
# - language: java
43+
# jdk: openjdk11
44+
# os: osx
45+
# before_install:
46+
# - brew install gradle && gradle wrapper
1647

1748
before_cache:
1849
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1950
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
20-
2151
cache:
2252
directories:
2353
- $HOME/.gradle/caches/
2454
- $HOME/.gradle/wrapper/
25-
2655
before_install:
2756
- gradle wrapper
28-
2957
script: |
30-
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/build_chain.sh && chmod u+x build_chain.sh
31-
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) -b release-2.0.0
32-
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
33-
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0
34-
./nodes/127.0.0.1/start_all.sh
35-
./nodes/127.0.0.1/fisco-bcos -v
36-
cp nodes/127.0.0.1/sdk/* src/integration-test/resources/
37-
mv src/integration-test/resources/applicationContext-sample.xml src/integration-test/resources/applicationContext.xml
38-
./gradlew verifyGoogleJavaFormat
39-
./gradlew build
40-
./gradlew test
41-
./gradlew integrationTest
58+
bash .ci/ci_check.sh

Changelog.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1+
### v2.1.0
2+
3+
(2019-09-17)
4+
5+
* 增加
6+
7+
1. [合约事件通知](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk.html#id14)
8+
2. 支持[Channel Message v2通信协议](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/design/protocol_description.html#channelmessage-v2)
9+
3. 区块回调接口
10+
4. [增加AMOP认证功能](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/amop_protocol.html#topic)
11+
12+
* 更新
13+
14+
1. 支持手动配置证书名,默认为sdk.crt和sdk.key
15+
2. 发交易时处理立即返回的RPC消息
16+
3. 更新依赖库的版本号
17+
4. 更详细的日志打印
18+
19+
* 修复
20+
21+
1. 修复了ABI空字符串处理的异常问题
22+
2. 修复了发交易blocklimt的异常问题
23+
3. 其它一些bug
24+
25+
* 兼容
26+
27+
1. 兼容Channel Message v1协议
28+
2. 兼容FISCO BCOS 2.1以下的sdk证书名node.crt和node.key
29+
130
### v2.0.5
231

332
(2019-07-10)
433

5-
更新
34+
* 更新
35+
636
1. 升级fastjson库至1.2.58
737
2. 修复AMOP传输字符串bug
838

@@ -14,7 +44,8 @@
1444

1545
(2019-07-04)
1646

17-
增加
47+
* 增加
48+
1849
1. 添加交易解析工具
1950

2051
* Compatibility
@@ -25,12 +56,14 @@
2556

2657
(2019-05-28)
2758

28-
增加
59+
* 增加
60+
2961
1. 提供CRUDService类,包含操作用户表的CRUD接口。
3062
2. 提供加载账号文件的工具管理类PEMManager和P12Manager,可以分别加载PEM格式和PKCS12格式的账戶文件。
3163
3. 增加集成测试,覆盖web3j api和precompile api。
3264

33-
更新
65+
* 更新
66+
3467
1. 优化日志格式,调整日志输出内容,可以更详细显示交易流程信息。
3568
2. 优化选择节点块高最大的节点发送交易。
3669
3. 支持多群组区块链前置配置。

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,23 @@ English / [中文](doc/README_CN.md)
1010
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)
1111
[![GitHub All Releases](https://img.shields.io/github/downloads/FISCO-BCOS/web3sdk/total.svg)](https://github.com/FISCO-BCOS/web3sdk)
1212
---
13-
14-
Web3SDK provides the Java API for [FISCO-BCOS](https://github.com/FISCO-BCOS/FISCO-BCOS). You can easily and quickly develop your blockchain applications based on the Web3SDK. **The version only supports** [FISCO BCOS 2.0](https://fisco-bcos-documentation.readthedocs.io/en/latest/).
13+
Web3SDK provides the Java API for [FISCO-BCOS](https://github.com/FISCO-BCOS/FISCO-BCOS/tree/master). You can easily and quickly develop your blockchain applications based on the Web3SDK. **The version only supports** [FISCO BCOS 2.0+](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/introduction.html).
1514

1615
<div align="center">
1716
<img src="./images/sdk.png" width = "600" height = "420"/>
1817
</div>
1918

2019
## Features
2120

22-
- Implement [JSON-RPC](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/api.html) of FISCO BCOS.
23-
- Provide [precompiled contracts](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/manual/smart_contract.html#precompiled-contract-development) to manage the blockchain.
24-
- Implement [AMOP](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/manual/amop_protocol.html)(Advanced Messages Onchain Protocol) to provide a secure and efficient message channel for the consortium blockchain.
25-
- Provide [OSCCA-approved cryptography](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/manual/guomi_crypto.html) to send transactions.
21+
- Implement [JSON-RPC](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/api.html) of FISCO BCOS.
22+
- Provide [precompiled contracts](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/smart_contract.html#precompiled-contract-development) to manage the blockchain.
23+
- Implement [AMOP](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/amop_protocol.html)(Advanced Messages Onchain Protocol) to provide a secure and efficient message channel for the consortium blockchain.
24+
- Provide [OSCCA-approved cryptography](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/guomi_crypto.html) to send transactions.
2625

2726
## Compile
2827

2928
**Environmental requirements**:
30-
- [JDK8 or above](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/sdk/sdk.html#environment-requirements)
29+
- [JDK8 or above](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/sdk.html#environment-requirements)
3130
- Gradle 5.0 or above
3231

3332
**Compile web3sdk using the following command**:

build.gradle

+37-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'org.ajoberstar:gradle-git:1.7.2'
7+
}
8+
}
9+
110
plugins {
211
id 'com.github.sherter.google-java-format' version '0.8'
312
}
4-
13+
514
apply plugin: 'maven'
615
apply plugin: 'idea'
716
apply plugin: 'java'
817
apply plugin: 'eclipse'
918
apply plugin: 'signing'
1019
apply plugin: 'application'
20+
apply plugin: 'org.ajoberstar.grgit'
1121

1222

1323
sourceCompatibility = 1.8
@@ -35,7 +45,7 @@ verifyGoogleJavaFormat {
3545
exclude '**/temp/*.java'
3646
}
3747

38-
def spring_version="4.3.18.RELEASE"
48+
def spring_version="4.3.25.RELEASE"
3949

4050
List logger = [
4151
'org.slf4j:slf4j-log4j12:1.7.25'
@@ -51,7 +61,7 @@ List spring =[
5161

5262
List alibaba = [
5363
'com.alibaba:druid:1.0.29',
54-
'com.alibaba:fastjson:1.2.58'
64+
'com.alibaba:fastjson:1.2.60'
5565
]
5666

5767
// In this section you declare the dependencies for your production and test code
@@ -61,15 +71,15 @@ dependencies {
6171
compile 'org.ethereum:solcJ-all:0.4.25'
6272
compile logger,spring,alibaba
6373
compile 'org.apache.commons:commons-lang3:3.1'
64-
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
74+
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.9.2'
6575
compile 'io.netty:netty-all:4.1.32.Final'
66-
compile 'io.netty:netty-tcnative:2.0.20.Final'
76+
compile 'io.netty:netty-tcnative:2.0.25.Final'
6777
compile 'io.netty:netty-tcnative-boringssl-static:2.0.20.Final'
68-
compile 'com.google.guava:guava:19.0'
78+
compile 'com.google.guava:guava:28.1-jre'
6979
compile 'commons-configuration:commons-configuration:1.10'
7080
// web3j
7181
compile 'org.apache.httpcomponents:httpclient:4.5.5',
72-
'org.bouncycastle:bcprov-jdk15on:1.54',
82+
'org.bouncycastle:bcprov-jdk15on:1.60',
7383
'com.lambdaworks:scrypt:1.4.0',
7484
'com.squareup:javapoet:1.7.0',
7585
'io.reactivex:rxjava:1.2.4',
@@ -88,7 +98,7 @@ dependencies {
8898

8999
//archivesBaseName = 'web3sdk'
90100
//group = 'org.fisco-bcos'
91-
//version = '2.0.2'
101+
//version = '2.0.5'
92102

93103
configurations {
94104
integrationTestCompile.extendsFrom testCompile
@@ -129,6 +139,15 @@ check.dependsOn.remove(test)
129139
check.dependsOn.remove(integrationTest)
130140
check.dependsOn.remove(verifyGoogleJavaFormat)
131141

142+
import org.ajoberstar.grgit.*
143+
144+
def repo = null;
145+
try {
146+
repo = Grgit.open('.')
147+
} catch(Exception e) {
148+
println(" .git directory not exist.");
149+
}
150+
132151
// 1 dist jar
133152
jar {
134153
destinationDir file('dist/apps')
@@ -137,6 +156,16 @@ jar {
137156
exclude '**/*.properties'
138157
exclude '**/*.crt'
139158
exclude '**/*.key'
159+
160+
manifest {
161+
if(repo != null) {
162+
attributes(["Built-By": System.getProperty("user.name"),
163+
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
164+
"Git-Branch": repo.branch.getCurrent().getName(),
165+
"Git-Commit": repo.head().getAbbreviatedId(40),
166+
])
167+
}
168+
} from sourceSets.main.output
140169

141170
doLast {
142171

doc/README_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a2a6c2eb499e42739d066ff775d1b288)](https://www.codacy.com/app/fisco/console?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=FISCO-BCOS/console&amp;utm_campaign=Badge_Grade)
1111
[![GitHub All Releases](https://img.shields.io/github/downloads/FISCO-BCOS/web3sdk/total.svg)](https://github.com/FISCO-BCOS/web3sdk)
1212
---
13-
Web3SDK为[FISCO BCOS](https://github.com/FISCO-BCOS/FISCO-BCOS/tree/master)提供Java API。利用FISCO BCOS JAVA SDK可以简单快捷的基于FISCO-BCOS进行区块链应用开发。**此版本只支持**[FISCO BCOS 2.0](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/)
13+
Web3SDK为[FISCO BCOS](https://github.com/FISCO-BCOS/FISCO-BCOS/tree/master)提供Java API。利用FISCO BCOS JAVA SDK可以简单快捷的基于FISCO-BCOS进行区块链应用开发。**此版本只支持**[FISCO BCOS 2.0+](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/introduction.html)
1414

1515

1616
<div align="center">

gradle/wrapper/gradle-wrapper.jar

885 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)