Interface Client

All Known Implementing Classes:
ClientImpl

public interface Client
This is the interface of client module.
  • Field Details

    • logger

      static final org.slf4j.Logger logger
  • Method Details

    • build

      static Client build​(GroupManagerService groupManagerService, Channel channel, EventResource eventResource, java.lang.Integer groupId)
      Build a client instance GroupId is identified, all interfaces are available
      Parameters:
      channel - the Channel instance
      groupId - the group id
      groupManagerService - the groupManagerService instance
      eventResource - the eventResource instance
      Returns:
      a client instance
    • build

      static Client build​(Channel channel)
    • getGroupManagerService

      GroupManagerService getGroupManagerService()
    • getCryptoSuite

      CryptoSuite getCryptoSuite()
    • getClientNodeVersion

      NodeVersion getClientNodeVersion()
    • getCryptoType

      java.lang.Integer getCryptoType()
    • getGroupId

      java.lang.Integer getGroupId()
      get groupId of the client
      Returns:
      the groupId
    • sendRawTransaction

      SendTransaction sendRawTransaction​(java.lang.String signedTransactionData)
      Ledger operation: send transaction
      Parameters:
      signedTransactionData - transaction string
      Returns:
      SendTransaction
    • sendRawTransactionAsync

      void sendRawTransactionAsync​(java.lang.String signedTransactionData, RespCallback<SendTransaction> callback)
      Ledger operation: async send transaction
      Parameters:
      signedTransactionData - transaction string
      callback - the callback that will be called when receive the response
    • sendRawTransactionAndGetProof

      SendTransaction sendRawTransactionAndGetProof​(java.lang.String signedTransactionData)
      Ledger operation: send raw transaction and get proof
      Parameters:
      signedTransactionData - transaction string
      Returns:
      a SendTransaction instance
    • sendRawTransactionAndGetProofAsync

      void sendRawTransactionAndGetProofAsync​(java.lang.String signedTransactionData, RespCallback<SendTransaction> callback)
      Ledger operation: async send transaction and get proof
      Parameters:
      signedTransactionData - transaction string
      callback - the callback that will be called when receive the response
    • sendRawTransactionAndGetReceipt

      TransactionReceipt sendRawTransactionAndGetReceipt​(java.lang.String signedTransactionData)
      send transaction and get the receipt as the response
      Parameters:
      signedTransactionData - the transaction data sent to the node
      Returns:
      the transaction receipt
    • sendRawTransactionAndGetReceiptAsync

      void sendRawTransactionAndGetReceiptAsync​(java.lang.String signedTransactionData, TransactionCallback callback)
      send transaction to the node, and calls TransactionCallback when get the transaction receipt response
      Parameters:
      signedTransactionData - the transaction sent to the node
      callback - the TransactionCallback called after get the transaction receipt
    • sendRawTransactionAndGetReceiptWithProof

      TransactionReceipt sendRawTransactionAndGetReceiptWithProof​(java.lang.String signedTransactionData)
      calls sendRawTransactionAndGetProof interface and get the transaction receipt
      Parameters:
      signedTransactionData - the transaction sent to the node
      Returns:
      the transaction receipt
    • sendRawTransactionAndGetReceiptWithProofAsync

      void sendRawTransactionAndGetReceiptWithProofAsync​(java.lang.String signedTransactionData, TransactionCallback callback)
      calls sendRawTransactionAndGetProof interface, calls TransactionCallback when get the transaction receipt
      Parameters:
      signedTransactionData - the transaction sent to the node
      callback - the TransactionCallback called after get the transaction receipt
    • call

      Call call​(Transaction transaction)
      Ledger operation: call contract functions without sending transaction
      Parameters:
      transaction - transaction instance
      Returns:
      Call
    • callAsync

      void callAsync​(Transaction transaction, RespCallback<Call> callback)
      Ledger operation: async call contract functions without sending transaction
      Parameters:
      transaction - transaction instance
      callback - the callback that will be called when receive the response
    • getBlockNumber

      BlockNumber getBlockNumber()
      Ledger operation: get block number
      Returns:
      block number
    • getBlockNumber

      BlockNumber getBlockNumber​(java.lang.Integer groupId, java.lang.String peerIpAndPort)
    • getBlockNumberAsync

      void getBlockNumberAsync​(RespCallback<BlockNumber> callback)
      Ledger operation: async get block number
      Parameters:
      callback - the callback that will be called when receive the response
    • getCode

      Code getCode​(java.lang.String address)
      Ledger operation: get code
      Parameters:
      address - the address string
      Returns:
      a code instance
    • getCodeAsync

      void getCodeAsync​(java.lang.String address, RespCallback<Code> callback)
      Ledger operation: async get code
      Parameters:
      address - the address string
      callback - the callback that will be called when receive the response
    • getTotalTransactionCount

      TotalTransactionCount getTotalTransactionCount()
      Ledger operation: get total transaction count
      Returns:
      TotalTransactionCount
    • getTotalTransactionCountAsync

      void getTotalTransactionCountAsync​(RespCallback<TotalTransactionCount> callback)
      Ledger operation: async get total transaction count
      Parameters:
      callback - the callback that will be called when receive the response
    • getBlockByHash

      BcosBlock getBlockByHash​(java.lang.String blockHash, boolean returnFullTransactionObjects)
      Ledger operation: get block by hash
      Parameters:
      blockHash - the hashcode of the block
      returnFullTransactionObjects - the boolean define the tx is full or not
      Returns:
      a block
    • getBlockByHashAsync

      void getBlockByHashAsync​(java.lang.String blockHash, boolean returnFullTransactionObjects, RespCallback<BcosBlock> callback)
      Ledger operation: async get block by hash
      Parameters:
      blockHash - the hashcode of the block
      returnFullTransactionObjects - the boolean define the tx is full or not
      callback - the callback that will be called when receive the response
    • getBlockByNumber

      BcosBlock getBlockByNumber​(java.math.BigInteger blockNumber, boolean returnFullTransactionObjects)
      Ledger operation: get block by block number
      Parameters:
      blockNumber - the number of the block
      returnFullTransactionObjects - the boolean define the tx is full or not
      Returns:
      block
    • getBlockByNumberAsync

      void getBlockByNumberAsync​(java.math.BigInteger blockNumber, boolean returnFullTransactionObjects, RespCallback<BcosBlock> callback)
      Ledger operation: async get block by block number
      Parameters:
      blockNumber - the number of the block
      returnFullTransactionObjects - the boolean define the tx is full or not
      callback - the callback that will be called when receive the response
    • getBlockHashByNumber

      BlockHash getBlockHashByNumber​(java.math.BigInteger blockNumber)
      Ledger operation: get block hash by block number
      Parameters:
      blockNumber - the number of the block
      Returns:
      block hash
    • getBlockHashByNumberAsync

      void getBlockHashByNumberAsync​(java.math.BigInteger blockNumber, RespCallback<BlockHash> callback)
      Ledger operation: async get block hash by block number
      Parameters:
      blockNumber - the number of the block
      callback - the callback that will be called when receive the response
    • getBlockHeaderByHash

      BcosBlockHeader getBlockHeaderByHash​(java.lang.String blockHash, boolean returnSignatureList)
      Ledger operation: get block header by block hash
      Parameters:
      blockHash - the hashcode of the block
      returnSignatureList - the boolean define the signature list is returned or not
      Returns:
      block header
    • getBlockHeaderByHashAsync

      void getBlockHeaderByHashAsync​(java.lang.String blockHash, boolean returnSignatureList, RespCallback<BcosBlockHeader> callback)
      Ledger operation: async get block header by block hash
      Parameters:
      blockHash - the hashcode of the block
      returnSignatureList - the boolean define the signature list is returned or not
      callback - the call back instance
    • getBlockHeaderByNumber

      BcosBlockHeader getBlockHeaderByNumber​(java.math.BigInteger blockNumber, boolean returnSignatureList)
      get block header by number
      Parameters:
      blockNumber - the number of the block
      returnSignatureList - the boolean define the signature list is returned or not
      Returns:
      the block header response from the blockchain node
    • getBlockHeaderByNumberAsync

      void getBlockHeaderByNumberAsync​(java.math.BigInteger blockNumber, boolean returnSignatureList, RespCallback<BcosBlockHeader> callback)
    • getTransactionByHash

      BcosTransaction getTransactionByHash​(java.lang.String transactionHash)
      Ledger operation: get trnasaction by hash
      Parameters:
      transactionHash - the hashcode of transaction
      Returns:
      transaction
    • getTransactionByHashAsync

      void getTransactionByHashAsync​(java.lang.String transactionHash, RespCallback<BcosTransaction> callback)
      Ledger operation: async get trnasaction by hash
      Parameters:
      transactionHash - the hashcode of transaction
      callback - the callback that will be called when receive the response
    • getTransactionByHashWithProof

      TransactionWithProof getTransactionByHashWithProof​(java.lang.String transactionHash)
      Ledger operation: get transaction and proof by hash
      Parameters:
      transactionHash - the hashcode of transaction
      Returns:
      transaction with proof
    • getTransactionByHashWithProofAsync

      void getTransactionByHashWithProofAsync​(java.lang.String transactionHash, RespCallback<TransactionWithProof> callback)
      Ledger operation: async get transaction and proof by hash
      Parameters:
      transactionHash - the hashcode of transaction
      callback - the callback that will be called when receive the response
    • getTransactionByBlockNumberAndIndex

      BcosTransaction getTransactionByBlockNumberAndIndex​(java.math.BigInteger blockNumber, java.math.BigInteger transactionIndex)
      Ledger operation: get transaction by block number and index
      Parameters:
      blockNumber - the number of block
      transactionIndex - the index of transaction
      Returns:
      transaction
    • getTransactionByBlockNumberAndIndexAsync

      void getTransactionByBlockNumberAndIndexAsync​(java.math.BigInteger blockNumber, java.math.BigInteger transactionIndex, RespCallback<BcosTransaction> callback)
      Ledger operation: async get transaction by block number and index
      Parameters:
      blockNumber - the number of block
      transactionIndex - the index of transaction
      callback - the callback that will be called when receive the response
    • getTransactionByBlockHashAndIndex

      BcosTransaction getTransactionByBlockHashAndIndex​(java.lang.String blockHash, java.math.BigInteger transactionIndex)
    • getTransactionByBlockHashAndIndexAsync

      void getTransactionByBlockHashAndIndexAsync​(java.lang.String blockHash, java.math.BigInteger transactionIndex, RespCallback<BcosTransaction> callback)
    • getTransactionReceipt

      BcosTransactionReceipt getTransactionReceipt​(java.lang.String transactionHash)
      Ledger operation: get transaction receipt by transaction hash
      Parameters:
      transactionHash - the hashcode of transaction
      Returns:
      transaction receipt
    • getTransactionReceiptAsync

      void getTransactionReceiptAsync​(java.lang.String transactionHash, RespCallback<BcosTransactionReceipt> callback)
      Ledger operation: async get transaction receipt by transaction hash
      Parameters:
      transactionHash - the hashcode of transaction
      callback - the callback that will be called when receive the response
    • getTransactionReceiptByHashWithProof

      TransactionReceiptWithProof getTransactionReceiptByHashWithProof​(java.lang.String transactionHash)
      Ledger operation: get transaction receipt and proof by transaction hash
      Parameters:
      transactionHash - the hashcode of transaction
      Returns:
      receipt and proof
    • getTransactionReceiptByHashWithProofAsync

      void getTransactionReceiptByHashWithProofAsync​(java.lang.String transactionHash, RespCallback<TransactionReceiptWithProof> callback)
      Ledger operation: async get transaction receipt and proof by transaction hash
      Parameters:
      transactionHash - the hashcode of transaction
      callback - the callback that will be called when receive the response
    • getPendingTransaction

      PendingTransactions getPendingTransaction()
      Ledger operation: get pending transactions in transaction pool
      Returns:
      pending transactions
    • getPendingTransactionAsync

      void getPendingTransactionAsync​(RespCallback<PendingTransactions> callback)
      Ledger operation: async get pending transactions in transaction pool
      Parameters:
      callback - the callback that will be called when receive the response
    • getPendingTxSize

      PendingTxSize getPendingTxSize()
      Ledger operation: get pending transaction size
      Returns:
      PendingTxSize
    • getPendingTxSizeAsync

      void getPendingTxSizeAsync​(RespCallback<PendingTxSize> callback)
      Ledger operation: async get pending transaction size
      Parameters:
      callback - the callback that will be called when receive the response
    • getBlockLimit

      java.math.BigInteger getBlockLimit()
      Get cached block height
      Returns:
      block number
    • generateGroup

      GenerateGroup generateGroup​(java.lang.Integer groupId, long timestamp, boolean enableFreeStorage, java.util.List<java.lang.String> nodeList, java.lang.String peerIpPort)
      Group operation: generate a new group
      Parameters:
      groupId - the group id
      timestamp - timestamp
      enableFreeStorage - enable free storage
      nodeList - give the ip string list of the nodes in the group
      peerIpPort - send to the specific peer
      Returns:
      generate group reply message
    • generateGroupAsync

      void generateGroupAsync​(java.lang.Integer groupId, long timestamp, boolean enableFreeStorage, java.util.List<java.lang.String> nodeList, java.lang.String peerIpPort, RespCallback<GenerateGroup> callback)
      Group operation: async generate a new group
      Parameters:
      groupId - the group id
      timestamp - timestamp
      enableFreeStorage - enable free storage
      nodeList - the list of the nodes in the group
      peerIpPort - send to the specific peer
      callback - the callback that will be called when receive the response
    • startGroup

      StartGroup startGroup​(java.lang.Integer groupId, java.lang.String peerIpPort)
      Group operation: start a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      Returns:
      start group rpc reply
    • startGroupAsync

      void startGroupAsync​(java.lang.Integer groupId, java.lang.String peerIpPort, RespCallback<StartGroup> callback)
      Group operation: async start a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      callback - the callback that will be called when receive the response
    • stopGroup

      StopGroup stopGroup​(java.lang.Integer groupId, java.lang.String peerIpPort)
      Group operation: stop a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      Returns:
      stop group rpc reply
    • stopGroupAsync

      void stopGroupAsync​(java.lang.Integer groupId, java.lang.String peerIpPort, RespCallback<StopGroup> callback)
      Group operation: async stop a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      callback - the callback that will be called when receive the response
    • removeGroup

      RemoveGroup removeGroup​(java.lang.Integer groupId, java.lang.String peerIpPort)
      Group operation: remove a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      Returns:
      remove group rpc reply
    • removeGroupAsync

      void removeGroupAsync​(java.lang.Integer groupId, java.lang.String peerIpPort, RespCallback<RemoveGroup> callback)
      Group operation: async remove a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      callback - the callback that will be called when receive the response
    • recoverGroup

      RecoverGroup recoverGroup​(java.lang.Integer groupId, java.lang.String peerIpPort)
      Group operation: recover a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      Returns:
      recover group rpc reply
    • recoverGroupAsync

      void recoverGroupAsync​(java.lang.Integer groupId, java.lang.String peerIpPort, RespCallback<RecoverGroup> callback)
      Group operation: async recover a group
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      callback - the callback that will be called when receive the response
    • queryGroupStatus

      QueryGroupStatus queryGroupStatus​(java.lang.Integer groupId)
      Group operation: query group status
      Parameters:
      groupId - the group id
      Returns:
      group status
    • queryGroupStatus

      QueryGroupStatus queryGroupStatus​(java.lang.Integer groupId, java.lang.String peerIpPort)
      Group operation: query group status
      Parameters:
      groupId - the group id
      peerIpPort - the node that the request sent to
      Returns:
      group status
    • queryGroupStatusAsync

      void queryGroupStatusAsync​(java.lang.Integer groupId, RespCallback<QueryGroupStatus> callback)
      Group operation: async query group status
      Parameters:
      groupId - the group id
      callback - the callback that will be called when receive the response
    • queryGroupStatusAsync

      void queryGroupStatusAsync​(java.lang.Integer groupId, java.lang.String peerIpPort, RespCallback<QueryGroupStatus> callback)
      Group operation: async query group status
      Parameters:
      groupId - the group that the request sent to
      peerIpPort - the node that the request sent to
      callback - the callback that will be called when receive the response
    • getGroupList

      GroupList getGroupList()
      Group operation: get peer group list
      Returns:
      group list
    • getGroupList

      GroupList getGroupList​(java.lang.String peerIpPort)
      Group operation: get peer group list
      Parameters:
      peerIpPort - send to the specific peer
      Returns:
      group list
    • getGroupListAsync

      void getGroupListAsync​(RespCallback<GroupList> callback)
      Group operation: async get peer group list
      Parameters:
      callback - the callback that will be called when receive the response
    • getGroupListAsync

      void getGroupListAsync​(java.lang.String peerIpPort, RespCallback<GroupList> callback)
      Group operation: async get peer group list
      Parameters:
      peerIpPort - send to the specific peer
      callback - the callback that will be called when receive the response
    • getGroupPeers

      GroupPeers getGroupPeers()
      Group operation: get group peers
      Returns:
      group peers
    • getGroupPeers

      GroupPeers getGroupPeers​(java.lang.String peerIpPort)
      Group operation: get group peers
      Parameters:
      peerIpPort - the target node of the request
      Returns:
      group peers
    • getGroupPeersAsync

      void getGroupPeersAsync​(RespCallback<GroupPeers> callback)
      Group operation: async get group peers
      Parameters:
      callback - the callback that will be called when receive the response
    • getGroupPeersAsync

      void getGroupPeersAsync​(java.lang.String peerIpPort, RespCallback<GroupPeers> callback)
      Group operation: async get group peers
      Parameters:
      peerIpPort - the target node of the request
      callback - the callback that will be called when receive the response
    • getPeers

      Peers getPeers()
      Peer operation: get connected peers
      Returns:
      peers
    • getPeers

      Peers getPeers​(java.lang.String endpoint)
      Peer operation: get connected peers
      Parameters:
      endpoint - the target node that receive the request
      Returns:
      peers
    • getPeersAsync

      void getPeersAsync​(RespCallback<Peers> callback)
      Peer operation: async get connected peers
      Parameters:
      callback - the callback instance
    • getNodeInfo

      NodeInfo getNodeInfo​(java.lang.String endpoint)
      Peer operation: get node information
      Parameters:
      endpoint - the target node that receive the request
      Returns:
      node information
    • getNodeInfoAsync

      void getNodeInfoAsync​(java.lang.String endpoint, RespCallback<NodeInfo> callback)
      Peer operation: get node information
      Parameters:
      endpoint - the target node that receive the request
      callback - callback the call back instance
    • getNodeIDList

      NodeIDList getNodeIDList()
      Peer operation: get node ids
      Returns:
      node id list
    • getNodeIDList

      NodeIDList getNodeIDList​(java.lang.String endpoint)
    • getNodeIDListAsync

      void getNodeIDListAsync​(RespCallback<NodeIDList> callback)
      Peer operation: async get node ids
      Parameters:
      callback - the callback instance
    • getObserverList

      ObserverList getObserverList()
      Peer operation: get observer node list
      Returns:
      observer node list
    • getObserverList

      void getObserverList​(RespCallback<ObserverList> callback)
      Peer operation: async get observer node list
      Parameters:
      callback - the callback instance
    • getSealerList

      SealerList getSealerList()
      Peer operation: get sealer node list
      Returns:
      sealer node list
    • getSealerListAsync

      void getSealerListAsync​(RespCallback<SealerList> callback)
      Peer operation: async get sealer node list
      Parameters:
      callback - the callback instance
    • getPbftView

      PbftView getPbftView()
      Peer operation: get pbft view
      Returns:
      pbft view
    • getPbftViewAsync

      void getPbftViewAsync​(RespCallback<PbftView> callback)
      Peer operation: async get pbft view
      Parameters:
      callback - the callback instance
    • getNodeVersion

      NodeVersion getNodeVersion​(java.lang.String ipAndPort)
    • getNodeVersion

      NodeVersion getNodeVersion()
      Peer operation: get node version
      Returns:
      node version
    • getNodeVersion

      void getNodeVersion​(RespCallback<NodeVersion> callback)
      Peer operation: get node version
      Parameters:
      callback - the callback instance
    • getBatchReceiptsByBlockNumberAndRange

      BcosTransactionReceiptsDecoder getBatchReceiptsByBlockNumberAndRange​(java.math.BigInteger blockNumber, java.lang.String from, java.lang.String count)
      get receipt list according to the block number and the given range
      Parameters:
      blockNumber - the block number of the receipts
      from - the start index of the receipt list required
      count - the end index of the receipt list required
      Returns:
      the receipt list
    • getBatchReceiptsByBlockHashAndRange

      BcosTransactionReceiptsDecoder getBatchReceiptsByBlockHashAndRange​(java.lang.String blockHash, java.lang.String from, java.lang.String count)
      get receipt list according to the block hash and the given range
      Parameters:
      blockHash - the block hash of the receipts
      from - the start index of the receipt list required
      count - the end index of the receipt list required
      Returns:
      the receipt list
    • getConsensusStatus

      ConsensusStatus getConsensusStatus()
      Peer operation: get consensus status
      Returns:
      consensus status
    • getConsensusStates

      void getConsensusStates​(RespCallback<ConsensusStatus> callback)
      Peer operation: async get consensus status
      Parameters:
      callback - the callback instance
    • getSystemConfigByKey

      SystemConfig getSystemConfigByKey​(java.lang.String key)
      Peer operation: get system config
      Parameters:
      key - the string of key
      Returns:
      system config
    • getSystemConfigByKey

      SystemConfig getSystemConfigByKey​(java.lang.String key, java.lang.String peerIpPort)
      Peer operation: get system config
      Parameters:
      key - the string of key
      peerIpPort - the node that the request sent to
      Returns:
      system config
    • getSystemConfigByKeyAsync

      void getSystemConfigByKeyAsync​(java.lang.String key, RespCallback<SystemConfig> callback)
      Peer operation: async get system config
      Parameters:
      key - the string of key
      callback - the callback instance
    • getSystemConfigByKeyAsync

      void getSystemConfigByKeyAsync​(java.lang.String key, java.lang.String peerIpPort, RespCallback<SystemConfig> callback)
      Peer operation: async get system config
      Parameters:
      key - the string of key
      peerIpPort - the port string of
      callback - the callback instance
    • getSyncStatus

      SyncStatus getSyncStatus()
      Peer operation: get sync status
      Returns:
      sync status
    • getSyncStatus

      void getSyncStatus​(RespCallback<SyncStatus> callback)
      Peer operation: async get sync status
      Parameters:
      callback - the callback instance
    • getEventResource

      EventResource getEventResource()
      Get EventPushMsgHandler and FilterManager.
      Returns:
      EventResource
    • stop

      void stop()