Upload Static Assets to IPFS with Pinata

Ryan Harris
InstructorRyan Harris
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated 2 years ago

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.

~ 2 hours ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today