Hello, I currently have a java method that obtains the data of a transaction with the TxHash, after using the method for a while it presents the following error and I can not receive the input data of that transaction:
“java.util.concurrent.ExecutionExc eption: java.net.UnknownHostException: rinkeby.infura.io”
This is my code:
Connection Infura
@WebMethod(operationName = "ObtenerDatosByHash") public ArrayList<String> ObtenerDatosByHash(@WebParam(name = "txHash") String txHash) throws IOException, InterruptedException, ExecutionException, DecoderException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, URISyntaxException, JSONException { Web3j web3 = Web3j.build(new HttpService("https://rinkeby.infura.io/v3/xxxxxxxx")); Conexion conexion = new Conexion();
Method Blockchain
public ArrayList obtenerByHash(Web3j web3, String txHash) throws IOException, InterruptedException, ExecutionException, DecoderException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, URISyntaxException, JSONException {
Conexion conexion = new Conexion();
String inputData = null;System.out.println("WebService-Testnet-20"); Optional<Transaction> tx = web3.ethGetTransactionByHash(txHash).sendAsync().get().getTransaction(); if (tx.isPresent()) { inputData = tx.get().getInput(); } ArrayList<String> lista = new ArrayList<>();