1

I'm trying to create an android Dapp by using the web3j library. I'm using connection to a local private Ethereum blockchain. When I'm trying to display the Client version it returns null. This is the code:

 static public Web3j web3j = null;
 static String clientUrl = "http://192.168.1.33:8501"; 
 Web3ClientVersion client = new Web3ClientVersion();
 web3j = Web3jFactory.build(new HttpService(clientUrl));
       try {
        client = web3j.web3ClientVersion()
                 .sendAsync()
                 .get();

    }  catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
 Log.e("client info: ", "Client version:  " + client.getWeb3ClientVersion() 
 + "\n");
  • Does your private Ethereum blockchain node (located here 192.168.1.33:8501) has enabled the json-rpc api? For example with geth: --rpc --rpcport "8501" --rpcaddr "127.0.0.1" --rpccorsdomain "*" – Greg Jeanmart Jul 8 '19 at 8:35
  • Yes, this is my geth command : geth --datadir node1/ --syncmode full --port 30311 --rpc --rpccorsdomain "*" --rpcaddr 192.168.1.33 --rpcport 8501 --rpcapi personal,db,eth,net,web3,txpool,admin,miner – Kebira AZBEG Jul 8 '19 at 10:42
0

The problem is solved by disabling the firewall in my Blockchain node.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.