Skip to content

Unable to connect to Ethereum Node #3

Description

@kuabhish
        System.out.println("7");
//        toastAsync("Connecting to Ethereum network...");
        // FIXME: Add your own API key here
        web3 = Web3j.build(new HttpService("https://kovan.infura.io/v3/75ef71603d6041bd9a259a4748404bd5"));
        System.out.println("8");
        try {
            Web3ClientVersion clientVersion = web3.web3ClientVersion().sendAsync().get();
//            Web3ClientVersion clientVersion = web3.web3ClientVersion().send();
            System.out.println("9");
            if(!clientVersion.hasError()){
                System.out.println("10");
                toastAsync("Connected!");
            }
            else {
                System.out.println("11");
                toastAsync(clientVersion.getError().getMessage());
            }
        } catch (Exception e) {
            System.out.println("12");
            System.out.println(e.getMessage());
            toastAsync(e.getMessage());
        }

Hello,

I am getting error here.

Error:

I/System.out: 7
I/System.out: 8
I/System.out: 12
    java.net.UnknownHostException: Unable to resolve host "kovan.infura.io": No address associated with hostname

Please help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions