问题标签 [tokenuri]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
86 浏览

uri - IPFS uri 格式:https://ipfs.io/ipfs/与 ipfs://?

这是我的测试 tokenURI.json 文件,其中包含我传递给我的令牌 contract.setTokenURI() 的 imageURI:

这是使用 esp 的最佳 IPFS uri 形式。如果我想将此 NFT 加载到 Opensea 中?

IPFS 中的文档推荐:

但 Opensea 中的文档建议:

哪种形式更好,为什么?

在上面的 json 中,我使用的是 IPFS 推荐的第一种形式。它可以工作,但加载到 Opensea 很慢/有点不可预测。

Opensea 推荐的形式更短,没有网关。如果我使用第二种形式,图像在 Opensea 中的加载速度会更快吗?

IPFS 文档:在 Web 上寻址 IPFS

Opensea docs:
如果您使用 IPFS 托管元数据,您的 URL 应采用 ipfs://CID 格式。例如,ipfs://QmTy8w65yBXgyfG2ZBg5TrfB2hPjrDQH3RCQFJGkARStJb。