Pubsub sub goes forever

Hello, I am new to this site, but my GitHub issue was moved here.
I am trying to create my own kind of database using pubsub as a sync. tool.
I want everyone subscribe to the same pubsub, but when I try to do it, it goes forever and I get no answer.
pubsub sub cccp
and there is no answer at all…

Hello,

which ipfs porject do you use ? could you share a code ? or more simple could you post an issue on IPFS project.

Regards

Hello, I am using rust-ipfs-api, which was made by me and officially approved.
pub fn pubsub_sub(&mut self, topic: &str, discover: bool) -> Vec { let d = &parse_bool(discover); let l = format!("arg={}&discover={}", topic, d); self.url("/api/v0/pubsub/sub").args(&l).query() }
I use this method, which just makes a cURL request to the IPFS API. I don’t receive any answer from it, even if I use cURL alone.
curl .../api/v0/pubsub/sub?arg=cccp&discover=false

stupid question but "do you check if your ipfs daemon allow-origin in this configuration ? "

Regards

"Access-Control-Allow-Origin": [
    "*"
  ]

do you mean this?

yes but it seems ok.

Are your nodes connected in some way? To receive messages on a topic, you need to have a path (possibly through other nodes) to every other node subscribed to that topic.

how could I check it?

ipfs swarm peers | grep 'MY_OTHER_PEER_ID'.

You can also manually connect using ipfs swarm connect /ipfs/MY_OTHER_PEER_ID.

I have a question related to this topic, if it’s not the right place tell me and I’ll move it to separate question.

I’m trying to build a system that will be composed of two nodes:
The first node will run on an Android device and will use ipfs-go. That node will publish an HTML app using IPFS and will subscribe to a topic using pubsub.
The second node will be a browser which will use the first node published content and it will run js-ipfs node and it will publish a message on the same topic subscribed by the first node.

As I understand js-ipfs does not have any bootstrap nodes? (Addresses is always empty array).
Does it mean I need to have a common bootstrap node used by both of my nodes?
Should I add the ipfs-go node to the bootstrap list of the js node? (I can find a way to get that address out-of-band I think).

1 Like