synchronized void shutdown(boolean force) { if (shutdown) { return; } final String me = toString(); logger.debug(me + " is shutting down."); shutdown = true; channel = null; lastBlockEvent = null; lastBlockNumber = -1L; removeEndorserClient(force); PeerEventServiceClient lpeerEventingClient = peerEventingClient; peerEventingClient = null; if (null != lpeerEventingClient) { // PeerEventServiceClient peerEventingClient1 = peerEventingClient; logger.debug(me + " is shutting down " + lpeerEventingClient); lpeerEventingClient.shutdown(force); } logger.debug(me + " is shut down."); }
ListenableFuture<Protocol.Response> sendDiscoveryRequestAsync(Protocol.SignedRequest discoveryRequest) throws PeerException, InvalidArgumentException { logger.debug(format("peer.sendDiscoveryRequstAsync %s", toString())); EndorserClient localEndorserClient = getEndorserClient(); try { return localEndorserClient.sendDiscoveryRequestAsync(discoveryRequest); } catch (Throwable t) { removeEndorserClient(true); throw t; } }
ListenableFuture<FabricProposalResponse.ProposalResponse> sendProposalAsync(FabricProposal.SignedProposal proposal) throws PeerException, InvalidArgumentException { checkSendProposal(proposal); if (IS_DEBUG_LEVEL) { logger.debug(format("peer.sendProposalAsync %s", toString())); } EndorserClient localEndorserClient = getEndorserClient(); try { return localEndorserClient.sendProposalAsync(proposal); } catch (Throwable t) { removeEndorserClient(true); throw t; } }
synchronized void setTLSCertificateKeyPair(TLSCertificateKeyPair tlsCertificateKeyPair) { if (properties == null) { properties = new Properties(); } properties.put("clientKeyBytes", tlsCertificateKeyPair.getKeyPemBytes()); properties.put("clientCertBytes", tlsCertificateKeyPair.getCertPEMBytes()); Endpoint endpoint = Endpoint.createEndpoint(url, properties); foundClientTLSCertificateDigest = true; clientTLSCertificateDigest = endpoint.getClientTLSCertificateDigest(); removeEndorserClient(true); endorserClent = new EndorserClient(channelName, name, url, endpoint.getChannelBuilder()); }
synchronized void shutdown(boolean force) { if (shutdown) { return; } final String me = toString(); logger.debug(me + " is shutting down."); shutdown = true; channel = null; lastBlockEvent = null; lastBlockNumber = -1L; removeEndorserClient(force); PeerEventServiceClient lpeerEventingClient = peerEventingClient; peerEventingClient = null; if (null != lpeerEventingClient) { // PeerEventServiceClient peerEventingClient1 = peerEventingClient; logger.debug(me + " is shutting down " + lpeerEventingClient); lpeerEventingClient.shutdown(force); } logger.debug(me + " is shut down."); }
ListenableFuture<Protocol.Response> sendDiscoveryRequestAsync(Protocol.SignedRequest discoveryRequest) throws PeerException, InvalidArgumentException { logger.debug(format("peer.sendDiscoveryRequstAsync %s", toString())); EndorserClient localEndorserClient = getEndorserClient(); try { return localEndorserClient.sendDiscoveryRequestAsync(discoveryRequest); } catch (Throwable t) { removeEndorserClient(true); throw t; } }
ListenableFuture<FabricProposalResponse.ProposalResponse> sendProposalAsync(FabricProposal.SignedProposal proposal) throws PeerException, InvalidArgumentException { checkSendProposal(proposal); if (IS_DEBUG_LEVEL) { logger.debug(format("peer.sendProposalAsync %s", toString())); } EndorserClient localEndorserClient = getEndorserClient(); try { return localEndorserClient.sendProposalAsync(proposal); } catch (Throwable t) { removeEndorserClient(true); throw t; } }
synchronized void setTLSCertificateKeyPair(TLSCertificateKeyPair tlsCertificateKeyPair) { if (properties == null) { properties = new Properties(); } properties.put("clientKeyBytes", tlsCertificateKeyPair.getKeyPemBytes()); properties.put("clientCertBytes", tlsCertificateKeyPair.getCertPEMBytes()); Endpoint endpoint = Endpoint.createEndpoint(url, properties); foundClientTLSCertificateDigest = true; clientTLSCertificateDigest = endpoint.getClientTLSCertificateDigest(); removeEndorserClient(true); endorserClent = new EndorserClient(channelName, name, url, endpoint.getChannelBuilder()); }