static Endpoint createEndpoint(String url, Properties properties) { return new Endpoint(url, properties); }
static Endpoint createEndpoint(String url, Properties properties) { return new Endpoint(url, properties); }
byte[] getClientTLSCertificateDigest() { if (null == clientTLSCertificateDigest) { clientTLSCertificateDigest = new Endpoint(url, properties).getClientTLSCertificateDigest(); } return clientTLSCertificateDigest; }
void initiateEventing(TransactionContext transactionContext, PeerOptions peersOptions) throws TransactionException { this.transactionContext = transactionContext.retryTransactionSameContext(); if (peerEventingClient == null) { //PeerEventServiceClient(Peer peer, ManagedChannelBuilder<?> channelBuilder, Properties properties) // peerEventingClient = new PeerEventServiceClient(this, new HashSet<Channel>(Arrays.asList(new Channel[] {channel}))); peerEventingClient = new PeerEventServiceClient(this, new Endpoint(url, properties), properties, peersOptions); peerEventingClient.connect(transactionContext); } }
DeliverResponse[] sendDeliver(Common.Envelope transaction) throws TransactionException { if (shutdown) { throw new TransactionException(format("Orderer %s was shutdown.", name)); } OrdererClient localOrdererClient = ordererClient; logger.debug(format("Order.sendDeliver name: %s, url: %s", name, url)); if (localOrdererClient == null || !localOrdererClient.isChannelActive()) { localOrdererClient = new OrdererClient(this, new Endpoint(url, properties).getChannelBuilder(), properties); ordererClient = localOrdererClient; } try { return localOrdererClient.sendDeliver(transaction); } catch (Throwable t) { ordererClient = null; throw t; } }
ListenableFuture<FabricProposalResponse.ProposalResponse> sendProposalAsync(FabricProposal.SignedProposal proposal) throws PeerException, InvalidArgumentException { checkSendProposal(proposal); logger.debug(format("peer.sendProposalAsync name: %s, url: %s", name, url)); EndorserClient localEndorserClient = endorserClent; //work off thread local copy. if (null == localEndorserClient || !localEndorserClient.isChannelActive()) { endorserClent = new EndorserClient(new Endpoint(url, properties).getChannelBuilder()); localEndorserClient = endorserClent; } try { return localEndorserClient.sendProposalAsync(proposal); } catch (Throwable t) { endorserClent = null; throw t; } }
/** * Send transaction to Order * * @param transaction transaction to be sent */ Ab.BroadcastResponse sendTransaction(Common.Envelope transaction) throws Exception { if (shutdown) { throw new TransactionException(format("Orderer %s was shutdown.", name)); } logger.debug(format("Order.sendTransaction name: %s, url: %s", name, url)); OrdererClient localOrdererClient = ordererClient; if (localOrdererClient == null || !localOrdererClient.isChannelActive()) { ordererClient = new OrdererClient(this, new Endpoint(url, properties).getChannelBuilder(), properties); localOrdererClient = ordererClient; } try { return localOrdererClient.sendTransaction(transaction); } catch (Throwable t) { ordererClient = null; throw t; } }
Endpoint endpoint = new Endpoint(url, properties); managedChannel = endpoint.getChannelBuilder().build();