Crate pubsub

source ยท
Expand description

PubSub example

This example starts two bootstrapped Hermes IPFS Nodes and subscribes them to the ipfs-chat topic, creating an async stream for incoming topic publications for each node. Another set of async streams are created for swarm pubsub events related to the topic.

The example then spawns different async tasks that run in a loop.

  • The task that reads from the topic stream for Node A
  • The task that reads from the topic stream for Node B
  • The task that reads from the topic swarm events for Node A
  • The task that reads from the topic swarm events for Node B
  • The task that reads lines from stdin and publishes them as either node.

Enumsยง

  • PeerLine ๐Ÿ”’
    Helpful enum for toggling which peer reads lines from stdin

Functionsยง