Update clients according to API updates
This commit is contained in:
parent
8bbe9ae173
commit
ae0fcaf505
@ -5,6 +5,7 @@ import bdchain.api.grpc.AccountingChainGrpc.AccountingChainBlockingStub;
|
||||
import bdchain.api.grpc.AccountingChainGrpc.AccountingChainFutureStub;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.Empty;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
@ -51,6 +52,40 @@ public class AccountingChainClient {
|
||||
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* <a
|
||||
* href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#clientversion-1">查询节点客户端版本</a>
|
||||
* (非阻塞)
|
||||
*/
|
||||
public ListenableFuture<ClientVersionResponse> clientVersion() {
|
||||
|
||||
info("*** clientVersion");
|
||||
|
||||
try {
|
||||
return futureStub.clientVersion(Empty.getDefaultInstance());
|
||||
} catch (StatusRuntimeException e) {
|
||||
warning("RPC failed: {0}", e.getStatus());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <a
|
||||
* href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#clientversion-1">查询节点客户端版本</a>
|
||||
* (阻塞)
|
||||
*/
|
||||
public ClientVersionResponse clientVersionSync() {
|
||||
|
||||
info("*** clientVersionSync");
|
||||
|
||||
try {
|
||||
return blockingStub.clientVersion(Empty.getDefaultInstance());
|
||||
} catch (StatusRuntimeException e) {
|
||||
warning("RPC failed: {0}", e.getStatus());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <a
|
||||
* href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#blocknumber">返回最新区块的区块号</a>
|
||||
|
@ -51,6 +51,40 @@ public class TransactionLedgerClient {
|
||||
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* <a
|
||||
* href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#clientversion">查询节点客户端版本</a>
|
||||
* (非阻塞)
|
||||
*/
|
||||
public ListenableFuture<ClientVersionResponse> clientVersion() {
|
||||
|
||||
info("*** clientVersion");
|
||||
|
||||
try {
|
||||
return futureStub.clientVersion(Empty.getDefaultInstance());
|
||||
} catch (StatusRuntimeException e) {
|
||||
warning("RPC failed: {0}", e.getStatus());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <a
|
||||
* href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#clientversion">查询节点客户端版本</a>
|
||||
* (阻塞)
|
||||
*/
|
||||
public ClientVersionResponse clientVersionSync() {
|
||||
|
||||
info("*** clientVersionSync");
|
||||
|
||||
try {
|
||||
return blockingStub.clientVersion(Empty.getDefaultInstance());
|
||||
} catch (StatusRuntimeException e) {
|
||||
warning("RPC failed: {0}", e.getStatus());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://phabricator.internetapi.cn/w/public/bdchain/grpc-api/#createledger">创建账本</a>
|
||||
* (非阻塞)
|
||||
|
Loading…
Reference in New Issue
Block a user