我正在创建DAPP,并成功地使用IPFS(Pinata)& nethereum(C#)。
现在,我可以在erc721uristorage.sol中使用tokenuri函数获得tokenuri,例如 ipfs:// qmrh9pttads3bcqmlqxeamp83foaemd83foaemd8cukngtxz5hktlq
。
以下是元数据的链接大约相同的NFT。
()
但是,在opensea testnet中,我可以' t请参阅有关我的NFT的信息。 (我可以看到我的nft,但是没有图像,名称,描述等等..)
要解决此问题,我检查了我的合同是否有效https://testnets-api.opensea.io/asset/0x1770A249C9743F1493C55fE505BC17beAB772cD5/4/validate/.有一些错误:“ attributeError:'str'对象没有属性'get'”,但是我不知道它是什么。
即使我可以得到tokenuri,为什么不opensea?在此文档中( https://docs.opensea.io/docs/docs/metadata-standard- >),他们说,如果我想使用IPF托管我的元数据,则URL应该以IPFS://的格式(例如 ipfs:// qmrh9pttads3bcqmlqxeamp83foaeamd83foaeamd8cukngtxzz5hktlq 。)工作。
I was creating the DApp and succeeded to mint NFT in Rinkeby using IPFS (pinata) & Nethereum (C#).
Now, I can get TokenURI using tokenURI function in ERC721URIStorage.sol, like ipfs://QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq
.
Below is link of the metadata about same NFT.
(https://ipfs.io/ipfs/QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq)
But, in opensea testnet, I can't see the information about my NFT. (I can see my NFT, but there is no image, name, description, and so on..)
To solve this problem, I checked if my contract is valid or not in https://testnets-api.opensea.io/asset/0x1770A249C9743F1493C55fE505BC17beAB772cD5/4/validate/. There is some error : "AttributeError: 'str' object has no attribute 'get'", but I don't know what it is..
Even though I can get TokenURI, why doesn't opensea? In this docs (https://docs.opensea.io/docs/metadata-standards), they say if I want to use IPFS to host my metadata, URL should be in the format ipfs:// (like ipfs://QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq
.) I followed that, but it doesn't work.
发布评论
评论(2)
哦,我发现我在IPFS中的JSON不是JSON,因为它被“”包围。
这意味着Opensea将无法从我的元数据中获得一些东西,因为它是字符串。
我使用了另一个样品元数据()不是我的,而且效果很好!
因此,我必须修复将元数据上传到IPF的代码。
我尚未完全解决问题,但我找到了原因,所以我会退出这个问题。解决此问题后,我将再次发布。
Oh, I find that my json in ipfs is not a json, because it is surrounded with "".
It means that opensea will fail to get something from my metadata because it is string.
I used another sample metadata (https://ipfs.io/ipfs/bafybeibnsoufr2renqzsh347nrx54wcubt5lgkeivez63xvivplfwhtpym/metadata.json) which is not mine, and it worked very well!
Therefore, I have to fix the code for uploading metadata to ipfs.
I have not solved the problem completely, but I find the cause, so I will quit this question. After I solve this problem, I will post again.
只需将其放在智能合同中TADA的解决
just put this in smart contract tada its solved