Communication between 2 nodes

I’m trying to learn IPFS, my current goal is to build as simple system as I can which allows for one peer to pass a photo to another peer. I assume that the both peers are connected to the network, I also ignore the question of how to find the other peer (I’ll post a question about that separately). I also not looking for long-term storage in the network, after the receiving node has the image it stores it locally.

The question: is there a way to communicate between 2 nodes (assuming I know the PeerID of both)?
I can use the experimental pub-sub but it looks a bit overkill.

you need only to send CID and PEER ID on the second peer check your second peer has the first PEER id on swarm peers list and get or cat CID.

Can you please explain that in more details?

that is example (maybe this code not works : https://gist.github.com/josselinchevalay/45e1fcec195f3b0ad68e0128ec296cb4

1 Like

if I understand correctly assumes I run a web-server at your_app_host, right?
If so it’s not good.
The point is to use IPFS alone to communicate between the nodes without a central server.

in this case in my knowledge you need to use pubsub or ipfs-cluster

1 Like

I am interested in this as well. Is there a way to run IPFS without relying on ipfs.io?

As far as I understand there is no dependency on ipfs.io.
Where do you see this dependency?
Do you mean https://gateway.ipfs.io maybe?

I think ipfs.io host servers that are used for discovery (equivalent of BitTorrent tracker?), but I might be wrong.

the ipfs protocol does not depend on ipfs.io to discover clients, but if you are talking about bootstrap nodes then those also are not connected to ipfs.io, although some might be hosted on the website. i think whyareusleeping said that he wants to remove them in a future update or when the network is large enough.