[SOLVED] Sample NFT shop: Curl error 1: Protocol IPFS not supported or disabled in Libcurl

Hello,

I wanted to ask the community and Moralis team about a Curl Error 1: Protocol IPFS not supported or disabled in Libcurl error that I am receiving when trying to display NFT’s in the sample NFT shop template.

What do I need to amend and in which script in order for this template to be pulling IPFS images correctly?

Thanks in advance!

what is the url that you try to access?

you should try to use a public gateway for ipfs and not ipfs protocol directly, for example an url from ipfs.io

There’s no specific URL set for this, or if there is, which file is it located in?

The template I am using is: https://github.com/MoralisWeb3/unity-web3-sample-nft-shop

Looking at the tutorial, the script used for player inventory is in Inventory/PlayerInventory.cs. You need to modify this so the ipfs:// protocol is replaced with an IPFS gateway. Something like:

var nftMetaData = nftOwner.Metadata; 
NftMetadata formattedMetaData = JsonUtility.FromJson<NftMetadata>(nftMetaData);

// change image link
if (formattedMetaData.image.StartsWith("ipfs://")) {
    formattedMetaData.image = formattedMetaData.image.Replace("ipfs://", "https://gateway.moralisipfs.com/ipfs/");
}

PopulatePlayerItem(nftOwner.TokenId, formattedMetaData);

Make sure to follow the tutorial for each part of the template you’re using.

Thank you Glad, this worked a treat.

Appreciate you taking your time and writing out the solution too!