diff --git a/build.gradle b/build.gradle index 053ace41b..61341fd27 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '1.0.0-SNAPSHOT' + version = '2.6.1-rc1' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/BcosSDK.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/BcosSDK.java index f20d291c9..d70e8068b 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/BcosSDK.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/BcosSDK.java @@ -198,6 +198,9 @@ public void stopAll() { if (this.groupManagerService != null) { this.groupManagerService.stop(); } + if (this.amop != null) { + this.amop.stop(); + } // stop the client for (Integer groupId : groupToClient.keySet()) { groupToClient.get(groupId).stop(); diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java index ccc69248a..d7afcf28e 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java @@ -148,37 +148,73 @@ void sendRawTransactionAsync( String signedTransactionData, RespCallback callback); /** - * Ledger operation: call contract functions without sending transaction + * Ledger operation: send raw transaction and get proof * - * @param transaction transaction instance - * @return Call + * @param signedTransactionData transaction string + * @return a SendTransaction instance */ - Call call(Transaction transaction); + SendTransaction sendRawTransactionAndGetProof(String signedTransactionData); /** - * Ledger operation: async call contract functions without sending transaction + * Ledger operation: async send transaction and get proof * - * @param transaction transaction instance + * @param signedTransactionData transaction string * @param callback the callback that will be called when receive the response */ - void callAsync(Transaction transaction, RespCallback callback); + void sendRawTransactionAndGetProofAsync( + String signedTransactionData, RespCallback callback); /** - * Ledger operation: send raw transaction and get proof + * send transaction and get the receipt as the response * - * @param signedTransactionData transaction string - * @return a SendTransaction instance + * @param signedTransactionData the transaction data sent to the node + * @return the transaction receipt */ - SendTransaction sendRawTransactionAndGetProof(String signedTransactionData); + TransactionReceipt sendRawTransactionAndGetReceipt(String signedTransactionData); /** - * Ledger operation: async send transaction and get proof + * send transaction to the node, and calls TransactionCallback when get the transaction receipt + * response * - * @param signedTransactionData transaction string + * @param signedTransactionData the transaction sent to the node + * @param callback the TransactionCallback called after get the transaction receipt + */ + void sendRawTransactionAndGetReceiptAsync( + String signedTransactionData, TransactionCallback callback); + + /** + * calls sendRawTransactionAndGetProof interface and get the transaction receipt + * + * @param signedTransactionData the transaction sent to the node + * @return the transaction receipt + */ + TransactionReceipt sendRawTransactionAndGetReceiptWithProof(String signedTransactionData); + + /** + * calls sendRawTransactionAndGetProof interface, calls TransactionCallback when get the + * transaction receipt + * + * @param signedTransactionData the transaction sent to the node + * @param callback the TransactionCallback called after get the transaction receipt + */ + void sendRawTransactionAndGetReceiptWithProofAsync( + String signedTransactionData, TransactionCallback callback); + + /** + * Ledger operation: call contract functions without sending transaction + * + * @param transaction transaction instance + * @return Call + */ + Call call(Transaction transaction); + + /** + * Ledger operation: async call contract functions without sending transaction + * + * @param transaction transaction instance * @param callback the callback that will be called when receive the response */ - void sendRawTransactionAndGetProofAsync( - String signedTransactionData, RespCallback callback); + void callAsync(Transaction transaction, RespCallback callback); /** * Ledger operation: get block number @@ -808,41 +844,6 @@ void getSystemConfigByKeyAsync( */ void getSyncStatus(RespCallback callback); - /** - * send transaction and get the receipt as the response - * - * @param signedTransactionData the transaction data sent to the node - * @return the transaction receipt - */ - TransactionReceipt sendRawTransactionAndGetReceipt(String signedTransactionData); - - /** - * send transaction to the node, and calls TransactionCallback when get the transaction receipt - * response - * - * @param signedTransactionData the transaction sent to the node - * @param callback the TransactionCallback called after get the transaction receipt - */ - void asyncSendRawTransaction(String signedTransactionData, TransactionCallback callback); - - /** - * calls sendRawTransactionAndGetProof interface, calls TransactionCallback when get the - * transaction receipt - * - * @param signedTransactionData the transaction sent to the node - * @param callback the TransactionCallback called after get the transaction receipt - */ - void asyncSendRawTransactionAndGetProof( - String signedTransactionData, TransactionCallback callback); - - /** - * calls sendRawTransactionAndGetProof interface and get the transaction receipt - * - * @param signedTransactionData the transaction sent to the node - * @return the transaction receipt - */ - TransactionReceipt sendRawTransactionAndGetReceiptWithProof(String signedTransactionData); - /** * Get EventPushMsgHandler and FilterManager. * diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java index 7f0c9d6be..c2cbc3caa 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java @@ -932,7 +932,7 @@ public void onResponse(TransactionReceipt receipt) { @Override public TransactionReceipt sendRawTransactionAndGetReceipt(String signedTransactionData) { SynchronousTransactionCallback callback = new SynchronousTransactionCallback(); - asyncSendRawTransaction(signedTransactionData, callback); + sendRawTransactionAndGetReceiptAsync(signedTransactionData, callback); try { callback.semaphore.acquire(1); } catch (InterruptedException e) { @@ -942,7 +942,7 @@ public TransactionReceipt sendRawTransactionAndGetReceipt(String signedTransacti } @Override - public void asyncSendRawTransaction( + public void sendRawTransactionAndGetReceiptAsync( String signedTransactionData, TransactionCallback callback) { this.jsonRpcService.asyncSendTransactionToGroup( new JsonRpcRequest( @@ -953,7 +953,7 @@ public void asyncSendRawTransaction( } @Override - public void asyncSendRawTransactionAndGetProof( + public void sendRawTransactionAndGetReceiptWithProofAsync( String signedTransactionData, TransactionCallback callback) { this.jsonRpcService.asyncSendTransactionToGroup( new JsonRpcRequest( @@ -967,7 +967,7 @@ public void asyncSendRawTransactionAndGetProof( public TransactionReceipt sendRawTransactionAndGetReceiptWithProof( String signedTransactionData) { SynchronousTransactionCallback callback = new SynchronousTransactionCallback(); - asyncSendRawTransactionAndGetProof(signedTransactionData, callback); + sendRawTransactionAndGetReceiptWithProofAsync(signedTransactionData, callback); try { callback.semaphore.acquire(1); } catch (InterruptedException e) { diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java index e8c9b0cb0..ff6f27697 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java @@ -64,7 +64,7 @@ public TransactionReceipt sendTransactionAndGetReceipt( public void sendTransactionAsync( String to, String data, CryptoKeyPair cryptoKeyPair, TransactionCallback callback) { String signedData = createSignedTransaction(to, data, cryptoKeyPair); - client.asyncSendRawTransaction(signedData, callback); + client.sendRawTransactionAndGetReceiptAsync(signedData, callback); } @Override diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/pusher/TransactionPusherService.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/pusher/TransactionPusherService.java index 8e9db8650..3e150bc42 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/pusher/TransactionPusherService.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/pusher/TransactionPusherService.java @@ -37,7 +37,7 @@ public TransactionPusherService(Client client) { @Override public void pushOnly(String signedTransaction) { - client.asyncSendRawTransaction(signedTransaction, null); + client.sendRawTransactionAndGetReceiptAsync(signedTransaction, null); } @Override @@ -53,7 +53,7 @@ public TransactionReceipt push(String signedTransaction) { @Override public void pushAsync(String signedTransactionData, TransactionCallback callback) { - client.asyncSendRawTransaction(signedTransactionData, callback); + client.sendRawTransactionAndGetReceiptAsync(signedTransactionData, callback); } @Override diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index ca9a70ca7..000000000 --- a/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -rootProject.name = "java-sdk" - -// submodules -include "sdk-core" -include "sdk-crypto" -include "sdk-abi" -include "sdk-amop" -include "sdk-service" -include "sdk-transaction" -include "sdk-codegen" -include "sdk-demo"