Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
48050c7
submit initial version
MaggieNgWu Jun 2, 2020
cdb1d35
Add java-sdk compilation related dependencies, add ci (#3)
cyjseagull Jul 10, 2020
1fd62be
Define interfaces of Network, Channel, Client, AMOP and EventSubscrib…
MaggieNgWu Jul 13, 2020
7afea9d
Add basic dependency function of java-sdk (#5)
cyjseagull Jul 14, 2020
efe1b5a
add and implement crypto-interfaces (#11)
cyjseagull Jul 15, 2020
1b2faf3
Read yaml config file. (#12)
MaggieNgWu Jul 16, 2020
ae85445
add CryptoInterface to init and implement basic crypto functions by g…
cyjseagull Jul 16, 2020
9b8ed51
Supplement the remaining functions of the crypto module: (#15)
cyjseagull Jul 17, 2020
883fdde
Init network module, manage connections with peers. (#14)
MaggieNgWu Jul 20, 2020
0c1a81f
add interfaces of tx module (#17)
dalaocu Jul 20, 2020
362f69b
add synchronous sending interface (#18)
cyjseagull Jul 20, 2020
9e39429
implement Client interface && add ut for Message (#19)
cyjseagull Jul 21, 2020
1ed3e4b
channel implement (#23)
chaychen2005 Jul 22, 2020
5c3b983
Supplement the implementation of response (#20)
cyjseagull Jul 22, 2020
199d03e
encapsulation of MsgHandler in channel (#24)
chaychen2005 Jul 22, 2020
d033c76
Add circle ci and github action (#25)
cyjseagull Jul 22, 2020
878fe13
test network connection (#21)
MaggieNgWu Jul 23, 2020
3507353
add TransactionReceipt & RawTransaction (#22)
dalaocu Jul 23, 2020
21c0b4b
1. add groupManager related interfaces (#26)
cyjseagull Jul 23, 2020
203aebf
query node version and heartbeat in channel (#28)
chaychen2005 Jul 24, 2020
5364a9e
add event subscribe module and implement subscribe function (#27)
MaggieNgWu Jul 24, 2020
71b3800
add timeout (#29)
chaychen2005 Jul 27, 2020
f821320
Add an interface for user to set a proper msg handle thread pool (#31)
MaggieNgWu Jul 28, 2020
f979aaf
implement GroupServiceManager (#30)
cyjseagull Jul 28, 2020
b14d755
fix channel bug (#32)
chaychen2005 Jul 28, 2020
6378e9c
check connections in channel (#34)
chaychen2005 Jul 29, 2020
b72845d
add integrations for client and groupServiceManager (#33)
cyjseagull Jul 29, 2020
2214a6e
add abi definition from web3sdk (#36)
chaychen2005 Jul 30, 2020
5985346
add abi UT (#38)
chaychen2005 Jul 30, 2020
70b0a7e
add amop module interface (#35)
MaggieNgWu Jul 31, 2020
ed014b9
The client module add handlers to handle block number notify and tran…
cyjseagull Jul 31, 2020
48d445e
Tx module impl (#41)
dalaocu Aug 4, 2020
445ebfd
implement code generator (#37)
cyjseagull Aug 4, 2020
79a603f
java object to abi object (#42)
chaychen2005 Aug 4, 2020
5fe1fb8
update TransactionManager && modify receipt waiting logic (#43)
cyjseagull Aug 4, 2020
829ccdc
add timeout to TransactionSucCallback && add ci for gm (#46)
cyjseagull Aug 5, 2020
ec55160
Dev Tx module (#45)
dalaocu Aug 5, 2020
86749df
add timeout logic in channel synchronize interface (#49)
chaychen2005 Aug 6, 2020
8537891
add TransactionReceiptStatus and basic dependency of precompiled (#48)
cyjseagull Aug 6, 2020
c07be68
Optimize exceptioned txs response && implement precompiled service (#50)
cyjseagull Aug 7, 2020
8d894f9
fix abi bug (#51)
chaychen2005 Aug 7, 2020
b1418ef
implement crudService/contractLifeCycle and permissionService (#52)
cyjseagull Aug 11, 2020
ce68360
add crypto-interfaces for AMOP topic verify (#53)
cyjseagull Aug 11, 2020
2a134d8
Support pulling cryptoType from node (#54)
cyjseagull Aug 11, 2020
3c05fac
AMOP module add topic manager and block notify subscription. (#47)
MaggieNgWu Aug 11, 2020
9236174
add async interface for crudService(insert/update/remove) (#55)
cyjseagull Aug 11, 2020
14741ff
fix handshake failed when using jdk14 && fix block number notificatio…
cyjseagull Aug 12, 2020
e9eff89
Fix the warning caused by multiple threads sharing a callback when ut…
cyjseagull Aug 13, 2020
a54591b
Modify TransactionSucCallback to TransactionCallback (#59)
cyjseagull Aug 13, 2020
79a1dd2
Once the GroupManagerService gets the group list, and actively pulls …
cyjseagull Aug 13, 2020
f61627c
suplement account related functions (#62)
cyjseagull Aug 17, 2020
c1db99c
Add thread pool configuration && add performanceOk (#63)
cyjseagull Aug 17, 2020
e963c08
Transaction Manager modify (#57)
dalaocu Aug 17, 2020
ec51675
fix event subscribe (#65)
chaychen2005 Aug 18, 2020
41e0349
assemble tx tests (#66)
dalaocu Aug 18, 2020
1dcc369
unsubscribe event (#67)
chaychen2005 Aug 19, 2020
11f7201
add sdk publishing config && add stopAll interface to stop the BcosSD…
cyjseagull Aug 19, 2020
deff7cd
add methodId before encode data in abi module (#68)
chaychen2005 Aug 19, 2020
b27a02b
parse receipt when the status is not 0x0 && Fix the problem of stuck …
cyjseagull Aug 20, 2020
c8bd969
try to get the ssl crypto type when init the connection (#70)
cyjseagull Aug 24, 2020
751d14e
1. modify receipt parser & call parser (#72)
dalaocu Aug 25, 2020
59c3b49
Supplemental performance test demo (#71)
cyjseagull Aug 25, 2020
456096b
fix CNSservice parse exception (#74)
cyjseagull Aug 31, 2020
850b348
add interface of sendTransactionWithStringParamsAndGetResponse (#73)
dalaocu Aug 31, 2020
55512d9
add interface of call & deploy with string params list (#77)
dalaocu Aug 31, 2020
70e7b5c
Modify receipt status parser and account load (#76)
cyjseagull Aug 31, 2020
55250a7
test event push (#75)
chaychen2005 Sep 1, 2020
e83e95f
modify configuration parser && fix abi decode bug (#78)
cyjseagull Sep 1, 2020
6962be4
fix config parser and receipt parser, fix the reconnect logic (#79)
cyjseagull Sep 2, 2020
0bbe3a2
1. add amop private topic verify procedure (#61)
MaggieNgWu Sep 2, 2020
bca2be0
show more detailed description when connect with the node failed (#80)
cyjseagull Sep 2, 2020
7b13850
add amop test tools (#81)
MaggieNgWu Sep 3, 2020
672b487
add amop tools, all tools finished (#83)
MaggieNgWu Sep 3, 2020
5c48871
fix groupManagerService peer selection bug (#82)
cyjseagull Sep 3, 2020
4e6d7ee
supplement performance test && Adjust the code according to code revi…
cyjseagull Sep 7, 2020
a5c0d2a
setTransactionReceipt to RetCode && support cryptoKeyPair dynamic swi…
cyjseagull Sep 7, 2020
ff89dfa
solve amop no config bug, rename setupPrivateTopic to publishPrivateT…
MaggieNgWu Sep 8, 2020
f466e6f
update event subcribe test (#86)
chaychen2005 Sep 8, 2020
3041f4d
Modify java-sdk to support the crypto requirements (#88)
cyjseagull Sep 9, 2020
35b9bae
fix removeNode logic && throw TransactionBaseException without decode…
cyjseagull Sep 10, 2020
03a14b4
fix parallelokDemo (#92)
cyjseagull Sep 10, 2020
0da0851
fix description of PrecompiledRetCode (#94)
cyjseagull Sep 11, 2020
1eaba24
Fix the problem that the verification of go-sdk and java-sdk randomVa…
cyjseagull Sep 14, 2020
71dbf40
give amop test config file and key files. (#90)
MaggieNgWu Sep 14, 2020
3a13c44
fix codegen bug && add performanceRPC (#96)
cyjseagull Sep 14, 2020
6d26a0e
refactor code to remove module-dependency (#97)
cyjseagull Sep 15, 2020
9cca9eb
Fix the node selection problem, so that group-related requests fall e…
cyjseagull Sep 15, 2020
48bd6cf
provide unique event handler (#99)
chaychen2005 Sep 16, 2020
4fb9e03
support init BcosSDK with xml configuration files (#101)
cyjseagull Sep 16, 2020
5e589e5
fix ABIDefinition.isConstant bug when using solc 0.6.10 (#103)
cyjseagull Sep 16, 2020
d7ac976
throw exceptions when not found abi or bin files (#102)
dalaocu Sep 16, 2020
9b2c9dd
Fix the unclear prompts (#104)
cyjseagull Sep 17, 2020
46b9d31
add blocknum check in event (#105)
chaychen2005 Sep 17, 2020
1da1322
add tx decoder test cases (#106)
dalaocu Sep 17, 2020
5dfeece
fix event bug (#108)
chaychen2005 Sep 17, 2020
322bbb2
remove table_name field from the desc result (#107)
cyjseagull Sep 17, 2020
f325a35
Update src/test/resources/config-example.toml (#110)
JianM95 Sep 18, 2020
6f1d5c6
fix amop bug (#111)
MaggieNgWu Sep 18, 2020
634a399
modify description of config-example.toml (#109)
cyjseagull Sep 21, 2020
3d67fbc
delete interfaces of encode event (#112)
chaychen2005 Sep 21, 2020
46a89d4
Separately define the encryption type in CryptoType to support jar pa…
cyjseagull Sep 21, 2020
4caf563
refactor for jar package split
cyjseagull Sep 22, 2020
1a976aa
fix channel bug (#121)
chaychen2005 Sep 22, 2020
d18c2a8
Add amop demo timeout config args. (#120)
MaggieNgWu Sep 23, 2020
c9489e7
separate java-sdk into sdk-core, sdk-abi, sdk-crypto, sdk-amop, sdk-s…
cyjseagull Sep 22, 2020
6c32acd
refactor code according to reviews (#122)
cyjseagull Sep 23, 2020
37f7af1
rename KeyManager to KeyTool (#123)
cyjseagull Sep 23, 2020
9693450
rename TransactionManager to TransactionProcessor (#124)
cyjseagull Sep 23, 2020
bc8958d
rename CryptoInterface to CryptoSuite (#125)
cyjseagull Sep 23, 2020
b545a50
fix java doc build warning and error (#127)
cyjseagull Sep 23, 2020
dfd0962
add subproject publish script (#129)
cyjseagull Sep 24, 2020
8abe96e
disable github-action triggered by git-push (#118)
cyjseagull Sep 24, 2020
02c6863
catch ArrayIndexOutOfBoundsException caused by concurrrent modify nod…
cyjseagull Sep 24, 2020
d7a441e
update src/test/resources/config-example.toml (#133)
JianM95 Sep 24, 2020
1919c90
fix all annotation warning during gradle build (#135)
JianM95 Sep 24, 2020
bb0cf25
modify build.gradle (#136)
cyjseagull Sep 24, 2020
66b5338
add decode event with indexed params (#130)
chaychen2005 Sep 24, 2020
352e7ad
solve amop bug (#137)
MaggieNgWu Sep 25, 2020
8f2bece
rename client interfaces (#138)
MaggieNgWu Sep 27, 2020
be6240a
stop event in bcosSDK (#139)
chaychen2005 Sep 27, 2020
1f46228
sync code, solve conflict
Oct 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
128 changes: 128 additions & 0 deletions .ci/ci_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/bin/bash

set -e
LOG_INFO() {
local content=${1}
echo -e "\033[32m ${content}\033[0m"
}
check_basic()
{
# check code format
bash gradlew verifyGoogleJavaFormat
# build
bash gradlew build --info
}

download_tassl()
{
mkdir -p ~/.fisco/
if [ "$(uname)" == "Darwin" ];then
curl -LO https://github.com/FISCO-BCOS/LargeFiles/raw/master/tools/tassl_mac.tar.gz
mv tassl_mac.tar.gz ~/.fisco/tassl.tar.gz
else
curl -LO https://github.com/FISCO-BCOS/LargeFiles/raw/master/tools/tassl.tar.gz
mv tassl.tar.gz ~/.fisco/tassl.tar.gz
fi
tar -xvf ~/.fisco/tassl.tar.gz
}

download_build_chain()
{
tag=$(curl -sS "https://gitee.com/api/v5/repos/FISCO-BCOS/FISCO-BCOS/tags" | grep -oe "\"name\":\"v[2-9]*\.[0-9]*\.[0-9]*\"" | cut -d \" -f 4 | sort -V | tail -n 1)
LOG_INFO "--- current tag: $tag"
curl -LO "https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/${tag}/build_chain.sh" && chmod u+x build_chain.sh
}

get_sed_cmd()
{
local sed_cmd="sed -i"
if [ "$(uname)" == "Darwin" ];then
sed_cmd="sed -i .bkp"
fi
echo "$sed_cmd"
}

prepare_environment()
{
## prepare resources for integration test
mkdir -p src/integration-test/resources/
mkdir -p conf
cp -r nodes/127.0.0.1/sdk/* conf
cp src/test/resources/config-example.toml src/integration-test/resources/config.toml
cp src/test/resources/config-example.toml src/test/resources/config.toml
cp src/test/resources/log4j.properties src/integration-test/resources/
cp -r src/test/resources/amop conf/amop
cp -r src/test/resources/amop src/integration-test/resources/amop
rm -rf src/integration-test/resources/abi
rm -rf src/integration-test/resources/bin
cp -r src/test/resources/ecdsa/abi src/integration-test/resources/abi
cp -r src/test/resources/ecdsa/bin src/integration-test/resources/bin
mkdir -p sdk-amop/src/test/resources
cp -r src/test/resources/ sdk-amop/src/test/resources

sed_cmd=$(get_sed_cmd)

local node_type="${1}"
if [ "${node_type}" == "sm" ];then
rm -rf src/integration-test/resources/abi
rm -rf src/integration-test/resources/bin
cp -r src/test/resources/gm/abi src/integration-test/resources/abi
cp -r src/test/resources/gm/bin src/integration-test/resources/bin
fi
}

build_node()
{
local node_type="${1}"
if [ "${node_type}" == "sm" ];then
./build_chain.sh -l 127.0.0.1:4 -g
sed_cmd=$(get_sed_cmd)
$sed_cmd 's/sm_crypto_channel=false/sm_crypto_channel=true/g' nodes/127.0.0.1/node*/config.ini
else
./build_chain.sh -l 127.0.0.1:4
fi
./nodes/127.0.0.1/fisco-bcos -v
./nodes/127.0.0.1/start_all.sh
}

clean_node()
{
bash nodes/127.0.0.1/stop_all.sh
rm -rf nodes
}

# check integration-test for non-gm node
check_standard_node()
{
build_node
prepare_environment
## run integration test
bash gradlew clean integrationTest --info
## clean
clean_node
}

check_sm_node()
{
build_node "sm"
prepare_environment "sm"
## run integration test
bash gradlew clean integrationTest --info
## clean
clean_node
}
LOG_INFO "------ download_tassl---------"
download_tassl
LOG_INFO "------ check_basic---------"
./gradlew build -x test
LOG_INFO "------ download_build_chain---------"
download_build_chain
LOG_INFO "------ check_standard_node---------"
check_standard_node
LOG_INFO "------ check_sm_node---------"
check_sm_node
LOG_INFO "------ check_basic---------"
check_basic
#LOG_INFO "------ check_log---------"
#cat log/* |grep -i error
#cat log/* |grep -i warn
75 changes: 75 additions & 0 deletions .ci/ci_check_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

set -e

scan_code_script="cobra/cobra.py -f json -o /tmp/report.json -t "
ignore_files=(sh crt key json toml SignatureTest.java Ok.java bin abi ChannelTest.java ParallelOkDemo.java PerformanceAmop.java DagPrecompiledDemo.java KeyToolTest.java CryptoSuite.java AmopMsgHandlerTest.java TopicManager.java PrivateTopicVerifyTest.java AmopMsgBuilder.java TopicManagerTest.java AmopSubscribe.java AmopPublisher.java AmopPublisherPrivate.java AmopSubscribePrivate.java AmopPublisherFile.java AmopPublisherPrivateFile.java DemoAmopCallback.java FileToByteArrayHelper.java OkD.java TableTest.java PerformanceTable.java HelloWorld.java PerformanceRPC.java CodecTest.java ResponseTest.java ConfigTest.java)
commit_limit=6

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Double quote to prevent globbing and word splitting. (view)

Rule Severity Code
SC2086 info 2086

References:

You can close this issue if no need to fix it. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Double quote to prevent globbing and word splitting. (view)

Rule Severity Code
SC2086 info 2086

References:

You can close this issue if no need to fix it. Learn more.

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
}

check_commit_message()
{
local commits=$(git rev-list --count HEAD^..HEAD)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Declare and assign separately to avoid masking return values. (view)

Rule Severity Code
SC2155 warning 2155

References:

You can close this issue if no need to fix it. Learn more.

if [ ${commit_limit} -lt ${commits} ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Double quote to prevent globbing and word splitting. (view)

Rule Severity Code
SC2086 info 2086

References:

You can close this issue if no need to fix it. Learn more.

LOG_ERROR "${commits} commits, limit is ${commit_limit}"
exit 1
fi
local unique_commit=$(git log --format=%s HEAD^..HEAD | sort -u | wc -l)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Declare and assign separately to avoid masking return values. (view)

Rule Severity Code
SC2155 warning 2155

References:

You can close this issue if no need to fix it. Learn more.

if [ ${unique_commit} -ne ${commits} ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Double quote to prevent globbing and word splitting. (view)

Rule Severity Code
SC2086 info 2086

References:

You can close this issue if no need to fix it. Learn more.

LOG_ERROR "${commits} != ${unique_commit}, please make commit message unique!"
exit 1
fi
local merges=$(git log --format=%s HEAD^..HEAD | grep -i merge | wc -l)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Consider using grep -c instead of grep|wc -l. (view)

Rule Severity Code
SC2126 style 2126

References:

You can close this issue if no need to fix it. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Declare and assign separately to avoid masking return values. (view)

Rule Severity Code
SC2155 warning 2155

References:

You can close this issue if no need to fix it. Learn more.

if [ ${merges} -gt 2 ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ShellCheck] Double quote to prevent globbing and word splitting. (view)

Rule Severity Code
SC2086 info 2086

References:

You can close this issue if no need to fix it. Learn more.

LOG_ERROR "PR contain merge : ${merges}, Please rebase!"
exit 1
fi
}

check_commit_message
install_cobra
scan_code
23 changes: 23 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2.1
jobs:
build:
working_directory: /java-sdk
docker:
- image: centos:7
environment:
PATH=$PATH:/usr/bin
steps:
- run:
name: Setup dependencies
command: |
yum install -y epel-release centos-release-scl which
yum install -y git openssl-devel openssl java java-devel
- checkout
- run:
name: Compile
command: |
bash gradlew build -x test -x integrationTest
- run:
name: Integration Test
command: |
bash .ci/ci_check.sh
19 changes: 19 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
codecov:
branch: *
coverage:
ignore:
- "src/integration-test/**/*"
status:
project:
default:
target: 30%
threshold: null
if_not_found: success
patch:
default:
enabled: no
if_not_found: success
changes:
default:
enabled: no
if_not_found: success
27 changes: 27 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Java-SDK GitHub Actions
on:
pull_request:
release:
types: [published, created, edited]
env:
CCACHE_DIR: ${{ github.workspace }}/ccache

jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-16.04, macos-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: install macOS dependencies
if: runner.os == 'macOS'
run: brew install openssl@1.1 openjdk
- name: install Ubuntu dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt install -y git curl libssl-dev default-jdk build-essential
- name: run integration testing
run: /bin/bash .ci/ci_check.sh
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.gradle/
.idea/
log/
build
java-sdk.iml

## eclipse ##
.classpath
.project
.settings/
bin/
out/
dist/
conf/

## integration test files
nodes/
src/integration-test/resources/
build_chain.sh
account/
conf/
gmcert.cnf
gmsm2.param
integrationTestEnv.sh
gradle.properties
gpg.gpg
Loading