-
Notifications
You must be signed in to change notification settings - Fork 59
client
maggie edited this page Sep 27, 2020
·
3 revisions
Client模块的主要功能是提供
public interface Client {
// 发送交易
SendTransaction sendRawTransaction(String signedTransactionData);
void sendRawTransactionAsync(
String signedTransactionData, RespCallback<SendTransaction> callback);
// 发送交易,在交易推送时并获得回执
SendTransaction sendRawTransactionAndGetProof(String signedTransactionData);
void sendRawTransactionAndGetProofAsync(
String signedTransactionData, RespCallback<SendTransaction> callback);
// 发送交易并直接获得回执
TransactionReceipt sendRawTransactionAndGetReceipt(String signedTransactionData);
void sendRawTransactionAndGetReceiptAsync(String signedTransactionData, TransactionCallback callback)
// 发送交易并获得回执、交易的默克尔证明、回执的默克尔证明
void sendRawTransactionAndGetReceiptWithProofAsync( String signedTransactionData, TransactionCallback callback);
TransactionReceipt sendRawTransactionAndGetReceiptWithProof(String signedTransactionData);
// 合约调用
Call call(Transaction transaction);
void callAsync(Transaction transaction, RespCallback<Call> callback);
// 获取区块号
BlockNumber getBlockNumber();
BlockNumber getBlockNumber(Integer groupId, String peerIpAndPort);
void getBlockNumberAsync(RespCallback<BlockNumber> callback);
// 获取代码
Code getCode(String address);
void getCodeAsync(String address, RespCallback<Code> callback);
// 获取交易数量
TotalTransactionCount getTotalTransactionCount();
void getTotalTransactionCountAsync(RespCallback<TotalTransactionCount> callback);
// 通过区块Hash获取区块
BcosBlock getBlockByHash(String blockHash, boolean returnFullTransactionObjects);
void getBlockByHashAsync(String blockHash,boolean returnFullTransactionObjects, RespCallback<BcosBlock> callback);
// 通过区块号获取区块
BcosBlock getBlockByNumber(BigInteger blockNumber, boolean returnFullTransactionObjects);
void getBlockByNumberAsync(BigInteger blockNumber, boolean returnFullTransactionObjects,
RespCallback<BcosBlock> callback);
// 根据区块号获取区块Hash
BlockHash getBlockHashByNumber(BigInteger blockNumber);
void getBlockHashByNumberAsync(BigInteger blockNumber, RespCallback<BlockHash> callback);
// 通过区块Hash获取区块头
BcosBlockHeader getBlockHeaderByHash(String blockHash, boolean returnSignatureList);
void getBlockHeaderByHashAsync(
String blockHash, boolean returnSignatureList, RespCallback<BcosBlockHeader> callback);
// 通过区块号获取区块头
BcosBlockHeader getBlockHeaderByNumber(BigInteger blockNumber, boolean returnSignatureList);
void getBlockHeaderByNumberAsync(BigInteger blockNumber,boolean returnSignatureList, RespCallback<BcosBlockHeader> callback);
// 通过交易Hash获取交易
BcosTransaction getTransactionByHash(String transactionHash);
void getTransactionByHashAsync(String transactionHash, RespCallback<BcosTransaction> callback);
// 通过交易Hash获取交易和证明
TransactionWithProof getTransactionByHashWithProof(String transactionHash);
void getTransactionByHashWithProofAsync(
String transactionHash, RespCallback<TransactionWithProof> callback);
// 通过区块号和序号获取交易
BcosTransaction getTransactionByBlockNumberAndIndex(
BigInteger blockNumber, BigInteger transactionIndex);
void getTransactionByBlockNumberAndIndexAsync( BigInteger blockNumber, BigInteger transactionIndex, RespCallback<BcosTransaction> callback);
// 通过区块Hash和序号获取交易
BcosTransaction getTransactionByBlockHashAndIndex(
String blockHash, BigInteger transactionIndex);
void getTransactionByBlockHashAndIndexAsync(
String blockHash, BigInteger transactionIndex, RespCallback<BcosTransaction> callback);
// 通过交易Hash获取交易回执
BcosTransactionReceipt getTransactionReceipt(String transactionHash);
void getTransactionReceiptAsync(
String transactionHash, RespCallback<BcosTransactionReceipt> callback);
// 通过交易Hash获取交易回执和证明
TransactionReceiptWithProof getTransactionReceiptByHashWithProof(String transactionHash);
void getTransactionReceiptByHashWithProofAsync(
String transactionHash, RespCallback<TransactionReceiptWithProof> callback);
// 获取Pending状态的交易
PendingTransactions getPendingTransaction();
void getPendingTransactionAsync(RespCallback<PendingTransactions> callback);
// 获取Pending状态的交易数量
PendingTxSize getPendingTxSize();
void getPendingTxSizeAsync(RespCallback<PendingTxSize> callback);
// 获取BlockLimit
BigInteger getBlockLimit();
// 群组管理
// 创建新群组
GenerateGroup generateGroup( Integer groupId, long timestamp, boolean enableFreeStorage, List<String> nodeList, String peerIpPort);
void generateGroupAsync(Integer groupId, long timestamp, boolean enableFreeStorage, List<String> nodeList, String peerIpPort, RespCallback<GenerateGroup> callback);
// 启动群组
StartGroup startGroup(Integer groupId, String peerIpPort);
void startGroupAsync(Integer groupId, String peerIpPort, RespCallback<StartGroup> callback);
// 停止群组
StopGroup stopGroup(Integer groupId, String peerIpPort);
void stopGroupAsync(Integer groupId, String peerIpPort, RespCallback<StopGroup> callback);
// 移除群组
RemoveGroup removeGroup(Integer groupId, String peerIpPort);
void removeGroupAsync(Integer groupId, String peerIpPort, RespCallback<RemoveGroup> callback);
// 恢复群组
RecoverGroup recoverGroup(Integer groupId, String peerIpPort);
void recoverGroupAsync(Integer groupId, String peerIpPort, RespCallback<RecoverGroup> callback);
// 查询群组状态
QueryGroupStatus queryGroupStatus(Integer groupId);
QueryGroupStatus queryGroupStatus(Integer groupId, String peerIpPort);
void queryGroupStatusAsync(Integer groupId, RespCallback<QueryGroupStatus> callback);
void queryGroupStatusAsync(
Integer groupId, String peerIpPort, RespCallback<QueryGroupStatus> callback);
// 获取群组列表
GroupList getGroupList();
GroupList getGroupList(String peerIpPort);
void getGroupListAsync(RespCallback<GroupList> callback);
void getGroupListAsync(String peerIpPort, RespCallback<GroupList> callback);
// 获取群组节点
GroupPeers getGroupPeers();
GroupPeers getGroupPeers(String peerIpPort);
void getGroupPeersAsync(RespCallback<GroupPeers> callback);
void getGroupPeersAsync(String peerIpPort, RespCallback<GroupPeers> callback);
// 获取所连接的节点
Peers getPeers();
Peers getPeers(String endpoint);
void getPeersAsync(RespCallback<Peers> callback);
// 获取NodeID列表
NodeIDList getNodeIDList();
NodeIDList getNodeIDList(String endpoint);
void getNodeIDListAsync(RespCallback<NodeIDList> callback);
// 节点管理
// 获取观察节点列表
ObserverList getObserverList();
void getObserverList(RespCallback<ObserverList> callback);
// 获取Client对应群组的共识节点列表
SealerList getSealerList();
void getSealerListAsync(RespCallback<SealerList> callback);
// 节点使用PBFT共识算法时,获取PBFT视图信息。
PbftView getPbftView();
void getPbftViewAsync(RespCallback<PbftView> callback);
// 获取节点版本
NodeVersion getNodeVersion(String ipAndPort);
NodeVersion getNodeVersion();
void getNodeVersion(RespCallback<NodeVersion> callback);
// 获取状态
ConsensusStatus getConsensusStatus();
void getConsensusStates(RespCallback<ConsensusStatus> callback);
// 获取系统配置
SystemConfig getSystemConfigByKey(String key);
SystemConfig getSystemConfigByKey(String key, String peerIpPort);
void getSystemConfigByKeyAsync(String key, RespCallback<SystemConfig> callback);
void getSystemConfigByKeyAsync(
String key, String peerIpPort, RespCallback<SystemConfig> callback);
// 获取同步状态
SyncStatus getSyncStatus();
void getSyncStatus(RespCallback<SyncStatus> callback);
// 获取 EventPushMsgHandler 和 FilterManager.
EventResource getEventResource();
// 获取群组管理服务
GroupManagerService getGroupManagerService();
// 获取加密套件
CryptoSuite getCryptoSuite();
// 获取节点版本
NodeVersion getClientNodeVersion();
// 获取加密类型
Integer getCryptoType();
// 获取群组ID
Integer getGroupId();
// 关闭模块
void stop();
}