February 2019
Intermediate to advanced
450 pages
9h 59m
English
The IPFS has an experimental feature, which is Publish-Subscribe, or pubsub. Basically, a node in the IPFS can subscribe to a topic. Let's say this topic is a Bitcoin topic. A node in the IPFS can publish a To the moon! message to a bitcoin topic. Then, any node that subscribes to the 'bitcoin' topic could get the message.
Because pubsub is an experimental feature, you need to run IPFS daemon with a particular flag. Run IPFS daemon with the --enable-pubsub-experiment flag using the following command:
$ ipfs daemon --enable-pubsub-experiment
Both the subscriber and the publisher need to run the daemon with this particular flag.
Let's create a script to subscribe to a certain topic and name the script subscribe_topic.py:
import ipfsapi ...