[Ethereum] web3j – Unable to determine sync status of node

go-ethereumweb3js

I have setup a private ethereum node in my laptop using below command.

geth –datadir=./chaindata/ init ./genesis.json

geth –datadir=./chaindata/ –rpc console

The chainId in genesis.json is set to 10 to avoid connecting to main ethereum network. web3j java library is used to send some ether to another account.

   Web3j web3j = Web3j.build(new HttpService());  
    log.info("Connected to Ethereum client version: "
            + web3j.web3ClientVersion().send().getWeb3ClientVersion());

    Credentials credentials =
            WalletUtils.loadCredentials(
                    "password",
                    "path-to-wallet-file");

    log.info("Sending 1 Wei ("
            + Convert.fromWei("1", Convert.Unit.ETHER).toPlainString() + " Ether)");
    TransactionReceipt transferReceipt = Transfer.sendFunds(
                web3j, credentials,
                "to-account",  
                BigDecimal.ONE, Convert.Unit.WEI)  // 1 wei = 10^-18 Ether
                .sendAsync().get();

What is the root cause for the below exception ?

java.util.concurrent.ExecutionException: org.web3j.ens.EnsResolutionException: Unable to determine sync status of node

Best Answer

The issue is due to having an invalid wallet address in to-account parameter in sendFunds() method.

Related Topic