Private p2p chat / file sharing with API

Hi,
I’m building a walkie talkie js app with my son to run on raspberry pi distributed among friends. Each rpi is connected to wifi at home and does not move. Around the rpi there should be a nice casing with a mic, a speaker some buttons and LEDs. There should not be channels at the beginning, and every audio message should be one to all.

I’m not sure if ipfs is the right tech, so I’m asking for guidance on a architectural level first. I don’t want to have a server architecture, to make the project easy to do in a DIY sense.

Here is my current plan:

  1. Create a private ipfs network (all communication should be stored, but kept privat)
  2. Preconfigure the RPis to connect to that network via ipfs binary.
  3. Share a folder with all the peers.
  4. Create a node js application to read the mic and create audio files in the shared folder using ipfs api for js.
  5. Trigger a callback if new files are added and play the audio file (“message received”)

The only part I don’t know how to do is triggering the message received callback. Is this possible to do with ipfs-js-api? or do I need other libraries to do so?

Thank you very much.

是的 ipfs-js-api 文档里有,你可以看下,也可以在IPFS实验室里找找

I could not find any part of the documentation explaining this type of callbacks. could you be so kind as to point me to the exact part of the documentation? Thanks a lot.

1 Like