@SuppressWarnings("unchecked") @Test public void testInvokeChaincode() throws ClassNotFoundException, SQLException, InvalidArgumentException, ProposalException{ PowerMockito.mockStatic(HFClient.class); when(HFClient.createNewInstance()).thenReturn(mockClient); Channel mockChannel = mock(Channel.class); when(mockClient.newChannel(anyString())).thenReturn(mockChannel); when(mockClient.newPeer(anyString(), anyString(), any())).thenCallRealMethod(); InstantiateProposalRequest mockInstantiateProposalRequest = mock(InstantiateProposalRequest.class); when(mockClient.newInstantiationProposalRequest()).thenReturn(mockInstantiateProposalRequest); TransactionProposalRequest mockTransactionProposalRequest = mock(TransactionProposalRequest.class); when(mockClient.newTransactionProposalRequest()).thenReturn(mockTransactionProposalRequest); Collection<ProposalResponse> mockProposalResponsesList = new ArrayList<ProposalResponse>(); ProposalResponse mockProposalResponses = mock(ProposalResponse.class); when(mockProposalResponses.getStatus()).thenReturn(ProposalResponse.Status.SUCCESS); Peer mkpeer = mock(Peer.class); when(mockProposalResponses.getPeer()).thenReturn(mkpeer); mockProposalResponsesList.add(mockProposalResponses); mockProposalResponsesList.add(mockProposalResponses); when(mockChannel.sendTransactionProposal(any(TransactionProposalRequest.class),anyCollectionOf(Peer.class))).thenReturn(mockProposalResponsesList); PowerMockito.mockStatic(SDKUtils.class); String configPath = "src/test/resources/blockchain-query"; Class.forName("com.impetus.fabric.jdbc.FabricDriver"); QueryBlock qb = new QueryBlock(configPath,"mychannel", null, null); qb.setChannel(); String chaincodeName ="chncodefunc"; when(SDKUtils.getProposalConsistencySets(anyCollection())).thenReturn(new ArrayList<>()); CompletableFuture<BlockEvent.TransactionEvent> mockCompletableFutureTEvent = new CompletableFuture<BlockEvent.TransactionEvent>(); when(mockChannel.sendTransaction(any(ArrayList.class))).thenReturn(mockCompletableFutureTEvent); try { qb.invokeChaincode(chaincodeName, "testFunction", new String[]{"a", "b", "5", "10"}); }catch(BlkchnException blkEx){ if(!(blkEx.getMessage().contains("java.util.concurrent.TimeoutException"))) { assert(false); } } assert(true); }
public DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs) { List<List<Object>> data = new ArrayList<>(); List<String> columns = Arrays.asList("transaction_id", "is_success", "peer", "message"); try { Collection<ProposalResponse> responses; Collection<ProposalResponse> successful = new ArrayList<>(); Collection<ProposalResponse> failed = new ArrayList<>(); checkConfig(); ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(chaincodename).build(); logger.info(String.format("[Channel Name:- %s, Chaincode Function:- %s, Chaincode Args:- %s]", channel.getName(), chaincodeFunction, Arrays.asList(chaincodeArgs))); HFClient client = HFClient.createNewInstance(); client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); client.setUserContext(user); TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest(); transactionProposalRequest.setChaincodeID(chaincodeID); transactionProposalRequest.setFcn(chaincodeFunction); transactionProposalRequest.setProposalWaitTime(conf.getProposalWaitTime()); transactionProposalRequest.setArgs(chaincodeArgs); Map<String, byte[]> tm = new HashMap<>(); tm.put("HyperLedgerFabric", "TransactionProposalRequest:JavaSDK".getBytes(UTF_8)); tm.put("method", "TransactionProposalRequest".getBytes(UTF_8)); tm.put("result", ":)".getBytes(UTF_8)); transactionProposalRequest.setTransientMap(tm); List<PeerInfo> peerInfos = conf.getChaincodePeers(chaincodename); if(peerInfos == null) { throw new BlkchnException("Endorsing peer information not provided for chaincode " + chaincodename); } List<Peer> peers = new ArrayList<>(); for(PeerInfo peerInfo : peerInfos) { Peer peer = client.newPeer(peerInfo.getName(), peerInfo.getGrpcUrl(), peerInfo.getProperties()); peers.add(peer); } Channel channel = reconstructChannel(peers,client); logger.info("sending transactionProposal to all peers with arguments"); responses = channel.sendTransactionProposal(transactionProposalRequest, peers); for (ProposalResponse response : responses) { if (response.getStatus() == ProposalResponse.Status.SUCCESS) { logger.info("Successful transaction proposal response Txid: " + response.getTransactionID() + "from peer " + response.getPeer().getName()); successful.add(response); } else { failed.add(response); } } for(ProposalResponse response : responses) { List<Object> record = new ArrayList<>(); record.add(response.getTransactionID()); record.add(response.getStatus() == ProposalResponse.Status.SUCCESS ? true : false); record.add(response.getPeer().getName()); record.add(response.getMessage()); data.add(record); } Collection<Set<ProposalResponse>> proposalConsistencySets = SDKUtils.getProposalConsistencySets(responses); if (proposalConsistencySets.size() != 1) { logger.info(format("Expected only one set of consistent proposal responses but got " + proposalConsistencySets.size())); } logger.info("Received " + responses.size() + " transaction proposal responses. Successful+verified: " + successful.size() + " . Failed: " + failed.size()); if (failed.size() > 0) { ProposalResponse firstTransactionProposalResponse = failed.iterator().next(); String errMsg = "Not enough endorsers for invoke:" + failed.size() + " endorser error: " + firstTransactionProposalResponse.getMessage() + ". Was verified: " + firstTransactionProposalResponse.isVerified(); logger.info(errMsg); return new DataFrame(data, columns, new HashMap<>()); } logger.info("Successfully received transaction proposal responses."); ProposalResponse resp = responses.iterator().next(); logger.debug("getChaincodeActionResponseReadWriteSetInfo:::" + resp.getChaincodeActionResponseReadWriteSetInfo()); logger.info("Sending chaincode transaction to orderer."); channel.sendTransaction(successful); } catch (Exception e) { String errMsg = "QueryBlock | invokeChaincode | " + e; logger.error(errMsg); data.add(Arrays.asList("", false, "", e.getMessage())); return new DataFrame(data, columns, new HashMap<>()); } return new DataFrame(data, columns, new HashMap<>()); }
QueryBlock { public DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs) { List<List<Object>> data = new ArrayList<>(); List<String> columns = Arrays.asList("transaction_id", "is_success", "peer", "message"); try { Collection<ProposalResponse> responses; Collection<ProposalResponse> successful = new ArrayList<>(); Collection<ProposalResponse> failed = new ArrayList<>(); checkConfig(); ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(chaincodename).build(); logger.info(String.format("[Channel Name:- %s, Chaincode Function:- %s, Chaincode Args:- %s]", channel.getName(), chaincodeFunction, Arrays.asList(chaincodeArgs))); HFClient client = HFClient.createNewInstance(); client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); client.setUserContext(user); TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest(); transactionProposalRequest.setChaincodeID(chaincodeID); transactionProposalRequest.setFcn(chaincodeFunction); transactionProposalRequest.setProposalWaitTime(conf.getProposalWaitTime()); transactionProposalRequest.setArgs(chaincodeArgs); Map<String, byte[]> tm = new HashMap<>(); tm.put("HyperLedgerFabric", "TransactionProposalRequest:JavaSDK".getBytes(UTF_8)); tm.put("method", "TransactionProposalRequest".getBytes(UTF_8)); tm.put("result", ":)".getBytes(UTF_8)); transactionProposalRequest.setTransientMap(tm); List<PeerInfo> peerInfos = conf.getChaincodePeers(chaincodename); if(peerInfos == null) { throw new BlkchnException("Endorsing peer information not provided for chaincode " + chaincodename); } List<Peer> peers = new ArrayList<>(); for(PeerInfo peerInfo : peerInfos) { Peer peer = client.newPeer(peerInfo.getName(), peerInfo.getGrpcUrl(), peerInfo.getProperties()); peers.add(peer); } Channel channel = reconstructChannel(peers,client); logger.info("sending transactionProposal to all peers with arguments"); responses = channel.sendTransactionProposal(transactionProposalRequest, peers); for (ProposalResponse response : responses) { if (response.getStatus() == ProposalResponse.Status.SUCCESS) { logger.info("Successful transaction proposal response Txid: " + response.getTransactionID() + "from peer " + response.getPeer().getName()); successful.add(response); } else { failed.add(response); } } for(ProposalResponse response : responses) { List<Object> record = new ArrayList<>(); record.add(response.getTransactionID()); record.add(response.getStatus() == ProposalResponse.Status.SUCCESS ? true : false); record.add(response.getPeer().getName()); record.add(response.getMessage()); data.add(record); } Collection<Set<ProposalResponse>> proposalConsistencySets = SDKUtils.getProposalConsistencySets(responses); if (proposalConsistencySets.size() != 1) { logger.info(format("Expected only one set of consistent proposal responses but got " + proposalConsistencySets.size())); } logger.info("Received " + responses.size() + " transaction proposal responses. Successful+verified: " + successful.size() + " . Failed: " + failed.size()); if (failed.size() > 0) { ProposalResponse firstTransactionProposalResponse = failed.iterator().next(); String errMsg = "Not enough endorsers for invoke:" + failed.size() + " endorser error: " + firstTransactionProposalResponse.getMessage() + ". Was verified: " + firstTransactionProposalResponse.isVerified(); logger.info(errMsg); return new DataFrame(data, columns, new HashMap<>()); } logger.info("Successfully received transaction proposal responses."); ProposalResponse resp = responses.iterator().next(); logger.debug("getChaincodeActionResponseReadWriteSetInfo:::" + resp.getChaincodeActionResponseReadWriteSetInfo()); logger.info("Sending chaincode transaction to orderer."); channel.sendTransaction(successful); } catch (Exception e) { String errMsg = "QueryBlock | invokeChaincode | " + e; logger.error(errMsg); data.add(Arrays.asList("", false, "", e.getMessage())); return new DataFrame(data, columns, new HashMap<>()); } return new DataFrame(data, columns, new HashMap<>()); } }
QueryBlock { public DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs) { List<List<Object>> data = new ArrayList<>(); List<String> columns = Arrays.asList("transaction_id", "is_success", "peer", "message"); try { Collection<ProposalResponse> responses; Collection<ProposalResponse> successful = new ArrayList<>(); Collection<ProposalResponse> failed = new ArrayList<>(); checkConfig(); ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(chaincodename).build(); logger.info(String.format("[Channel Name:- %s, Chaincode Function:- %s, Chaincode Args:- %s]", channel.getName(), chaincodeFunction, Arrays.asList(chaincodeArgs))); HFClient client = HFClient.createNewInstance(); client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); client.setUserContext(user); TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest(); transactionProposalRequest.setChaincodeID(chaincodeID); transactionProposalRequest.setFcn(chaincodeFunction); transactionProposalRequest.setProposalWaitTime(conf.getProposalWaitTime()); transactionProposalRequest.setArgs(chaincodeArgs); Map<String, byte[]> tm = new HashMap<>(); tm.put("HyperLedgerFabric", "TransactionProposalRequest:JavaSDK".getBytes(UTF_8)); tm.put("method", "TransactionProposalRequest".getBytes(UTF_8)); tm.put("result", ":)".getBytes(UTF_8)); transactionProposalRequest.setTransientMap(tm); List<PeerInfo> peerInfos = conf.getChaincodePeers(chaincodename); if(peerInfos == null) { throw new BlkchnException("Endorsing peer information not provided for chaincode " + chaincodename); } List<Peer> peers = new ArrayList<>(); for(PeerInfo peerInfo : peerInfos) { Peer peer = client.newPeer(peerInfo.getName(), peerInfo.getGrpcUrl(), peerInfo.getProperties()); peers.add(peer); } Channel channel = reconstructChannel(peers,client); logger.info("sending transactionProposal to all peers with arguments"); responses = channel.sendTransactionProposal(transactionProposalRequest, peers); for (ProposalResponse response : responses) { if (response.getStatus() == ProposalResponse.Status.SUCCESS) { logger.info("Successful transaction proposal response Txid: " + response.getTransactionID() + "from peer " + response.getPeer().getName()); successful.add(response); } else { failed.add(response); } } for(ProposalResponse response : responses) { List<Object> record = new ArrayList<>(); record.add(response.getTransactionID()); record.add(response.getStatus() == ProposalResponse.Status.SUCCESS ? true : false); record.add(response.getPeer().getName()); record.add(response.getMessage()); data.add(record); } Collection<Set<ProposalResponse>> proposalConsistencySets = SDKUtils.getProposalConsistencySets(responses); if (proposalConsistencySets.size() != 1) { logger.info(format("Expected only one set of consistent proposal responses but got " + proposalConsistencySets.size())); } logger.info("Received " + responses.size() + " transaction proposal responses. Successful+verified: " + successful.size() + " . Failed: " + failed.size()); if (failed.size() > 0) { ProposalResponse firstTransactionProposalResponse = failed.iterator().next(); String errMsg = "Not enough endorsers for invoke:" + failed.size() + " endorser error: " + firstTransactionProposalResponse.getMessage() + ". Was verified: " + firstTransactionProposalResponse.isVerified(); logger.info(errMsg); return new DataFrame(data, columns, new HashMap<>()); } logger.info("Successfully received transaction proposal responses."); ProposalResponse resp = responses.iterator().next(); logger.debug("getChaincodeActionResponseReadWriteSetInfo:::" + resp.getChaincodeActionResponseReadWriteSetInfo()); logger.info("Sending chaincode transaction to orderer."); channel.sendTransaction(successful); } catch (Exception e) { String errMsg = "QueryBlock | invokeChaincode | " + e; logger.error(errMsg); data.add(Arrays.asList("", false, "", e.getMessage())); return new DataFrame(data, columns, new HashMap<>()); } return new DataFrame(data, columns, new HashMap<>()); } QueryBlock(String configPath, String channel, String username, String secret); }
QueryBlock { public DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs) { List<List<Object>> data = new ArrayList<>(); List<String> columns = Arrays.asList("transaction_id", "is_success", "peer", "message"); try { Collection<ProposalResponse> responses; Collection<ProposalResponse> successful = new ArrayList<>(); Collection<ProposalResponse> failed = new ArrayList<>(); checkConfig(); ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(chaincodename).build(); logger.info(String.format("[Channel Name:- %s, Chaincode Function:- %s, Chaincode Args:- %s]", channel.getName(), chaincodeFunction, Arrays.asList(chaincodeArgs))); HFClient client = HFClient.createNewInstance(); client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); client.setUserContext(user); TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest(); transactionProposalRequest.setChaincodeID(chaincodeID); transactionProposalRequest.setFcn(chaincodeFunction); transactionProposalRequest.setProposalWaitTime(conf.getProposalWaitTime()); transactionProposalRequest.setArgs(chaincodeArgs); Map<String, byte[]> tm = new HashMap<>(); tm.put("HyperLedgerFabric", "TransactionProposalRequest:JavaSDK".getBytes(UTF_8)); tm.put("method", "TransactionProposalRequest".getBytes(UTF_8)); tm.put("result", ":)".getBytes(UTF_8)); transactionProposalRequest.setTransientMap(tm); List<PeerInfo> peerInfos = conf.getChaincodePeers(chaincodename); if(peerInfos == null) { throw new BlkchnException("Endorsing peer information not provided for chaincode " + chaincodename); } List<Peer> peers = new ArrayList<>(); for(PeerInfo peerInfo : peerInfos) { Peer peer = client.newPeer(peerInfo.getName(), peerInfo.getGrpcUrl(), peerInfo.getProperties()); peers.add(peer); } Channel channel = reconstructChannel(peers,client); logger.info("sending transactionProposal to all peers with arguments"); responses = channel.sendTransactionProposal(transactionProposalRequest, peers); for (ProposalResponse response : responses) { if (response.getStatus() == ProposalResponse.Status.SUCCESS) { logger.info("Successful transaction proposal response Txid: " + response.getTransactionID() + "from peer " + response.getPeer().getName()); successful.add(response); } else { failed.add(response); } } for(ProposalResponse response : responses) { List<Object> record = new ArrayList<>(); record.add(response.getTransactionID()); record.add(response.getStatus() == ProposalResponse.Status.SUCCESS ? true : false); record.add(response.getPeer().getName()); record.add(response.getMessage()); data.add(record); } Collection<Set<ProposalResponse>> proposalConsistencySets = SDKUtils.getProposalConsistencySets(responses); if (proposalConsistencySets.size() != 1) { logger.info(format("Expected only one set of consistent proposal responses but got " + proposalConsistencySets.size())); } logger.info("Received " + responses.size() + " transaction proposal responses. Successful+verified: " + successful.size() + " . Failed: " + failed.size()); if (failed.size() > 0) { ProposalResponse firstTransactionProposalResponse = failed.iterator().next(); String errMsg = "Not enough endorsers for invoke:" + failed.size() + " endorser error: " + firstTransactionProposalResponse.getMessage() + ". Was verified: " + firstTransactionProposalResponse.isVerified(); logger.info(errMsg); return new DataFrame(data, columns, new HashMap<>()); } logger.info("Successfully received transaction proposal responses."); ProposalResponse resp = responses.iterator().next(); logger.debug("getChaincodeActionResponseReadWriteSetInfo:::" + resp.getChaincodeActionResponseReadWriteSetInfo()); logger.info("Sending chaincode transaction to orderer."); channel.sendTransaction(successful); } catch (Exception e) { String errMsg = "QueryBlock | invokeChaincode | " + e; logger.error(errMsg); data.add(Arrays.asList("", false, "", e.getMessage())); return new DataFrame(data, columns, new HashMap<>()); } return new DataFrame(data, columns, new HashMap<>()); } QueryBlock(String configPath, String channel, String username, String secret); Config getConf(); String getAdminName(); void setAdminName(String adminName); String getChannelName(); void setChannelName(String channelName); void setChannel(); Channel getChannel(); void checkConfig(); synchronized void registerUser(String uname, String secret, String affiliation); synchronized HyperUser enroll(); Channel reconstructChannel(); Channel reconstructChannel(List<Peer> peers, HFClient client); String installChaincode(String chaincodeName, String version, String goPath, String chaincodePath); String instantiateChaincode(String chaincodeName, String chainCodeVersion, String chainCodePath,
            String chaincodeFunction, String[] chaincodeArgs, Endorsers endorsers); DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs); String queryChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs); String upgradeChaincode(String chaincodeName, String chainCodeVersion, String chainCodePath,
            String chaincodeFunction, String[] chaincodeArgs, Endorsers endorsers); Long getChannelHeight(); }
QueryBlock { public DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs) { List<List<Object>> data = new ArrayList<>(); List<String> columns = Arrays.asList("transaction_id", "is_success", "peer", "message"); try { Collection<ProposalResponse> responses; Collection<ProposalResponse> successful = new ArrayList<>(); Collection<ProposalResponse> failed = new ArrayList<>(); checkConfig(); ChaincodeID chaincodeID = ChaincodeID.newBuilder().setName(chaincodename).build(); logger.info(String.format("[Channel Name:- %s, Chaincode Function:- %s, Chaincode Args:- %s]", channel.getName(), chaincodeFunction, Arrays.asList(chaincodeArgs))); HFClient client = HFClient.createNewInstance(); client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); client.setUserContext(user); TransactionProposalRequest transactionProposalRequest = client.newTransactionProposalRequest(); transactionProposalRequest.setChaincodeID(chaincodeID); transactionProposalRequest.setFcn(chaincodeFunction); transactionProposalRequest.setProposalWaitTime(conf.getProposalWaitTime()); transactionProposalRequest.setArgs(chaincodeArgs); Map<String, byte[]> tm = new HashMap<>(); tm.put("HyperLedgerFabric", "TransactionProposalRequest:JavaSDK".getBytes(UTF_8)); tm.put("method", "TransactionProposalRequest".getBytes(UTF_8)); tm.put("result", ":)".getBytes(UTF_8)); transactionProposalRequest.setTransientMap(tm); List<PeerInfo> peerInfos = conf.getChaincodePeers(chaincodename); if(peerInfos == null) { throw new BlkchnException("Endorsing peer information not provided for chaincode " + chaincodename); } List<Peer> peers = new ArrayList<>(); for(PeerInfo peerInfo : peerInfos) { Peer peer = client.newPeer(peerInfo.getName(), peerInfo.getGrpcUrl(), peerInfo.getProperties()); peers.add(peer); } Channel channel = reconstructChannel(peers,client); logger.info("sending transactionProposal to all peers with arguments"); responses = channel.sendTransactionProposal(transactionProposalRequest, peers); for (ProposalResponse response : responses) { if (response.getStatus() == ProposalResponse.Status.SUCCESS) { logger.info("Successful transaction proposal response Txid: " + response.getTransactionID() + "from peer " + response.getPeer().getName()); successful.add(response); } else { failed.add(response); } } for(ProposalResponse response : responses) { List<Object> record = new ArrayList<>(); record.add(response.getTransactionID()); record.add(response.getStatus() == ProposalResponse.Status.SUCCESS ? true : false); record.add(response.getPeer().getName()); record.add(response.getMessage()); data.add(record); } Collection<Set<ProposalResponse>> proposalConsistencySets = SDKUtils.getProposalConsistencySets(responses); if (proposalConsistencySets.size() != 1) { logger.info(format("Expected only one set of consistent proposal responses but got " + proposalConsistencySets.size())); } logger.info("Received " + responses.size() + " transaction proposal responses. Successful+verified: " + successful.size() + " . Failed: " + failed.size()); if (failed.size() > 0) { ProposalResponse firstTransactionProposalResponse = failed.iterator().next(); String errMsg = "Not enough endorsers for invoke:" + failed.size() + " endorser error: " + firstTransactionProposalResponse.getMessage() + ". Was verified: " + firstTransactionProposalResponse.isVerified(); logger.info(errMsg); return new DataFrame(data, columns, new HashMap<>()); } logger.info("Successfully received transaction proposal responses."); ProposalResponse resp = responses.iterator().next(); logger.debug("getChaincodeActionResponseReadWriteSetInfo:::" + resp.getChaincodeActionResponseReadWriteSetInfo()); logger.info("Sending chaincode transaction to orderer."); channel.sendTransaction(successful); } catch (Exception e) { String errMsg = "QueryBlock | invokeChaincode | " + e; logger.error(errMsg); data.add(Arrays.asList("", false, "", e.getMessage())); return new DataFrame(data, columns, new HashMap<>()); } return new DataFrame(data, columns, new HashMap<>()); } QueryBlock(String configPath, String channel, String username, String secret); Config getConf(); String getAdminName(); void setAdminName(String adminName); String getChannelName(); void setChannelName(String channelName); void setChannel(); Channel getChannel(); void checkConfig(); synchronized void registerUser(String uname, String secret, String affiliation); synchronized HyperUser enroll(); Channel reconstructChannel(); Channel reconstructChannel(List<Peer> peers, HFClient client); String installChaincode(String chaincodeName, String version, String goPath, String chaincodePath); String instantiateChaincode(String chaincodeName, String chainCodeVersion, String chainCodePath,
            String chaincodeFunction, String[] chaincodeArgs, Endorsers endorsers); DataFrame invokeChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs); String queryChaincode(String chaincodename, String chaincodeFunction, String[] chaincodeArgs); String upgradeChaincode(String chaincodeName, String chainCodeVersion, String chainCodePath,
            String chaincodeFunction, String[] chaincodeArgs, Endorsers endorsers); Long getChannelHeight();  }