@Override protected void initWeb3Client(HttpService httpService) { web3j = Quorum.build(httpService); }
@Bean Quorum quorum() { String nodeEndpoint = nodeConfiguration.getNodeEndpoint(); Web3jService web3jService; if (nodeEndpoint == null || nodeEndpoint.equals("")) { web3jService = new HttpService(); } else if (nodeEndpoint.startsWith("http")) { web3jService = new HttpService(nodeEndpoint); } else if (System.getProperty("os.name").toLowerCase().startsWith("win")) { web3jService = new WindowsIpcService(nodeEndpoint); } else { web3jService = new UnixIpcService(nodeEndpoint); } return Quorum.build(web3jService); }
private Web3j buildService(String clientAddress, Web3jConfiguration configuration) { LOG.info("Building service for endpoint: {}", clientAddress + configuration); if (configuration.getWeb3j() != null) { return configuration.getWeb3j(); } Web3jService web3jService; if (clientAddress == null || clientAddress.equals("")) { web3jService = new HttpService(); } else if (clientAddress.startsWith("http")) { web3jService = new HttpService(clientAddress); } else if (System.getProperty("os.name").toLowerCase().startsWith("win")) { web3jService = new WindowsIpcService(clientAddress); } else { web3jService = new UnixIpcService(clientAddress); } if (configuration.isQuorumAPI()) { return Quorum.build(web3jService); } return Web3j.build(web3jService); }
private void runPrivateGreeterTest( Node sourceNode, Node destNode, String requestId) throws Exception { Quorum quorum = Quorum.build(new HttpService(sourceNode.getUrl())); ClientTransactionManager transactionManager = new ClientTransactionManager( quorum, sourceNode.getAddress(), sourceNode.getPublicKeys().get(0), destNode.getPublicKeys()); String greeting = "Hello Quorum world! [" + requestId + "]"; Greeter contract = Greeter.deploy( quorum, transactionManager, GAS_PRICE, GAS_LIMIT, greeting).send(); assertThat(contract.greet().send(), is(greeting)); }