ProtoSchool
ProtoSchool
Interactive tutorials on decentralized web protocols
Blog | Lesson 1 of 7

Link an author to a blog post using its CID

In the Basics tutorial, we learned that a link in IPFS is represented as an instance of CID:

{
  linkToAwesomeNode: awesomeCid
}

When we give a field a name and make its value a link to a CID, we call this a named link.

The challenge below has some prepared code to get us started. The data structure resembles a blog which has two authors, Nat and Sam, and some blog posts about trees and computers. At the moment there’s no relation between them. Let’s update the blog posts so that they link to the author.

not yet startedTry it!

Modify the two existing blog posts by adding a new field author that links to the author of each post. The post about trees was authored by Sam, while Nat wrote the post about computers.

View SolutionReplace with SolutionClear Default Code
Update the code to complete the challenge. Click Submit to check your answer.