[SOLVED] Setting baseURI in ERC721, moralis IPFS not shownie metadata on opensea

hello, I am trying to set up the base URI of my nft collection. I used moralis ipfs storage to set up the storage of the images and metadata but am failing to reference it as the base URI for the erc20 token. this is how I am setting my URI, ‘ipfs://{metadataTokenCID}’.
what am i doing wrong?

What kind of standard it is? Erc20, 721, 1155?

Did you upload the data in a folder on IPFS?

After you changed the base uri, did you force a resync on opensea?

@cryptokid,

  1. its an ERC721
  2. yes I uploaded all the data through moralis to ipfs,
  3. yes, nothing is still showing.
    What’s the format of setting an erc721 setBaseUri?

Try to see what is the token uri now on chain. You can also use getTokenIdMetadata to see what it returns.

@cryptokid, the smart contract is on rinkeby at 0x1C194A0f0B954BD17e8fdaE947f7589EE2Ae52bE and the base uri i set as https://ipfs.io/ipfs/QmQ8kV9JuhkiSt7Qp7HTsiyVUiaobFeTTyjK71q5k8e46w/ . the getTokenIdMetadata returns a concatenation of the baseUri and token id. if i just check it out on a google search, I find nothing,
I think there could be an issue with the way I am setting the baseUri.

that url seems to point to this type of data:

[{
    "1":{
        "name":"zakayo1",
        "image":"https://gateway.pinata.cloud/ipfs/QmVTyyYt7RVwRx3C7VsFqPNZdYf866cRX6E1XF3TXj2jiu/zakayo1.jpg",
        "description":"..."
    },
    "2":{
        "name":"zakayo2",
        "image":"https://gateway.pinata.cloud/ipfs/QmVTyyYt7RVwRx3C7VsFqPNZdYf866cRX6E1XF3TXj2jiu/zakayo2.jpg",
        "description":"...
    
    },
...
}
]

I don’t think that this is the expected format for the data returned by a token uri

@cryptokid I have just changed the data to this, please check it out and let me know if that is the right format. i have also changed the baseUri to the metadata standard and it is still not showing on opensea, baseURI is ipfs://QmVK9JphGobZGKT8WZYD1CoTNUq37tdonzyvyadj4hZeSP/ and contract is0x1C194A0f0B954BD17e8fdaE947f7589EE2Ae52bE

you may have to use uploadFolder functionality to upload multiple metadata files in the same folder on IPFS

@cryptokid but I already did that on using moralis ipfs upload folder, do I have to do it directly to IPFS? and then pin it to pinata?

how did you do it? I didn’t see a folder by now in your examples

https://gateway.pinata.cloud/ipfs/QmVK9JphGobZGKT8WZYD1CoTNUq37tdonzyvyadj4hZeSP there it is.

ok, this seems to be a metadata file in that folder:

https://gateway.pinata.cloud/ipfs/QmVK9JphGobZGKT8WZYD1CoTNUq37tdonzyvyadj4hZeSP/metadata/0.json

now try to upload again without that .json extension, and that way maybe it works with your contract when it concatenates the token id at the end

Alright, Let me try that out and see if it works out.
however, metadata files have the .json extention. but let me try it out.

@cryptokid I have tried it out, here is the link to pinata https://gateway.pinata.cloud/ipfs/QmVK9JphGobZGKT8WZYD1CoTNUq37tdonzyvyadj4hZeSP,
seeing no changes in opensea even after setting the baseURI to ipfs://{CID}

I see same .json format:

https://gateway.pinata.cloud/ipfs/QmVK9JphGobZGKT8WZYD1CoTNUq37tdonzyvyadj4hZeSP/metadata/0.json

@cryptokid, sorry about that, i mean this https://gateway.pinata.cloud/ipfs/QmeS1BSypLJ3KP3NmpokErySopqqrUos8m6ULAygMCJh79

now it seems to be the right format, try to trigger a metadata refresh on opensea

1 Like

@cryptokid, hey, it’s finally showing after forcing a resync. thankyou.
please go check out the collection at https://testnets.opensea.io/assets/rinkeby/0x1c194a0f0b954bd17e8fdae947f7589ee2ae52be.
thanks once again for solving this with me.

1 Like

how did you force resync? Cause I am wokring with a script which is upgrading nfts, like I am adding one nft and change URI of all metadatas preset. After that all nfts metadata is not loading it says unamed collection. everything is there still.

This is the endpoint that you can use to resync metadata for a token id, in case that this is what you were looking for