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.

  • I have a project in infura, add the address of the contract that I am going to use. Is the link I have to use the "endpoint"? – Nicolas Flores Muñoz Jan 3 at 14:37
  • Could be. It depends on the context. HTTP endpoint can be used to describe this link, yes – steve antwan Jan 3 at 14:40
  • this is the link "rinkeby.infura.io/v3/etc,etc,etc", with this I could connect to my contract and make transactions? – Nicolas Flores Muñoz Jan 3 at 14:44
  • Yes yes yes yes – steve antwan Jan 3 at 15:00

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.