src/main/java/org/hyperledger/fabric/sdk/Channel.java
/**
     * query for chain information
     *
     * @param peer The peer to send the request to
     * @return a {@link BlockchainInfo} object containing the chain info requested
     * @throws InvalidArgumentException
     * @throws ProposalException
     */
query for chain information
@param peer The peer to send the request to
@return a  BlockchainInfo object containing the chain info requested
@throws InvalidArgumentException
@throws ProposalException
query for chain information @param peer The peer to send the request to @return a BlockchainInfo object containing the chain info requested @throws InvalidArgumentException @throws ProposalException
public BlockchainInfo queryBlockchainInfo(Peer peer) throws ProposalException, InvalidArgumentException {
        checkChannelState();
        checkPeer(peer);
        BlockchainInfo response;
        try {
            logger.debug("queryBlockchainInfo to peer " + peer.getName() + " on channel " + name);
            QuerySCCRequest querySCCRequest = new QuerySCCRequest(client.getUserContext());
            querySCCRequest.setFcn(QuerySCCRequest.GETCHAININFO);
            querySCCRequest.setArgs(name);
            Collection<ProposalResponse> proposalResponses = sendProposal(querySCCRequest, Collections.singletonList(peer));
            ProposalResponse proposalResponse = proposalResponses.iterator().next();
            if (proposalResponse.getStatus().getStatus() != 200) {
                throw new PeerException(format("Unable to query block channel info for channel %s from peer %s with message %s",
                        name,
                        peer.getName(),
                        proposalResponse.getMessage()));
            }
            response = new BlockchainInfo(Ledger.BlockchainInfo.parseFrom(proposalResponse.getProposalResponse().getResponse().getPayload()));
        } catch (Exception e) {
            String emsg = format("queryBlockchainInfo peer %s channel %s error %s",
                    peer.getName(),
                    name,
                    e.getMessage());
            logger.error(emsg, e);
            throw new ProposalException(emsg, e);
        }
        return response;
    }
public BlockchainInfo queryBlockchainInfo ( Peer peer ) throws ProposalException , InvalidArgumentException { checkChannelState ( ) ; checkPeer ( peer ) ; BlockchainInfo response ; try { logger . debug ( "queryBlockchainInfo to peer " + peer . getName ( ) + " on channel " + name ) ; QuerySCCRequest querySCCRequest = new QuerySCCRequest ( client . getUserContext ( ) ) ; querySCCRequest . setFcn ( QuerySCCRequest . GETCHAININFO ) ; querySCCRequest . setArgs ( name ) ; Collection < ProposalResponse > proposalResponses = sendProposal ( querySCCRequest , Collections . singletonList ( peer ) ) ; ProposalResponse proposalResponse = proposalResponses . iterator ( ) . next ( ) ; if ( proposalResponse . getStatus ( ) . getStatus ( ) != 200 ) { throw new PeerException ( format ( "Unable to query block channel info for channel %s from peer %s with message %s" , name , peer . getName ( ) , proposalResponse . getMessage ( ) ) ) ; } response = new BlockchainInfo ( Ledger . BlockchainInfo . parseFrom ( proposalResponse . getProposalResponse ( ) . getResponse ( ) . getPayload ( ) ) ) ; } catch ( Exception e ) { String emsg = format ( "queryBlockchainInfo peer %s channel %s error %s" , peer . getName ( ) , name , e . getMessage ( ) ) ; logger . error ( emsg , e ) ; throw new ProposalException ( emsg , e ) ; } return response ; }
query for chain information
 @param peer The peer to send the request to
 @return a {@link BlockchainInfo} object containing the chain info requested
 @throws InvalidArgumentException
 @throws ProposalException
query for chain information @param peer The peer to send the request to @return a { @link BlockchainInfo } object containing the chain info requested @throws InvalidArgumentException @throws ProposalException