Viewing Content Through Your Gateway
To view content through your gateway, grab the CID of the file you’d like to view and add it to your gateway URL, like so:Restricted vs Open
All Pinata Dedicated Gateways are restricted by default. This mean they will only serve CIDs that are pinned to your account, which keeps your gateway safe from abuse by outside actors who may want to use it for themselves. If you plan to upload content to your own account then use your gateway to fetch it, you shouldn’t have to touch a thing and it will work as expected! However, lets say you’re building a marketplace and you need to fetch content outside your account. In that case, you will want to use Gateway Access Controls. Adding one of these will allow you to access CIDs from the public IPFS network, but it has to meet that access control condition, like a Gateway API Key or Host Origin requirement. Be sure to read our docs on Gateway Access Controls to learn more.The only way to open a Dedicated Gateway and allow any CID to go through is to
add a Gateway Access Control
Convert IPFS Links or Gateway URLs to use Your Dedicated Gateway
If you’re a developer building an app to index the blockchain, it’s likely you’ll encounter several IPFS URL formats that might not be ideal to work with:ipfs://
) or another gateway (https://ipfs.io
), and turn them into your specified Dedicated Gateway.
Adding a Custom Domain
Pinata also allows you to create a custom domain for your Dedicated Gateway. Simply visit the Gateways Page, click the menu button on the right side of your gateway, then click Add Custom Domain. You’ll need to own the domain you want to use. When you enter your domain, you will be prompted to enter DNS information through your registrar.Billing and Usage
When it comes to using a Dedicated Gateway, there are a few metrics Pinata uses for billing.Metric | Description |
---|---|
Bandwidth | Bandwidth is the amount of data that is being going through your Gateway. For instance, if you have a 10MB file go through your gateway 100 times, that would be 1GB of bandwidth used for the month. |
Requests | A request is anytime content is queried through the gateway, so if you run wget https://mygateway.mypinata.cloud/ipfs/QmVLwvmGehsrNEvhcCnnsw5RQNseohgEkFNN1848zNzdng in your terminal, that would be one request. Or if you had someone visit your app that uses the gateway on the client side, each time the website requests content from IPFS using the gateway, that’s a request. |
If you’re using a Dedicated Gateway for your NFT project, be sure to check out
this
guide
on how you should do that.