Pin By CID
Upload a file already on the IPFS network to Pinata
This endpoint allows for an additional property in the pinataOptions
object to help our IPFS nodes find the content you would like pinned.
hostNodes
- multiaddresses of nodes your content is already stored on.
You can pass in the “multiaddresses” up to five host nodes that your content already resides on.
To find the multiaddresses of your own nodes, simply run the following on your node’s command line:
ipfs id
In the response, you’ll want to focus on the “Addresses” array that’s returned. Here you’ll find the multiaddresses of your node. These multiaddresses are what other IPFS nodes use to connect to your node.
In the “Addresses” array, take note of the multiaddress that contains your external IP address. Not the local ipv4 “127.0.0.1” address or the local ipv6 “::1” address.
Here’s an example of a full external ipv4 multiaddress (your IP address and node ID will differ):
/ip4/123.456.78.90/tcp/4001/ipfs/QmAbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIjKlMnOpQr
Once you’ve grabbed the full multiaddress for every node that already has your content pinned, simply add the “host_nodes” property to your pinataOptions object like so:
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
The CID of the file you want to pin to Pinata