public Collection < LifecycleQueryInstalledChaincodeProposalResponse > sendLifecycleQueryInstalledChaincode ( LifecycleQueryInstalledChaincodeRequest lifecycleQueryInstalledChaincodeRequest , Collection < Peer > peers ) throws InvalidArgumentException , ProposalException { if ( null == lifecycleQueryInstalledChaincodeRequest ) { throw new InvalidArgumentException ( "The lifecycleQueryInstalledChaincodeRequest parameter can not be null." ) ; } clientCheck ( ) ; if ( null == peers ) { throw new InvalidArgumentException ( "The parameter peers set to null" ) ; } if ( peers . isEmpty ( ) ) { throw new InvalidArgumentException ( "Peers to query is empty." ) ; } if ( lifecycleQueryInstalledChaincodeRequest == null ) { throw new InvalidArgumentException ( "The lifecycleQueryInstalledChaincoded parameter must not be null." ) ; } if ( Utils . isNullOrEmpty ( lifecycleQueryInstalledChaincodeRequest . getPackageId ( ) ) ) { throw new InvalidArgumentException ( "The lifecycleQueryInstalledChaincoded packageID parameter must not be null." ) ; } try { //Run this on a system channel. Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . lifecycleQueryInstalledChaincode ( lifecycleQueryInstalledChaincodeRequest , peers ) ; } catch ( ProposalException e ) { logger . error ( format ( "lifecycleQueryInstalledChaincodeRequest for failed. %s" , e . getMessage ( ) ) , e ) ; throw e ; } }
Query installed chaincode on a peer .