Context: I finally sat down and started my P2P social network. Basically, everyone gets a blockchain with a reference to the current block (profile pic, and name) in an index file, in the user’s root directory. All of that’s taken care of, as well as a parser, and timeline constructor.
Problem is, I’m using js-ipfs. From several old results on Google, I’ve come to the conclusion that ipfs.name.publish() is broken for the project. Every time I try to use it, an error is thrown.
So, I’m making a pubsub topic where my users can request key/CID pairs (lets call the topic, “roots”).
Users would also be subscribed to the topic of their PeerID. So any responses directed at their PeerID would go to them.
I need a way to propagate the key/CID pair to about 100 random peers subscribed to the roots topic.
Is there a way to limit the number of peers returned (and make them random) with ipfs.pubsub.peers()?