帖子
分享您的知识。
Mar 22, 2024
专家问答
如何使用 toGatewayUrl 为图像组件保存 NFT 图片 URL?
我正在toGatewayURL
尝试使用保存 NFT 图像中的 URL 以用于图像组件. 但是,我不确定在函数调用中将什么指定为网关参数. 我曾尝试用hanlo.mypinata.cloud
作网关,但它不起作用. 此外,我还有一个可用于网关的代币. 如何正确配置toGatewayURL
相应的网关和令牌来保存 NFT 图片 URL?
- IPFS
- JavaScript
- NFT.Storage
0
1
分享
评论
答案
1Mar 22 2024, 12:55
提供该toGatewayURL
功能的库是 NFT.Storage. 但是,Pinata还在其文档页面上提供了大量的网关信息,网址为 https://docs.pinata.cloud/docs/gateways-page.
看来该toGatewayURL
函数需要网关网址和IPFS CID才能生成功能网址. 虽然使用像 “https://dweb.link/” 这样的通用网关就足够了,但如果你已经在使用他们的服务,利用Pinata的专用网关可能会提供更好的性能.
0
官方答案
评论
你知道答案吗?
请登录并分享。
The InterPlanetary File System (IPFS) is a protocol, hypermedia and file sharing peer-to-peer network for storing and sharing data in a distributed file system.
95帖子95答案