-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipfs image upload error: HTTPError: project id required #9
Comments
I have this error too. Any help would be greatly appreciated. |
I think this is an access issue to Infura's IPFS. Maybe take a look at the following issue page which has updates for Infura and Pinata. |
Yes @BCWeb3 this is the reason is not working anymore... since Infura closed their free ipfs node on august 2022. Now you need to access it with a project id and a secret key. You can do it as following: 1 2 Go to infura.io and create a new IPFS project, you have to fill your credit card details for it to work.. but you have 5gb free and then you pay few cents for every request that exceed the 5GB. once you created it, pick your projectId and secret key from there. 3 on create page do the following ( i commented whats not needed anymore): import { useState } from "react";
import { ethers } from "ethers";
import { Row, Form, Button } from "react-bootstrap";
import { Buffer } from "buffer";
import { create as ipfsHttpClient } from "ipfs-http-client";
// const client = ipfsHttpClient('https://ipfs.infura.io:5001/api/v0')
const projectId = "your infura project ID";
const projectSecret = "your infura secretKey";
const subdomain = "YOUR_SUBDOMAIN_NAME.infura-ipfs.io";
// Pay attentnion at the space between Basic and the $ in the next line
// encrypt the authorization
const authorization = `Basic ${Buffer.from(`${projectId}:${projectSecret}`).toString("base64")}`;
// with this next variable, you are passing the necessary information in the request to infura, notice authorization
// is being passed as argument headers
const client = ipfsHttpClient({
host: "infura-ipfs.io",
port: 5001,
protocol: "https",
headers: {
authorization: authorization,
},
}); then below, in the same file you change these 2 lines: // setImage(`https://ipfs.infura.io/ipfs/${result.path}`)
setImage(`${subdomain}/ipfs/${result.path}`);
// const uri = `https://ipfs.infura.io/ipfs/${result.path}`
const uri = `${subdomain}/ipfs/${result.path}`; |
Thank you so much @Coin-Spark I followed your very clear and helpful instructions and I can now upload and view NFTs. Great! |
where do we get our subdomain name |
i can view nfts on ipfs server, but those are not seen on my dashboard, please help |
Hey @ethan-crypto, a few people are facing this issue while uploading NFTs to Infura IPFS. It is due to them removing the public domain and now, everyone should have a enabled custom domain to upload a NFT to IPFS. |
Sure. Let me do that asap. Sent from my iPhoneOn Apr 24, 2023, at 2:41 PM, Dhruv ***@***.***> wrote:
Hey @ethan-crypto, a few people are facing this issue while uploading NFTs to Infura IPFS. It is due to them removing the public domain and now, everyone should have a enabled custom domain to upload a NFT to IPFS.
I have the solved this issue and have the changes ready with code. Can you assign this task to me?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hey @ethan-crypto I have opened a PR with the fixed code. Could you check it and merge? |
Hello, I've solved all the issues you're experiencing while watching this video in 2023, explained the solution in a video to make it more beginner-friendly, and also uploaded the updated code to my git repository. Please find all links below Video link - https://youtu.be/rHBuddTLzR0 |
The text was updated successfully, but these errors were encountered: