1

This is the first time using infura with a Web3j HttpClient. I have seen people use a code after the url like this: "infura.io/--here--". Am I using Infura correctly?

This is my code. (web3j v3.5.0)

Web3j web3 = Web3j.build(new HttpService("https://rinkeby.infura.io/"));
Web3ClientVersion web3ClientVersion = null;                

try {
    web3ClientVersion = web3.web3ClientVersion().send();
} catch(IOException e) {
    e.printStackTrace();
}

String web3ClientVersionString = web3ClientVersion.getWeb3ClientVersion();
System.out.println("Web3 client version: " + web3ClientVersionString);
1

You need to create an infura account, and get the infura link with your API key at the end of it. It will look like a bunch of letters. Go to infura.io for this.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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