Querying the chaincode