Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions sdk-service/src/main/java/org/fisco/bcos/sdk/BcosSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
101 changes: 51 additions & 50 deletions sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,37 +148,73 @@ void sendRawTransactionAsync(
String signedTransactionData, RespCallback<SendTransaction> 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<Call> callback);
void sendRawTransactionAndGetProofAsync(
String signedTransactionData, RespCallback<SendTransaction> 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<SendTransaction> callback);
void callAsync(Transaction transaction, RespCallback<Call> callback);

/**
* Ledger operation: get block number
Expand Down Expand Up @@ -808,41 +844,6 @@ void getSystemConfigByKeyAsync(
*/
void getSyncStatus(RespCallback<SyncStatus> 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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand All @@ -953,7 +953,7 @@ public void asyncSendRawTransaction(
}

@Override
public void asyncSendRawTransactionAndGetProof(
public void sendRawTransactionAndGetReceiptWithProofAsync(
String signedTransactionData, TransactionCallback callback) {
this.jsonRpcService.asyncSendTransactionToGroup(
new JsonRpcRequest(
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public TransactionPusherService(Client client) {

@Override
public void pushOnly(String signedTransaction) {
client.asyncSendRawTransaction(signedTransaction, null);
client.sendRawTransactionAndGetReceiptAsync(signedTransaction, null);
}

@Override
Expand All @@ -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
Expand Down
11 changes: 0 additions & 11 deletions settings.gradle

This file was deleted.