Skip to main content
deleted 24 characters in body
Source Link

In case anyone had this problem I found the solution. It was simply a proxy problem and missing library problem.

  1. add the rxJava ,okio and Okhttp jar lib.

  2. This step is optional if u have a proxy problem like i did.

    String hostname = "10.84.10.11";"IP ADDRESS";
    int port = 3128;PORT;
    
    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
    OkHttpClient client = new OkHttpClient.Builder().proxy(proxy).build();
    
    String url = "https://rinkeby.infura.io/v3/c270b7df7bf54378a96ef7fe28e54715";<API-KEY>";
    
    web3 = Web3j.build(new HttpService(url, client, true));
    

In case anyone had this problem I found the solution. It was simply a proxy problem and missing library problem.

  1. add the rxJava ,okio and Okhttp jar lib.

  2. This step is optional if u have a proxy problem like i did.

    String hostname = "10.84.10.11";
    int port = 3128;
    
    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
    OkHttpClient client = new OkHttpClient.Builder().proxy(proxy).build();
    
    String url = "https://rinkeby.infura.io/v3/c270b7df7bf54378a96ef7fe28e54715";
    
    web3 = Web3j.build(new HttpService(url, client, true));
    

In case anyone had this problem I found the solution. It was simply a proxy problem and missing library problem.

  1. add the rxJava ,okio and Okhttp jar lib.

  2. This step is optional if u have a proxy problem like i did.

    String hostname = "IP ADDRESS";
    int port = PORT;
    
    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
    OkHttpClient client = new OkHttpClient.Builder().proxy(proxy).build();
    
    String url = "https://rinkeby.infura.io/v3/<API-KEY>";
    
    web3 = Web3j.build(new HttpService(url, client, true));
    
Source Link

In case anyone had this problem I found the solution. It was simply a proxy problem and missing library problem.

  1. add the rxJava ,okio and Okhttp jar lib.

  2. This step is optional if u have a proxy problem like i did.

    String hostname = "10.84.10.11";
    int port = 3128;
    
    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(hostname, port));
    OkHttpClient client = new OkHttpClient.Builder().proxy(proxy).build();
    
    String url = "https://rinkeby.infura.io/v3/c270b7df7bf54378a96ef7fe28e54715";
    
    web3 = Web3j.build(new HttpService(url, client, true));