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 = ""; 
 Web3ClientVersion client = new Web3ClientVersion();
 web3j = Web3jFactory.build(new HttpService(clientUrl));
       try {
        client = web3j.web3ClientVersion()

    }  catch (InterruptedException e) {
        } catch (ExecutionException e) {
 Log.e("client info: ", "Client version:  " + client.getWeb3ClientVersion() 
 + "\n");
  • Does your private Ethereum blockchain node (located here has enabled the json-rpc api? For example with geth: --rpc --rpcport "8501" --rpcaddr "" --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 --rpcport 8501 --rpcapi personal,db,eth,net,web3,txpool,admin,miner – Kebira AZBEG Jul 8 '19 at 10:42

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.