Update README.md

This commit is contained in:
Jimmy Debe 2024-01-08 00:28:35 -05:00 committed by GitHub
parent 4fc42dfbe8
commit d55dba9769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 10 deletions

View File

@ -2,18 +2,18 @@
## Introduction ## Introduction
This is the first guide in the tutorial demonstatraing how to build your own Waku node using python. This is a tutorial demonstatraing how to build your own Waku node using python.
Waku provides a collection of protocols on top of libp2p to create mesage anonymity. Waku provides a collection of protocols on top of libp2p providing messaging anonymity,.
These guides will use the core protocols of Waku, as described in [10/WAKU2](https://rfc.vac.dev/spec/10/), This guide will use the core protocols of Waku v2, as described in [10/WAKU2](https://rfc.vac.dev/spec/10/),
other protocols can be added to your node after completing the tutorial. other protocols can be added to your node after completing the tutorial.
This tutorial will focus on the Waku Relay protocol. To start, we will implement the [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/) protocol.
## Configuration ## Configuration
Nodes must use configurations detailed in [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/). Your node must use configurations detailed in [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/).
The [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/) is the most important protocol to implement, The [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/) is the most important protocol to implement,
as a Waku node should be a running a relay, as detailed (here)[]. as all Waku nodes should be a running a relay.
Since this is the first
Let's set up the basic libp2p modules that are need for a Waku Relay. Let's set up the basic libp2p modules that are need for a Waku Relay.
First, lets create a directory for our new project: First, lets create a directory for our new project:
@ -36,19 +36,26 @@ In your new directory, download the supported py-libp2p from the github reposito
``` ```
## Configuration ## Configuration
A Waku node is Publish/Subscribe which allows peers to communicate with each other. A Waku node uses Publish/Subscribe, pubsub, to allow peers to communicate with each other.
Publish/Subscribe allows peers to join topics, within a network, Using pubsub, peers are able to join topics, within a network,
that they are interseted in. that they are interseted in.
Once joined, they are able to send and recieve messages within the topic. Once joined, they are able to send and recieve messages within the topic.
The gossipsub protocol is the Publish/Subscribe protocol used in a Waku node. The gossipsub protocol is the Publish/Subscribe protocol used in a Waku node.
To implement gossipsub on your Waku node,
first we will import the proper packages.
``` python ``` python
# import the necessary py-libp2p # import the necessary py-libp2p
from libp2p.pubsub import pubsub from libp2p.pubsub import pubsub
from libp2p.pubsub import gossipsub from libp2p.pubsub import gossipsub
from libp2p.peer.id import ID from libp2p.peer.id import ID
class WakuNode():
def start() -> None:
``` ```