Skip to content

Commit

Permalink
Release 2.1.0
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
JimmyShi22 authored Sep 18, 2019
2 parents 145bc1d + 24580ea commit 1ef3e2d
Show file tree
Hide file tree
Showing 117 changed files with 4,825 additions and 1,309 deletions.
16 changes: 16 additions & 0 deletions .ci/ci_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/dev/tools/build_chain.sh && chmod u+x build_chain.sh
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/dev/tools/ci/download_bin.sh) -b dev -m
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0
./nodes/127.0.0.1/start_all.sh
./nodes/127.0.0.1/fisco-bcos -v
cp nodes/127.0.0.1/sdk/* src/integration-test/resources/
mv src/integration-test/resources/applicationContext-sample.xml src/integration-test/resources/applicationContext.xml
./gradlew verifyGoogleJavaFormat
./gradlew build
./gradlew test
./gradlew integrationTest
56 changes: 56 additions & 0 deletions .ci/ci_check_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -e

scan_code_script="cobra/cobra.py -f json -o /tmp/report.json -t "
ignore_files=(PerformanceOkDSync.java SM2Algorithm.java SM2KeyGenerator.java test)

LOG_ERROR() {
content=${1}
echo -e "\033[31m${content}\033[0m"
}

LOG_INFO() {
content=${1}
echo -e "\033[32m${content}\033[0m"
}

should_ignore()
{
local file=${1}
for ignore in ${ignore_files[*]}; do
if echo ${file} | grep ${ignore} &>/dev/null; then
echo "ignore ${file} ${ignore}"
return 0
fi
done
return 1
}

scan_code()
{
# Redirect output to stderr.
exec 1>&2
for file in $(git diff-index --name-status HEAD^ | awk '{print $2}'); do
if should_ignore ${file}; then continue; fi
if [ ! -f ${file} ];then continue; fi
LOG_INFO "check file ${file}"
python ${scan_code_script} $file
trigger_rules=$(jq -r '.' /tmp/report.json | grep 'trigger_rules' | awk '{print $2}' | sed 's/,//g')
echo "trigger_rules is ${trigger_rules}"
rm /tmp/report.json
if [ ${trigger_rules} -ne 0 ]; then
echo "######### ERROR: Scan code failed, please adjust them before commit"
exit 1
fi
done
}

install_cobra() {
git clone https://github.com/WhaleShark-Team/cobra.git
pip install -r cobra/requirements.txt
cp cobra/config.template cobra/config
}

install_cobra
scan_code
36 changes: 0 additions & 36 deletions .classpath

This file was deleted.

59 changes: 38 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,53 @@ branches:
matrix:
fast_finish: true
include:
- os: linux
dist: xenial
sudo: required
- language: python
python: 3.6
dist: xenial
before_cache:
cache:
before_install:
script: |
bash .ci/ci_check_commit.sh
language: java
jdk:
- openjdk8
- language: java
jdk: openjdk8
os: linux
dist: xenial
sudo: required

- language: java
jdk: openjdk9
os: linux
dist: xenial
sudo: required

- language: java
jdk: openjdk10
os: linux
dist: xenial
sudo: required

- language: java
jdk: openjdk11
os: linux
dist: xenial
sudo: required

# - language: java
# jdk: openjdk11
# os: osx
# before_install:
# - brew install gradle && gradle wrapper

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_install:
- gradle wrapper

script: |
curl -LO https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/build_chain.sh && chmod u+x build_chain.sh
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master/tools/ci/download_bin.sh) -b release-2.0.0
echo "127.0.0.1:4 agency1 1,2,3" > ipconf
./build_chain.sh -e bin/fisco-bcos -f ipconf -p 30300,20200,8545 -v 2.0.0
./nodes/127.0.0.1/start_all.sh
./nodes/127.0.0.1/fisco-bcos -v
cp nodes/127.0.0.1/sdk/* src/integration-test/resources/
mv src/integration-test/resources/applicationContext-sample.xml src/integration-test/resources/applicationContext.xml
./gradlew verifyGoogleJavaFormat
./gradlew build
./gradlew test
./gradlew integrationTest
bash .ci/ci_check.sh
41 changes: 37 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
### v2.1.0

(2019-09-17)

* 增加

1. [合约事件通知](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk.html#id14)
2. 支持[Channel Message v2通信协议](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/design/protocol_description.html#channelmessage-v2)
3. 区块回调接口
4. [增加AMOP认证功能](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/amop_protocol.html#topic)

* 更新

1. 支持手动配置证书名,默认为sdk.crt和sdk.key
2. 发交易时处理立即返回的RPC消息
3. 更新依赖库的版本号
4. 更详细的日志打印

* 修复

1. 修复了ABI空字符串处理的异常问题
2. 修复了发交易blocklimt的异常问题
3. 其它一些bug

* 兼容

1. 兼容Channel Message v1协议
2. 兼容FISCO BCOS 2.1以下的sdk证书名node.crt和node.key

### v2.0.5

(2019-07-10)

更新
* 更新

1. 升级fastjson库至1.2.58
2. 修复AMOP传输字符串bug

Expand All @@ -14,7 +44,8 @@

(2019-07-04)

增加
* 增加

1. 添加交易解析工具

* Compatibility
Expand All @@ -25,12 +56,14 @@

(2019-05-28)

增加
* 增加

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

更新
* 更新

1. 优化日志格式,调整日志输出内容,可以更详细显示交易流程信息。
2. 优化选择节点块高最大的节点发送交易。
3. 支持多群组区块链前置配置。
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@ English / [中文](doc/README_CN.md)
[![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)
[![GitHub All Releases](https://img.shields.io/github/downloads/FISCO-BCOS/web3sdk/total.svg)](https://github.com/FISCO-BCOS/web3sdk)
---

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/).
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).

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

## Features

- Implement [JSON-RPC](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/api.html) of FISCO BCOS.
- Provide [precompiled contracts](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/manual/smart_contract.html#precompiled-contract-development) to manage the blockchain.
- 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.
- Provide [OSCCA-approved cryptography](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/manual/guomi_crypto.html) to send transactions.
- Implement [JSON-RPC](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/api.html) of FISCO BCOS.
- Provide [precompiled contracts](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/smart_contract.html#precompiled-contract-development) to manage the blockchain.
- 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.
- Provide [OSCCA-approved cryptography](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/manual/guomi_crypto.html) to send transactions.

## Compile

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

**Compile web3sdk using the following command**:
Expand Down
45 changes: 37 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:1.7.2'
}
}

plugins {
id 'com.github.sherter.google-java-format' version '0.8'
}

apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'signing'
apply plugin: 'application'
apply plugin: 'org.ajoberstar.grgit'


sourceCompatibility = 1.8
Expand Down Expand Up @@ -35,7 +45,7 @@ verifyGoogleJavaFormat {
exclude '**/temp/*.java'
}

def spring_version="4.3.18.RELEASE"
def spring_version="4.3.25.RELEASE"

List logger = [
'org.slf4j:slf4j-log4j12:1.7.25'
Expand All @@ -51,7 +61,7 @@ List spring =[

List alibaba = [
'com.alibaba:druid:1.0.29',
'com.alibaba:fastjson:1.2.58'
'com.alibaba:fastjson:1.2.60'
]

// In this section you declare the dependencies for your production and test code
Expand All @@ -61,15 +71,15 @@ dependencies {
compile 'org.ethereum:solcJ-all:0.4.25'
compile logger,spring,alibaba
compile 'org.apache.commons:commons-lang3:3.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.9.2'
compile 'io.netty:netty-all:4.1.32.Final'
compile 'io.netty:netty-tcnative:2.0.20.Final'
compile 'io.netty:netty-tcnative:2.0.25.Final'
compile 'io.netty:netty-tcnative-boringssl-static:2.0.20.Final'
compile 'com.google.guava:guava:19.0'
compile 'com.google.guava:guava:28.1-jre'
compile 'commons-configuration:commons-configuration:1.10'
// web3j
compile 'org.apache.httpcomponents:httpclient:4.5.5',
'org.bouncycastle:bcprov-jdk15on:1.54',
'org.bouncycastle:bcprov-jdk15on:1.60',
'com.lambdaworks:scrypt:1.4.0',
'com.squareup:javapoet:1.7.0',
'io.reactivex:rxjava:1.2.4',
Expand All @@ -88,7 +98,7 @@ dependencies {

//archivesBaseName = 'web3sdk'
//group = 'org.fisco-bcos'
//version = '2.0.2'
//version = '2.0.5'

configurations {
integrationTestCompile.extendsFrom testCompile
Expand Down Expand Up @@ -129,6 +139,15 @@ check.dependsOn.remove(test)
check.dependsOn.remove(integrationTest)
check.dependsOn.remove(verifyGoogleJavaFormat)

import org.ajoberstar.grgit.*

def repo = null;
try {
repo = Grgit.open('.')
} catch(Exception e) {
println(" .git directory not exist.");
}

// 1 dist jar
jar {
destinationDir file('dist/apps')
Expand All @@ -137,6 +156,16 @@ jar {
exclude '**/*.properties'
exclude '**/*.crt'
exclude '**/*.key'

manifest {
if(repo != null) {
attributes(["Built-By": System.getProperty("user.name"),
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Git-Branch": repo.branch.getCurrent().getName(),
"Git-Commit": repo.head().getAbbreviatedId(40),
])
}
} from sourceSets.main.output

doLast {

Expand Down
2 changes: 1 addition & 1 deletion doc/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![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)
[![GitHub All Releases](https://img.shields.io/github/downloads/FISCO-BCOS/web3sdk/total.svg)](https://github.com/FISCO-BCOS/web3sdk)
---
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/)
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)


<div align="center">
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading

0 comments on commit 1ef3e2d

Please sign in to comment.