ProtoSchool / protoschool.github.io

The code that runs the ProtoSchool website. Visit https://proto.school for interactive tutorials on decentralized web protocols. Explore IPFS and Filecoin through code challenges, code-free lessons, and local events.
https://proto.school
Other
166 stars 67 forks source link

New Tutorial: libp2p coding challenges with interaction btw multiple nodes #543

Open terichadbourne opened 4 years ago

terichadbourne commented 4 years ago

Once we enable libp2p validation under the hood, we hope to create our first libp2p tutorial.

Some discussion about content has already happened within the libp2p validation issue and on related calls, but this issue can be used as a place to clarify the proposed outline and track progress when we start drafting content.

zebateira commented 3 years ago

Instead of going with a code challenge tutorial, we can first create an introductory tutorial as multiple choice quizzes from some talks we've given in the past:

1. "The Life of a libp2p Connection" by Jacob

I'll use the first talks from Jacob as a base and then I'll incorporate some pieces from the other ones.

terichadbourne commented 3 years ago

Yesterday we published our first libp2p tutorial, a multiple-choice, code-free introduction to libp2p. Huge thanks to @zebateira for taking the lead on it!

@zebateira is actively working on the in-memory transport and additional under-the-hood needs for libp2p code validation that will allow us to build coding challenges in the future in which multiple nodes can interact. Please see issue #229 for continued updates on that effort.

Moving forward, we'll use this issue as the place to reflect the status of our first code-based libp2p tutorial, to be built by @yusefnapora. He'll be adding an outline here for our joint review and then will start building the lesson content of the tutorial as @zebateira wraps up the in-memory transport. Once the transport is ready, @yusefnapora will be able to build the code challenges, for which we already have a few ideas bouncing around in #229.

Super excited about the progress we're making on this!

yusefnapora commented 3 years ago

Here's what I have so far for the tutorial outline. @terichadbourne & @zebateira please let me know what you think. There are still a lot of details to work out, of course.

Structure for libp2p hands-on tutorial

Lesson 1 - The libp2p Node & peer IDs

Lesson 2 - Dialing another peer

Lesson 3 - Protocols

Lesson 4 - Implementing a protocol

Lesson 5 - Configuration

terichadbourne commented 3 years ago

@yusefnapora Thanks so much for the outline. Looking great!

I'll leave it to @zebateira to comment on the content itself, but just jumping in to say that in some cases I suspect you have too much content per lesson. The thought process I'd encourage here is: "What's the one thing I'm teaching and then testing in this lesson?"

For your current lesson 1, for example, I suspect that these bullets could be pulled out into 1 or 2 prior lessons to teach about the libp2p node (perhaps with a multiple choice quiz) separate from the peer IDs:

Introduce the tutorial and describe what we'll acomplish / set expectations

Introduce the libp2p Node object

Not focused on configuration yet, this is about describing what it's capable of

I don't have enough technical context to judge if there are other spots here where you could split a lesson into two, but would encourage you to consider it where it works.

Also I saw one spot where it looked like you were considering putting a quiz and a coding challenge in the same lesson. You can only do one format per lesson, so breaking the content apart into the chunks you want to test with each method would be required here.

yusefnapora commented 3 years ago

That's great feedback, thanks @terichadbourne. Lesson one could easily be split into two, and there are probably a few other places that are overloaded and could be split up. I'll work on that today and try to add more details to the bits that are still fuzzy.

zebateira commented 3 years ago

Love the outline so far! Really great simple initial concepts walk-through from the start. I was a little skeptical about the idea of leaving the configuration to the end, but I think I really like the outline as it progresses, good job!

I think Teri is right that this outline pushes a lot of content into each lesson.

Here is the initial tutorial structure for the content you presented better suited for our usual lesson length:

Lesson 1: The libp2p node - Introduce the tutorial and describe what we'll accomplish / set expectations - Introduce the libp2p Node object - Not focused on configuration yet, this is about describing what it's capable of - Maybe QA: what is the libp2p node?
Lesson 2: Peer IDs - Introduce Peer IDs - show examples & explain that peer ids are multihashes (link to definition) of public keys. - QA challenge: What is a Peer ID?
Lesson 3: Get Peer ID - Demonstrate how to get the peer id from a running node - Coding challenge: return the peer id of a pre-configured libp2p node ```js function getPeerId(libp2pNode) { const peerId = // fill in the blank! return peerId; } ```
Lesson 4: Dialing another peer - Describe how we open connections to other peers by "dialing" them - Explain that there are two dial methods, dial and dialProtocol - we focus on dial for now, next lesson covers dialProtocol - We can emphasize that we dial by peer ID, not address. Explain that libp2p tries to find the right address and keep track of it for us. - for now, gloss over how peer addresses are tracked / discovered.

Hope this makes sense, so you can restructure it from here.

Thank you! 🙏

yusefnapora commented 3 years ago

That sounds great @zebateira - maybe it's best to save the "how to build a protocol" stuff for a separate follow-up tutorial.

That will let us dig in a little deeper and make a (slightly) more involved example. I was thinking maybe a knock-knock joke protocol, since it has a nice "call and response" structure like a real protocol 😄

zebateira commented 3 years ago

maybe it's best to save the "how to build a protocol" stuff for a separate follow-up tutorial.

@yusefnapora I think that makes sense as well 👍

That will let us dig in a little deeper and make a (slightly) more involved example. I was thinking maybe a knock-knock joke protocol, since it has a nice "call and response" structure like a real protocol 😄

Good idea! Adding fun to the tutes works really well 💃

DantewithZYX commented 2 years ago

For upcoming meetups, I would really love to see lessons on DHTs, Content Routing and discovery algos in use and relative uses cases, ie pub/sub, gossipsub, graph-sync. These topics seem to bring the earlier concepts full circle.