This week was all about decentralized storage, decentralized infrastructure and indexing protocols. I didn't want to find myself caught in a late submission situation again, so I decided to start my week off by taking a look at the assignment.
We had to upload an image of our choice onto IPFS, which I did it using a library called
ipfs-http-client as part of the third task (hehe). I did initially try setting up a node locally on my work computer, but my intern company won't give me root access, which is a tragedy akin to that of the Titanic.
I found this task fun, because it gave me the opportunity to explore indexing protocols like the Graph Protocol, which I'd been meaning to do for a while. Exploring these protocols gave me an idea so as to how large the significance of these protocols are when it comes to the user experience. In order to deal with this, The Graph Protocol has set up a system of information using a set of curators, delegators and indexers, all of whom are incentivized using the GRT token.
The task was to write our own sub-graph to query any blockchain. I decided to follow this tutorial on The Graph's blog which involved writing queries for the Zoro marketplace, and the results of querying the indexed data and getting a live feed of it was just amazing.
Task3 was a relatively easier task than last week's, all we had to do was let the user post images and store them on
IPFS. I went about it in an unnecessarily complicated way. I created an array on the smart contract and fetched the data each time before displaying it on the frontend. This turned out to be extremely slow and I plan on creating a subgraph for my project and use that to fetch the data instead. Here's a fun little tip for you, DON'T USE PUBLIC IPFS GATEWAYS. Like seriously, just don't. They're ridiculously slow and most of the times just end up timing out.
I had heard that Moralis has a pretty fast gateway and I, the owner of an extremely large brain, decided to try scam them. My genius plans were sadly thwarted because they have protections in place to prevent loading IPFS images which weren't uploaded via them. I had to settle for ipfs.io this time, but next time I'll just bootstrap the project with Moralis to get that sweet sweet gateway experience.
Tasks aside, we fellows had a chat with our mentor Rod. We went over potential ideas that we could end up building during the last few weeks of the fellowship. We also had a great session by Piyush on the use cases of IPFS and how Filecoin plays an important role in incentivizing people on the network to store data on their systems to ensure permanence.
All in all, I had a good time completing the tasks. I also really want to look more into these indexers and hopefully implement subgraphs in a future project of mine.