0

In this tutorial show how in the following code how to connect to the infura project using android devices, but today this code shows the error "project id is required"

Is there a way to send credentials about projectid and keysecret with the IPFS Library or need use something like HttpUrlConnection?

//Implementing IPFS with Infura API's
MultiAddress IPFS_INFURA_URL = new MultiAddress("/dnsaddr/ipfs.infura.io/tcp/5001/https");

//Creating an IPFS client:
IPFS ipfsClient;

//Better to separate declaration and definition as connecting to the client requires a network call
//In Android, a network call cannot be performed on the main thread
//Doing so produces a Android.OS.NetworkOnMainThreadException

new Thread(new Runnable() {
    @Override
    public void run() {
        ipfsClient = new IPFS(IPFS_INFURA_URL);
    }
}).start();

1 Answer 1

0

You need the project id, you can create one at https://www.infura.io/ Your project ID is also called key in infura.

Infura Api key

8
  • Yes, i know... but how can send project id using IPFS class in Java? Commented Nov 21, 2022 at 10:02
  • MultiAddress IPFS_INFURA_URL = new MultiAddress("/dnsaddr/ipfs.infura.io/tcp/5001/https"); Change the URL by the IPFS url created by infura, Create new key -> IPFS Commented Nov 21, 2022 at 10:16
  • I tried with the infura url (ipfs.infura.io:5001/api/v0) send me a error... i will show for you Commented Nov 21, 2022 at 10:18
  • .... that is not the the infura url.. you need to generate one with your account Commented Nov 21, 2022 at 10:19
  • I have a key created in infura ... When i use MULTIADDRESS send me this error: Caused by: java.lang.IllegalStateException: MultiAddress must start with a / Commented Nov 21, 2022 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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