How would I upload these to Opensea?
This is another blog of mine which will show you how to upload images to Opensea. dev.to/victorquanlam/step-by-step-...
What do I do with the Png and the Json metadata? Do I need to upload both files to somewhere?
Yes you need to create new shapes folder and upload your png images there and you don't have to upload the Json metadata. It already be generated by the script below:
Furthermore, if I am creating a collection of 5,000 NFTs is there an automated way to upload each file to Opensea?
Yes and no. As right now, the opensea api doesn't support upload images YET. We will need to wait for the next version. This is their comment to the situation: "there isn't currently an option for that in your OpenSea profile, but we're constantly working on ways to improve user experience".
The only way for now is to create your own smart contract most likely on ETH chain. Then upload your images to IPFS server and connect your contract to opeasea. (I know! Yikes)
In response to my 2nd question, the Metadata will already be already included within the PNG files from that line of code you show? So I could just upload the image created onto Opensea and the metadata will also be uploaded too?
Ah okay! Still trying to wrap my head around the smart contracts, a lot more complicated than uploading each file one by one on Opensea :S
As you can see the metadata files will be generated under the metadata folder.
You can run this little javascript to update the meta data
constfetch=require('node-fetch');// Update [ADD_CONTRACT_ADDRESS] to your Contract AddressconstOPENSEA_URI='https://api.opensea.io/asset/ADD_CONTRACT_ADDRESS';// Maximum Tokens Belonging to ContractconstMAX_TOKENS=3349;// update OPENSEA_URIfunctionrefreshData(tokenId){constURI=`${OPENSEA_URI}/${tokenId}/?force_update=true`;constOPTIONS={method:'GET'};fetch(URI,OPTIONS).then(res=>res.json()).then(json=>{if(json.detail){console.log(`failed: ${tokenId}`);}elseif(json.token_id){console.log(`success: ${tokenId}`);}}).catch(err=>console.error(`failed: ${tokenId}`));};constrefreshTokens=(start,end)=>{Array.from({length:end-start+1},(x,i)=>start+i).forEach((tokenId)=>{refreshData(tokenId);});}letstart=0;letend=1;constid=setInterval(()=>{refreshTokens(start,end);if(end>MAX_TOKENS)clearInterval(id);start=end+1;end=start+1;},2000);
Sorry to keep asking questions! There is a lot to learn.
What do I put in here:
IMAGES_BASE_URI = "ADD_IMAGES_BASE_URI_HERE"
I'm still a little confused as to what to do after creating the PNG and Metadata files. Do I need to upload these onto IPFS and then upload that to Opensea? Or if I upload the PNG files directly to Opensea it would automatically do it for me?
This is where you store your images for public views. It can be used when creating your smart contract.
Hope this gives you enough hint. I'm working on a web app to generate pixelated nft arts at the moment so I don't have much time to explain things in much details. I would create a new blog post for creating ERC721 Token and nft in the near future.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Chris! Great questions.
How would I upload these to Opensea?
This is another blog of mine which will show you how to upload images to Opensea.
dev.to/victorquanlam/step-by-step-...
What do I do with the Png and the Json metadata? Do I need to upload both files to somewhere?
Yes you need to create new shapes folder and upload your png images there and you don't have to upload the Json metadata. It already be generated by the script below:
`
Furthermore, if I am creating a collection of 5,000 NFTs is there an automated way to upload each file to Opensea?
Yes and no. As right now, the opensea api doesn't support upload images YET. We will need to wait for the next version. This is their comment to the situation: "there isn't currently an option for that in your OpenSea profile, but we're constantly working on ways to improve user experience".
The only way for now is to create your own smart contract most likely on ETH chain. Then upload your images to IPFS server and connect your contract to opeasea. (I know! Yikes)
Thanks for your quick reply! :)
In response to my 2nd question, the Metadata will already be already included within the PNG files from that line of code you show? So I could just upload the image created onto Opensea and the metadata will also be uploaded too?
Ah okay! Still trying to wrap my head around the smart contracts, a lot more complicated than uploading each file one by one on Opensea :S
As you can see the metadata files will be generated under the metadata folder.
You can run this little javascript to update the meta data
`
Check this article out for more details about metadata
docs.opensea.io/docs/2-adding-meta...
Hope it helps.
Great thanks!
Sorry to keep asking questions! There is a lot to learn.
What do I put in here:
IMAGES_BASE_URI = "ADD_IMAGES_BASE_URI_HERE"
I'm still a little confused as to what to do after creating the PNG and Metadata files. Do I need to upload these onto IPFS and then upload that to Opensea? Or if I upload the PNG files directly to Opensea it would automatically do it for me?
This is where you store your images for public views. It can be used when creating your smart contract.
Hope this gives you enough hint. I'm working on a web app to generate pixelated nft arts at the moment so I don't have much time to explain things in much details. I would create a new blog post for creating ERC721 Token and nft in the near future.