Upload Static Assets to IPFS with Pinata

Ryan Harris
InstructorRyan Harris
Share this video with your friends

Social Share Links

Send Tweet

A placeholder image isn’t going to cut it for our awesome NFT tickets.

We can upload our own images to IPFS at https://www.pinata.cloud/

Ryan Harris: [0:00] In our current smart contract, we're hard coding the image value in our metadata by defining this SVG here. On the right, I have a new ticket image and collectible that I want to use instead of our placeholder. However, due to the file size limitation of smart contracts, we'll need to host this somewhere.

[0:18] We're going to use Pinata to upload our static assets to IPFS, otherwise known as the Interplanetary File System. Let's come into another tab. I'm already logged in, and you see we have an Upload button. We'll click that. Pick file, select a file. The first one I'm going to do is our collectible here.

[0:38] Now, if I come down below, you can see we have DD collectible, we can see it. We also have a CID number here which we're going to use later. Let's also go ahead and upload our ticket file. That one's called ddticket.svg. Upload and we have that as well with its own unique CID. Now that both of these images are hosted on a decentralized platform, we can use them in our NFT metadata.

[1:06] To review, we uploaded two static images to IPFS using Pinata, which we'll use in our smart contract.