Skip to content

Commit

Permalink
Merge pull request #928 from kyonRay/master
Browse files Browse the repository at this point in the history
<sync>(code): sync code from release-3.8.0
  • Loading branch information
kyonRay authored Sep 6, 2024
2 parents 1c03c93 + 5b3647c commit 81849c7
Show file tree
Hide file tree
Showing 46 changed files with 1,777 additions and 98 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [ published, created, edited ]
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
build:
Expand Down Expand Up @@ -86,7 +87,14 @@ jobs:
distribution: 'zulu'
java-version: '8.0.345'
- name: install CentOS dependencies
run: yum install -y epel-release centos-release-scl wget which git openssl-devel openssl tree
run: |
sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum clean all
yum makecache
yum update -y
yum install -y epel-release centos-release-scl wget which git openssl-devel openssl tree
- name: Set up JDK 1.8.0.345
uses: actions/setup-java@v3
with:
Expand Down
79 changes: 52 additions & 27 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
## v3.8.0
(2024-08-20)

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

- 新增[FISCO BCOS 3.9.0](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v3.9.0) 版本新增的获取合约事件接口,用户可用主动获取的方式自定义查询合约事件、区块事件等,**目前仍是体验版**。详情见:[#920](https://github.com/FISCO-BCOS/java-sdk/pull/920)
- 在Client类中新增获取当前链上所有配置项的接口,用户可以通过该接口获取链上所有配置项的信息。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/922)
- 在配置文件中新增 `enableSsl` 的配置字段,该字段的设置将会覆盖旧的 `disabalSsl` 的设置。原先 `disabalSsl` 的配置字段仍然支持,保持配置文件兼容。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/923)

### 修复

- 修复 `TransactionManager` 在设置`extension`字段时会清除版本号,导致交易哈希计算错误不能上链的问题。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/922)
- 修复在大整数负数编解码场景中ABI和Scale编解码错误的问题。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/925)
- 修复存在重载事件时,ABI编解码错误的问题。
- 修复在使用 `ContractCodec` 类中事件解析时没有解析事件中 `indexed` 值的问题。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/925)
- 修复在 `Contract` 类以及继承类中,订阅事件的接口没有返回订阅ID的问题。详情见:[#922](https://github.com/FISCO-BCOS/java-sdk/pull/925)

### 更新

- 更新 `org.bouncycastle:bcprov-jdk18on` 依赖版本到 `1.78`

## v3.7.0
(2024-03-25)

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -51,7 +76,7 @@

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -105,7 +130,7 @@

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -153,7 +178,7 @@

Please refer to the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -202,7 +227,7 @@ After balancing the workload and benefits, there are still potential issues in t

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -243,7 +268,7 @@ After balancing the workload and benefits, there are still potential issues in t
(2023-06-09)
Please refer to the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -285,7 +310,7 @@ After balancing the workload and benefits, there are still potential issues with

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -342,7 +367,7 @@ After balancing the workload and benefits, there are still potential issues with

Please refer to the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -396,7 +421,7 @@ After balancing the workload and benefits, there are still several scenarios whe

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -434,7 +459,7 @@ After balancing the workload and benefits, there are still several scenarios whe

Please read the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### New

Expand Down Expand Up @@ -468,7 +493,7 @@ Please read the Java SDK v3.x+ documentation:

Please read the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### New

Expand Down Expand Up @@ -504,7 +529,7 @@ Please read the Java SDK v3.x+ documentation:

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand All @@ -521,7 +546,7 @@ Please read the Java SDK v3.x+ documentation:

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 修复

Expand All @@ -537,7 +562,7 @@ Please read the Java SDK v3.x+ documentation:

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -571,7 +596,7 @@ Please read the Java SDK v3.x+ documentation:

Please read the Java SDK v3.x+ documentation:

- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [Chinese User Manual](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### New

Expand Down Expand Up @@ -603,7 +628,7 @@ Please read the Java SDK v3.x+ documentation:

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand All @@ -630,7 +655,7 @@ Please read the Java SDK v3.x+ documentation:
Please read documentation of Java SDK v3.x.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Add

Expand Down Expand Up @@ -658,7 +683,7 @@ Please read documentation of Java SDK v3.x.

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -689,7 +714,7 @@ Please read documentation of Java SDK v3.x.
Please read documentation of Java SDK v3.x.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -720,7 +745,7 @@ Please read documentation of Java SDK v3.x.

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -754,7 +779,7 @@ Please read documentation of Java SDK v3.x.
Please read documentation of Java SDK v3.x.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -789,7 +814,7 @@ Please read documentation of Java SDK v3.x.

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新增

Expand Down Expand Up @@ -823,7 +848,7 @@ Please read documentation of Java SDK v3.x.
Please read documentation of Java SDK v3.x.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Added

Expand Down Expand Up @@ -855,7 +880,7 @@ Please read documentation of Java SDK v3.x.

请阅读Java SDK v3.x+文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 更新

Expand All @@ -880,7 +905,7 @@ Please read documentation of Java SDK v3.x.
Please read documentation of Java SDK v3.x.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### Changed

Expand All @@ -906,7 +931,7 @@ Please read documentation of Java SDK v3.x.

请阅读Java SDK文档:

- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
- [中文用户手册](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### 新特性
Java SDK包含如下几个新特性:
Expand Down Expand Up @@ -936,7 +961,7 @@ Java SDK包含如下几个新特性:
Please read documentation of Java SDK.

* English User Handbook:Working in progress...
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh_CN/latest/docs/develop/sdk/java_sdk/index.html)
* [Chinese User Handbook](https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/sdk/java_sdk/index.html)

### New Features

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ext {
commonsIOVersion = '2.11.0'
commonsLang3Version = '3.12.0'
toml4jVersion = "0.7.2"
bcprovJDK18onVersion = '1.75'
bcprovJDK18onVersion = '1.78'
webankJavaCryptoVersion = "1.0.3"
junitVersion = '4.13.2'
commonsCollections4Version = "4.4"
Expand All @@ -35,7 +35,7 @@ ext {
// integrationTest.mustRunAfter test
allprojects {
group = 'org.fisco-bcos.java-sdk'
version = '3.7.0'
version = '3.8.0-SNAPSHOT'

apply plugin: 'maven-publish'
apply plugin: 'idea'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

Expand Down Expand Up @@ -92,6 +94,16 @@ public void testClient() {
System.out.println(
"New block, group: " + groupId + ", blockNumber: " + blockNumber));

Map<String, Optional<SystemConfig>> systemConfigList = client.getSystemConfigList();
systemConfigList.forEach(
(key, value) ->
System.out.println(
key
+ " : "
+ (value.isPresent()
? value.get().getSystemConfig()
: "null")));

// test getBlockNumber
BlockNumber blockNumber = client.getBlockNumber();
Assert.assertTrue(blockNumber.getBlockNumber().compareTo(BigInteger.ZERO) >= 0);
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/org/fisco/bcos/sdk/v3/BcosSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.fisco.bcos.sdk.v3.config.ConfigOption;
import org.fisco.bcos.sdk.v3.config.exceptions.ConfigException;
import org.fisco.bcos.sdk.v3.eventsub.EventSubscribe;
import org.fisco.bcos.sdk.v3.filter.FilterSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -150,6 +151,38 @@ public EventSubscribe getEventSubscribe(String groupId) throws BcosSDKException
}
}

/**
* Get an event subscribe instance of a specific group
*
* @param client
* @param poolSize the size of scheduledExecutorService
* @return FilterSystem
*/
public FilterSystem getFilterSystem(Client client, int poolSize) throws BcosSDKException {
try {
return new FilterSystem(client, poolSize);
} catch (Exception e) {
throw new BcosSDKException("get filter system failed, e: " + e.getMessage());
}
}

/**
* Get an event subscribe instance of a specific group
*
* @param client
* @param poolSize the size of scheduledExecutorService
* @param pollingInterval The time interval for polling getFilterChange
* @return FilterSystem
*/
public FilterSystem getFilterSystem(Client client, int poolSize, long pollingInterval)
throws BcosSDKException {
try {
return new FilterSystem(client, poolSize, pollingInterval);
} catch (Exception e) {
throw new BcosSDKException("get filter system failed, e: " + e.getMessage());
}
}

/** Stop all module of BcosSDK */
public void stopAll() {}
}
Loading

0 comments on commit 81849c7

Please sign in to comment.