0

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
0

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

| improve this answer | |
0

This error comes from the Class EnsResolver as shown above "org.web3j.ens.EnsResolutionException" and it is saying that the node you are connected to does not have a Public Resolver installed in that could provide an access to the API.

"Your node does not Provide an access to a valid public resolver in order to access other API methods."

Before using the command you should check if there is a support for ENS on the node you are connected, using the command Check Interface Support: Check this link.

"Callers must not assume that a domain uses the current version of the public resolver, or that all of the methods described here are present. To check if a resolver supports a feature, see Check Interface Support."

So to sum up your node does not have one Public Resolver in it, so it can not provide the ENS Resolver method for you.

[Edit] As you said in your post that you have setup a private node, you should try a public well known node. It may help you the: Infura nodes (endpoints).

If you want to follow a nice TUTORIAL try this link.

Also check out this link.

| 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.